Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[camera]remove CAS operation and use dispatch queue instead #4973

Merged
merged 4 commits into from
Mar 8, 2022

Conversation

hellohuanlin
Copy link
Contributor

@hellohuanlin hellohuanlin commented Mar 2, 2022

This PR removes the CompareAndSwap (CAS) operation and replaces it with a dispatch queue, as discussed in the proposal.

Also removed volatile keyword since dispatch queues are already memory barriers.

I only added tests related to latestPixelBuffer which is the scope of this PR. But in the future we should add more sample buffer tests because it's one of the most complicated piece for this plugin, which it has almost zero coverage.

This should be the last required item listed in flutter/flutter#96429.

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@hellohuanlin hellohuanlin force-pushed the camera_pixel_buffer branch 11 times, most recently from 4bd27c1 to 97cbe87 Compare March 2, 2022 02:13
@hellohuanlin hellohuanlin marked this pull request as ready for review March 2, 2022 02:15
@hellohuanlin hellohuanlin force-pushed the camera_pixel_buffer branch from 97cbe87 to 5bb5051 Compare March 2, 2022 02:20
@hellohuanlin hellohuanlin force-pushed the camera_pixel_buffer branch from 6902ead to e112831 Compare March 8, 2022 06:00
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits.

@hellohuanlin hellohuanlin added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Mar 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: camera platform-ios waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants