You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[camera_android_camerax] Remove logic used to previously correct preview rotation (#8256)
Removes correction logic used to the correct the rotation of the camera preview, since it appears* to not be needed anymore.
Partially addresses flutter/flutter#154241.
*This is **not true** for emulators, but if we are ok landing this issue for real devices, I'll file an issue for emulators and follow up there. jonahwilliams@ mentioned there is known different behavior in emulators with Impeller, so this fact is not totally a surprise.
My basis for landing this is:
1. I tested the following devices that use both Impeller backends and this PR works:
- Realme X2 Pro, Android 11 (API 30) that uses Vulkan
- Pixel 3A, Android 12 (Android 31/32) that falls back to OpenGLES
- Samsung Galaxy (Android 8.1.0) that uses OpenGLES
2. If this misses an edge case (like a class of device), this PR will make it easier to debug what is going on, since the camera preview will now **only** introduce a rotation if the device itself is rotated (as per the logic in https://github.com/flutter/packages/blob/8ca81bd20231ed638cfc3ebf5f8a3f96b3d22e60/packages/camera/camera/lib/src/camera_preview.dart#L46-L72) with no additional logic concerning the sensor orientation and UI orientation as it does now.
'buildPreview returns preview with expected rotation if camera is front facing, the current orientation is landscape, and the preview is not backed by a SurfaceTexture',
1387
-
() async {
1388
-
finalAndroidCameraCameraX camera =AndroidCameraCameraX();
1389
-
constint cameraId =7;
1390
-
1391
-
// Tell camera that createCamera has been called and thus, preview has been
1392
-
// bound to the lifecycle of the camera.
1393
-
camera.previewInitiallyBound =true;
1394
-
1395
-
// Tell camera the Surface used to build camera preview is not backed by a
'buildPreview returns preview with expected rotation if camera is front facing, the current orientation is not landscape, and the preview is not backed by a SurfaceTexture',
1435
-
() async {
1436
-
finalAndroidCameraCameraX camera =AndroidCameraCameraX();
1437
-
constint cameraId =733;
1438
-
1439
-
// Tell camera that createCamera has been called and thus, preview has been
1440
-
// bound to the lifecycle of the camera.
1441
-
camera.previewInitiallyBound =true;
1442
-
1443
-
// Tell camera the Surface used to build camera preview is not backed by a
0 commit comments