[android_camera_camerax] Fix incorrect camera mirroring for front cameras on devices using ImageReader Impeller backend#9233
Merged
auto-submit[bot] merged 15 commits intoflutter:mainfrom Jun 12, 2025
Conversation
ImageReader Impeller backendImageReader Impeller backend
ImageReader Impeller backendImageReader Impeller backend
camsim99
commented
Jun 3, 2025
Contributor
Author
camsim99
left a comment
There was a problem hiding this comment.
These look great, thank you! Just added some suggestions for clarity in case someone has to revisit this later :)
packages/camera/camera_android_camerax/test/preview_rotation_test.dart
Outdated
Show resolved
Hide resolved
packages/camera/camera_android_camerax/test/preview_rotation_test.dart
Outdated
Show resolved
Hide resolved
This reverts commit e2fba01.
camsim99
commented
Jun 12, 2025
Contributor
Author
camsim99
left a comment
There was a problem hiding this comment.
LGTM! Just found an extra space
Contributor
Author
|
@jesswrd and I worked on this PR together, so we'll need another reviewer to land this PR! |
Co-authored-by: Camille Simon <[email protected]>
reidbaker
reviewed
Jun 12, 2025
| // If the camera is front facing, mirror the camera preview | ||
| // according to the current device orientation. | ||
| Widget cameraPreview = widget.child; | ||
| if (widget.facingSign == 1) { |
Contributor
There was a problem hiding this comment.
Why is == 1 the correct comparison here?
Contributor
Author
There was a problem hiding this comment.
Ah because facingSign maps to the sign in https://developer.android.com/media/camera/camera2/camera-preview#orientation_calculation, which is 1 for front cameras, -1 for back facing cameras. I'll add a comment to the code!
reidbaker
approved these changes
Jun 12, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 13, 2025
…ront cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 13, 2025
…ront cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233)
github-merge-queue bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jun 13, 2025
flutter/packages@6d3aaf4...c5ab57a 2025-06-13 [email protected] [flutter_svg] feat: Expose the renderStrategy property in SvgPicture (flutter/packages#9373) 2025-06-12 [email protected] [go_router] Add routing functions to GoRouteData (flutter/packages#9277) 2025-06-12 [email protected] [various] Update example apps to Swift (flutter/packages#9347) 2025-06-12 [email protected] Roll Flutter from 824868f to f79452e (94 revisions) (flutter/packages#9419) 2025-06-12 [email protected] [android_camera_camerax] Fix incorrect camera mirroring for front cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233) 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
…eras on devices using `ImageReader` Impeller backend (flutter#9233) Fixes the incorrect camera mirroring when the front camera is used on devices that use the `ImageReader` Impeller backend. TLDR: for relevant rotated preview implementation, when the front camera is used, mirror the camera preview across the y-axis when the device is in a portrait orientation or across the x-axis when the device is in a landscape orientation. Fixes flutter/flutter#156974. cc @jesswrd, co-author of this PR ## 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@6d3aaf4...c5ab57a 2025-06-13 [email protected] [flutter_svg] feat: Expose the renderStrategy property in SvgPicture (flutter/packages#9373) 2025-06-12 [email protected] [go_router] Add routing functions to GoRouteData (flutter/packages#9277) 2025-06-12 [email protected] [various] Update example apps to Swift (flutter/packages#9347) 2025-06-12 [email protected] Roll Flutter from 824868f to f79452e (94 revisions) (flutter/packages#9419) 2025-06-12 [email protected] [android_camera_camerax] Fix incorrect camera mirroring for front cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233) 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
…eras on devices using `ImageReader` Impeller backend (flutter#9233) Fixes the incorrect camera mirroring when the front camera is used on devices that use the `ImageReader` Impeller backend. TLDR: for relevant rotated preview implementation, when the front camera is used, mirror the camera preview across the y-axis when the device is in a portrait orientation or across the x-axis when the device is in a landscape orientation. Fixes flutter/flutter#156974. cc @jesswrd, co-author of this PR ## 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the incorrect camera mirroring when the front camera is used on devices that use the
ImageReaderImpeller backend. TLDR: for relevant rotated preview implementation, when the front camera is used, mirror the camera preview across the y-axis when the device is in a portrait orientation or across the x-axis when the device is in a landscape orientation.Fixes flutter/flutter#156974.
cc @jesswrd, co-author of this PR
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith 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.mdto 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