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

[camera] Fix ImageStream ImageFormatGroup is Ignored in iOS #4519

Merged
merged 13 commits into from
Jan 27, 2022
Merged

[camera] Fix ImageStream ImageFormatGroup is Ignored in iOS #4519

merged 13 commits into from
Jan 27, 2022

Conversation

zuvola
Copy link
Contributor

@zuvola zuvola commented Nov 18, 2021

Fixes flutter/flutter#93842

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.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@stuartmorgan stuartmorgan removed the request for review from bparrishMines November 18, 2021 21:21
@zuvola zuvola marked this pull request as draft November 22, 2021 05:04
@zuvola zuvola marked this pull request as ready for review November 24, 2021 04:22
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

This change looks like it makes sense, but I'm having a hard time reconciling the change with the description of the issue (and the test). It looks like it wasn't being ignored, it was being tracked statically rather than per-instance—which I would expect to result in issues only if there were multiple instances of the camera. Am I missing something important about the old implementation?

@@ -371,6 +370,8 @@ - (instancetype)initWithCameraName:(NSString *)cameraName
_focusMode = FocusModeAuto;
_lockedCaptureOrientation = UIDeviceOrientationUnknown;
_deviceOrientation = orientation;
// Format used for video and image streaming.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments about the purpose of a variable should be on the declaration (in this case, the property) not the assignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed it.

@zuvola
Copy link
Contributor Author

zuvola commented Dec 1, 2021

Thank you for the review.
The previous implementation only changed the static variable ’videoFormat’ during initialize, but did not assign a value to _captureVideoOutput.videoSettings.
Therefore, the actual captured image would be the default BGRA, and the values I set would be ignored.

@zuvola zuvola requested a review from stuartmorgan December 14, 2021 02:05
@godofredoc godofredoc changed the base branch from master to main January 6, 2022 22:52
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation, LGTM!

@cyanglaz for secondary review.

Copy link
Contributor

@bparrishMines bparrishMines 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 a small nit pick. The version will also need to be bumped one more time.

@google-cla google-cla bot added the cla: no label Jan 26, 2022
@google-cla google-cla bot removed the cla: yes label Jan 26, 2022
@stuartmorgan
Copy link
Contributor

@bparrishMines I resolved the conflicts and applied your suggestion to the CHANGELOG

Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

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

LGTM

@bparrishMines
Copy link
Contributor

bparrishMines commented Jan 26, 2022

It looks like setting the default email for an organization is still an issue: todogroup/gh-issues#32. I'll fix the CLA manually.

@google-cla google-cla bot added cla: yes and removed cla: no labels Jan 26, 2022
@stuartmorgan stuartmorgan 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 Jan 26, 2022
@fluttergithubbot fluttergithubbot merged commit e282dfb into flutter:main Jan 27, 2022
@zuvola zuvola deleted the fix_ios_video_format branch January 27, 2022 04:27
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes 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.

[camera] ImageStream ImageFormatGroup is Ignored in iOS
4 participants