Repository navigation
[camera_android_camerax] Camera preview is rotated on the supported Impeller version #149294
Copy link
Copy link
Closed
flutter/packages
#6856Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowe: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23fyi-androidFor the attention of Android platform teamFor the attention of Android platform teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
What package does this bug report belong to?
camera
What target platforms are you seeing this bug on?
Android
Have you already upgraded your packages?
Yes
Dependency versions
pubspec.lock
camera_android_camerax 0.6.5+4
Steps to reproduce
- In the version camera_android_camerax 0.6.5+4 after this commit, the preview camera screen is displayed abnormally, and the up, down, left, and right movement directions are also abnormal. This version will display abnormally regardless of whether io.flutter.embedding.android.EnableImpeller is set to true.
- Test device: Google Android 15 AP31.240426.023 and HuaWei Android12.0 API31
Expected results
This is the original normal screenshot:
This is the original normal screen recording:
normal.mp4
Actual results
This is the current abnormal screenshot:
This is the current abnormal screen recording:
error.mp4
Code sample
Code sample
if (isCameraReady)
SizedBox(
width: cameraMaxSize,
height: cameraMaxSize,
child: ClipRRect(
child: OverflowBox(
child: FittedBox(
fit: BoxFit.cover,
child: SizedBox(
width: cameraMaxSize,
child: CameraPreview(
controller!
),
),
),
),
),
),Screenshots or Videos
Screenshots / Video demonstration
error.mp4
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
$ flutter doctor -v
[✓] Flutter (Channel beta, 3.22.1, on macOS 14.5 23F79 darwin-arm64, locale zh-Hans-CN)
• Flutter version 3.22.1 on channel beta at /opt/homebrew/Caskroom/flutter/3.10.5/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (7 天前), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3
• Flutter download mirror https://mirrors.tuna.tsinghua.edu.cn/flutter
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/xuegao/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/xuegao/Library/Android/sdk
• Java binary at: /Applications/Android Studio
Preview.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome
Canary
[!] Android Studio (version unknown)
• Android Studio at /Applications/Android Studio Preview.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to determine Android Studio version.
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.2)
• IntelliJ at /Users/xuegao/Applications/IntelliJ IDEA Ultimate.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.90.0-insider)
• VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
• Flutter extension version 3.89.20240501
[✓] Connected device (6 available)
• ALN AL10 (mobile) • 23F0213C21011631 •
android-arm64 • Android 12 (API 31)
• Pixel 7 Pro (mobile) • 192.168.2.104:38723 •
android-arm64 • Android 14 (API 34)
• macOS (desktop) • macos •
darwin-arm64 • macOS 14.5 23F79 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad •
darwin • macOS 14.5 23F79 darwin-arm64
• Chrome (web) • chrome •
web-javascript • Google Chrome 127.0.6508.0 canary
[✓] Network resources
• All expected network resources are available.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowe: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23fyi-androidFor the attention of Android platform teamFor the attention of Android platform teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Activity
huycozy commentedon May 30, 2024
Thanks for the report. Reproduced this issue using camera_android_camerax's example. The camera preview is rotated 90 degree.
Demo
✅: No Issue ❗: Issue reproduced
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.1 23B74 darwin-x64, locale en-VN) • Flutter version 3.22.1 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision a14f74ff3a (11 hours ago), 2024-05-22 11:08:21 -0500 • Engine revision 55eae6864b • Dart version 3.4.1 • DevTools version 2.34.3 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode15.3.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • android-studio-dir = /Applications/Android Studio.app/ • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) [✓] VS Code (version 1.89.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.88.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.76 [✓] Network resources • All expected network resources are available. • No issues found![-]camera android after Supports Impeller Display Error[/-][+][camera_android_camerax] Camera preview is rotated on the supported Impeller version[/+]14 remaining items
reidbaker commentedon Jun 28, 2024
@GorinMaxim there is an open pull request to fix the issue flutter/packages#6856
Thank you for trying impeller.
GorinMaxim commentedon Jun 28, 2024
it might be useful
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.4.1 23E224 darwin-arm64, locale en-RU)
• Flutter version 3.22.2 on channel stable at /Users/maximgorin/Library/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747b (3 weeks ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/maximgorin/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.90.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Network resources
• All expected network resources are available.
• No issues found!
I also noticed that version 0.10.6 works well with flutter 3.16.9, but rotated at flutter 3.22.2
[camerax] Add fix for camera preview rotation on landscape-oriented d…
[camerax] Re-land SurfaceProducer migration with fix for camera previ…
AlexV525 commentedon Aug 21, 2024
@camsim99 Are you planning to land a similar approach for
camera_android? See #150549reidbaker commentedon Aug 21, 2024
@AlexV525 #150549 (comment)
AlexV525 commentedon Aug 21, 2024
Sorry, so you are talking about that you don't want to reland flutter/packages#6461 for
camera_androidbut you already reland flutter/packages#7044 forcamera_android_camerax? 0.10.9+6 fixes that issue because I reverted flutter/packages#6461 and that request has never been brought to the implementation again. Now it seems nobody cares and trying to avoid landing it because I've tried my best to tell everyone that the issue has not been really fixed.stuartmorgan-g commentedon Aug 21, 2024
@AlexV525 The situation has been pretty complex, with PRs being landed and reverted across several plugins and the repro cases being different as to whether they are about impeller or non-impeller codepaths, and all of that being conflated into a small number of issues.
Filing a new issue clearly describing the current state of the issue, with current repro steps (as well as links to relevant context) would be much more productive—and much more consistent with our code of conduct—than attributing bad intent to other project members.
github-actions commentedon Sep 4, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[camerax] Re-land SurfaceProducer migration with fix for camera previ…
[camerax] Re-land SurfaceProducer migration with fix for camera previ…