Skip to content

[camera_android_camerax] Reduce camera preview rotation jank #168938

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

Open
camsim99 opened this issue May 15, 2025 · 6 comments
Open

[camera_android_camerax] Reduce camera preview rotation jank #168938

camsim99 opened this issue May 15, 2025 · 6 comments
Labels
p: camera The camera plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@camsim99
Copy link
Contributor

I've noticed that there is some jank when rotating a device displaying a camera preview. I believe this stems from the fact that we are using nested RotatedBoxes, so the preview is getting rotated twice every time that the device is rotated. We currently must do this as a workaround for the incorrect preview rotation applied in the app-facing camera package for the Android platform.

We should investigate solutions for reducing this weird visual effect.

@camsim99 camsim99 added platform-android Android applications specifically p: camera The camera plugin package flutter/packages repository. See also p: labels. team-android Owned by Android platform team labels May 15, 2025
@camsim99
Copy link
Contributor Author

I would suggest the Transform widget, but I believe this fact https://api.flutter.dev/flutter/widgets/RotatedBox-class.html#:~:text=A%20widget%20that%20rotates%20its,required%20by%20the%20rotated%20child will prevent us from using it effectively. It's possible that there is a workaround, though.

@camsim99
Copy link
Contributor Author

camsim99 commented May 15, 2025

@camsim99 to update the description with a video

@delfme

This comment has been minimized.

@reidbaker
Copy link
Contributor

@camsim99 to upload the video you took before it gets lost on your desktop.

@reidbaker reidbaker added the P2 Important issues not at the top of the work list label May 19, 2025
@reidbaker
Copy link
Contributor

Possibly look at state to prevent re-rendering when we know that the widget has not change.

@reidbaker
Copy link
Contributor

Long term fix is probably special casing the texture that is rendered to not be rotated or rebuilt on rotation but still rotating the views and other displayed widgets are rotated. Then fixing any of the rotation bugs that depend on the texture being rotated or aligned with the display orientation.

OR

migrating to the camerax preview

@reidbaker reidbaker added the triaged-android Triaged by Android platform team label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: camera The camera plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy