Skip to content

[camera_avfoundation] Fix incorrect types in image stream events - #9418

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
leancodepl:fix/camera-avfoundation-image-streaming
Jun 18, 2025
Merged

auto-submit[bot] merged 1 commit into
flutter:mainfrom
leancodepl:fix/camera-avfoundation-image-streaming

Conversation

@RobertOdrowaz

Copy link
Copy Markdown
Contributor

Fixes the types used in the image stream events. Most importantly, it corrects the lensAperture to lensAperture**()** that caused a crash. Some other arguments were also updated to match exactly the types expected by the parsing in type_conversions.dart.

Resolves: flutter/flutter#170240

Pre-Review Checklist

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

Footnotes

  1. 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

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

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.

@RobertOdrowaz

Copy link
Copy Markdown
Contributor Author

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

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

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!

@RobertOdrowaz
RobertOdrowaz force-pushed the fix/camera-avfoundation-image-streaming branch from 5807492 to 0c40ab0 Compare June 17, 2025 16:00
@RobertOdrowaz

Copy link
Copy Markdown
Contributor Author

@hellohuanlin Take a look at this PR, please. I would like to resolve this issue and move forward with the migration

@RobertOdrowaz
RobertOdrowaz force-pushed the fix/camera-avfoundation-image-streaming branch from 0c40ab0 to 809abf3 Compare June 17, 2025 20:38
"sensorExposureTime": NSNumber(
value: captureDevice.exposureDuration().seconds * 1_000_000_000),
"sensorSensitivity": NSNumber(value: captureDevice.iso()),
"lensAperture": Double(captureDevice.lensAperture()),

Copy link
Copy Markdown
Contributor

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?

@hellohuanlin

Copy link
Copy Markdown
Contributor

@RobertOdrowaz is this ready to land?

@RobertOdrowaz

Copy link
Copy Markdown
Contributor Author

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

@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 18, 2025
@hellohuanlin

Copy link
Copy Markdown
Contributor

does auto-submit take the tree status into account?

Yep

@auto-submit
auto-submit Bot merged commit 93e91f3 into flutter:main Jun 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 19, 2025
github-merge-queue Bot pushed a commit to flutter/flutter that referenced this pull request Jun 19, 2025
flutter/packages@715a0a5...0ec4053

2025-06-19 [email protected] Roll Flutter from
8303a96 to 85a9b4f (93 revisions) (flutter/packages#9457)
2025-06-19 [email protected] [go_router]
Update sype safe routing topic to use mixin from go_router_builder 3.0.0
(flutter/packages#9422)
2025-06-19 [email protected] [go_router] fix:
PopScope.onPopInvokedWithResult not called in branch routes
(flutter/packages#9245)
2025-06-18 [email protected] [pigeon]
Create a message call free InstanceManager when running unit tests
(flutter/packages#9395)
2025-06-18 [email protected] [go_router] Use
library prefix for meta (flutter/packages#9434)
2025-06-18 [email protected] [go_router] fix
Popping state and re-rendering scaffold at the same time doesn't update
the URL on web [new] (flutter/packages#8352)
2025-06-18 [email protected] [camera_avfoundation] Fix
incorrect types in image stream events (flutter/packages#9418)
2025-06-18 [email protected] [go_router_builder] Temporarily
restrict `build` (flutter/packages#9453)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Ortes pushed a commit to Ortes/packages that referenced this pull request Jun 25, 2025
…tter#9418)

Fixes the types used in the image stream events. Most importantly, it corrects the `lensAperture` to `lensAperture**()**` that caused a crash. Some other arguments were also updated to match exactly the types expected by the parsing in `type_conversions.dart`.

Resolves: flutter/flutter#170240

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 21, 2025
flutter/packages@715a0a5...0ec4053

2025-06-19 [email protected] Roll Flutter from
8303a96 to 85a9b4f (93 revisions) (flutter/packages#9457)
2025-06-19 [email protected] [go_router]
Update sype safe routing topic to use mixin from go_router_builder 3.0.0
(flutter/packages#9422)
2025-06-19 [email protected] [go_router] fix:
PopScope.onPopInvokedWithResult not called in branch routes
(flutter/packages#9245)
2025-06-18 [email protected] [pigeon]
Create a message call free InstanceManager when running unit tests
(flutter/packages#9395)
2025-06-18 [email protected] [go_router] Use
library prefix for meta (flutter/packages#9434)
2025-06-18 [email protected] [go_router] fix
Popping state and re-rendering scaffold at the same time doesn't update
the URL on web [new] (flutter/packages#8352)
2025-06-18 [email protected] [camera_avfoundation] Fix
incorrect types in image stream events (flutter/packages#9418)
2025-06-18 [email protected] [go_router_builder] Temporarily
restrict `build` (flutter/packages#9453)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…tter#9418)

Fixes the types used in the image stream events. Most importantly, it corrects the `lensAperture` to `lensAperture**()**` that caused a crash. Some other arguments were also updated to match exactly the types expected by the parsing in `type_conversions.dart`.

Resolves: flutter/flutter#170240

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…tter#9418)

Fixes the types used in the image stream events. Most importantly, it corrects the `lensAperture` to `lensAperture**()**` that caused a crash. Some other arguments were also updated to match exactly the types expected by the parsing in `type_conversions.dart`.

Resolves: flutter/flutter#170240

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…tter#9418)

Fixes the types used in the image stream events. Most importantly, it corrects the `lensAperture` to `lensAperture**()**` that caused a crash. Some other arguments were also updated to match exactly the types expected by the parsing in `type_conversions.dart`.

Resolves: flutter/flutter#170240

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Nakiha pushed a commit to Nakiha/VoidPlayer-Flutter that referenced this pull request Sep 28, 2026
flutter/packages@715a0a5...0ec4053

2025-06-19 [email protected] Roll Flutter from
2f9715c to 2beb872 (93 revisions) (flutter/packages#9457)
2025-06-19 [email protected] [go_router]
Update sype safe routing topic to use mixin from go_router_builder 3.0.0
(flutter/packages#9422)
2025-06-19 [email protected] [go_router] fix:
PopScope.onPopInvokedWithResult not called in branch routes
(flutter/packages#9245)
2025-06-18 [email protected] [pigeon]
Create a message call free InstanceManager when running unit tests
(flutter/packages#9395)
2025-06-18 [email protected] [go_router] Use
library prefix for meta (flutter/packages#9434)
2025-06-18 [email protected] [go_router] fix
Popping state and re-rendering scaffold at the same time doesn't update
the URL on web [new] (flutter/packages#8352)
2025-06-18 [email protected] [camera_avfoundation] Fix
incorrect types in image stream events (flutter/packages#9418)
2025-06-18 [email protected] [go_router_builder] Temporarily
restrict `build` (flutter/packages#9453)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: camera platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[camera_avfoundation] Crash when opening camera stream starting from 0.9.19+2

3 participants