-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Landscape orientation on Android App. #568
Comments
Yes, all the Android example apps use |
I did something like this.
Then in ExternalTextureRenderer.java
|
@mzwtjp thanks 👍 |
@Christy-V I found the fix to this. It requires 3 changes for the input of mediapipe to be handled:
- Size rotatedSize =
- new Size(/* width= */ targetSize.getHeight(), /* height= */ targetSize.getWidth());
+ Size rotatedSize = targetSize;
- private int rotation = Surface.ROTATION_0;
+ private int rotation = Surface.ROTATION_270;
android:screenOrientation="landscape" |
I have built some of the demo android apps and they work correctly.
But they do have android:screenOrientation="portrait" in the manifest so so not support landscape orientation.
I have also built an aar library and built a similar app myself without the orientation restriction in the manifest. But when I rotate the device the camera preview is distorted and rotated 90 degrees.
Can anyone point me in the right direction of how I could fix landscape mode? Thanks.
The text was updated successfully, but these errors were encountered: