-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[camera_avfoundation] Fix incorrect types in image stream events #9418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[camera_avfoundation] Fix incorrect types in image stream events #9418
Conversation
Maybe it's out of scope for this PR, but now that this file is Swift the event channel could be converted to a Pigeon event channel. That would make this class of bug impossible here, because we'd have actual type checking. |
I agree 100%, but I wanted to fix this ASAP because it seems to affect a number of people. I will open an issue for the pigeon refactor |
I just noticed that the Pigeon generation is still Obj-C, so switching to Pigeon event channels would be a much bigger change than I had realized. Definitely out of scope here! |
5807492
to
0c40ab0
Compare
@hellohuanlin Take a look at this PR, please. I would like to resolve this issue and move forward with the migration |
0c40ab0
to
809abf3
Compare
"sensorExposureTime": NSNumber( | ||
value: captureDevice.exposureDuration().seconds * 1_000_000_000), | ||
"sensorSensitivity": NSNumber(value: captureDevice.iso()), | ||
"lensAperture": Double(captureDevice.lensAperture()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was it trying to convert a closure (memory address) to double?
@RobertOdrowaz is this ready to land? |
It is, I'm just waiting for the tree to get green again. BTW does auto-submit take the tree status into account? I assume it does, but I wasn't sure, so I didn't add it |
Yep |
Fixes the types used in the image stream events. Most importantly, it corrects the
lensAperture
tolensAperture**()**
that caused a crash. Some other arguments were also updated to match exactly the types expected by the parsing intype_conversions.dart
.Resolves: flutter/flutter#170240
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3