Skip to content
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

Camera1 preview wrong orientation on some devices #208

Open
pcm2a opened this issue Sep 4, 2019 · 1 comment
Open

Camera1 preview wrong orientation on some devices #208

pcm2a opened this issue Sep 4, 2019 · 1 comment
Labels
bug Something isn't working pinned

Comments

@pcm2a
Copy link
Contributor

pcm2a commented Sep 4, 2019

Describe the bug
9/12/19 Update:
I was totally incorrect about what was going on. The ZTE Cymbal T runs android 5 but when it tries to use Camera2 it is falling back to Camera1. This issue here is with Camera1 and not Camera2. I have also validated that the Camera2 functionality works perfectly on a Nexus 6, only when using Camera1 is it upside down. Because of this I consider it a much lower of a priority.

Some devices have cameras installed in the device in non-standard orientations, usually with the front camera (selfie). Examples are some of the Nexus 5/6 devices and a test device I have, ZTE Cymbal T. The issue here is only with Camera1 and only with the preview. The recorded video is in the correct orientation.

I did some tests forcing the camera into Camera1 and then tested the fix on the broken device and on a device that did not have the problem.

Steps performed:

  1. Holding phone portrait, back camera:
  2. Holding phone portrait, switch to selfie camera:
  3. Rotate phone to landscape, switch to back camera
  4. Holding phone in landscape: switch to selfie camera:

With my changes in place : #209

ZTE Cymbal T: Camera locked in portrait

  1. deviceRotation=0, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=90
  2. deviceRotation=0, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=270
  3. deviceRotation=90, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=90
  4. deviceRotation=90, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=270

Xaiomi: Camera locked in portrait

  1. rotationDegrees=0, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=90
  2. rotationDegrees=0, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=90
  3. rotationDegrees=90, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=90
  4. rotationDegrees=90, WindowManager.rotation=0, getCameraDegrees()=0, displayOrientation=90

Try it out on a few devices forcing the camera to use Camera1 and see if it also works correctly for you.

Device (please complete the following information):

  • Device: ZTE Cymbal T
  • OS: Android 5.1
@pvasa pvasa added bug Something isn't working pinned labels Sep 4, 2019
@pcm2a pcm2a changed the title Camera2 preview wrong orientation on some devices Camera1 preview wrong orientation on some devices Sep 12, 2019
@pcm2a
Copy link
Contributor Author

pcm2a commented Sep 12, 2019

I have updated the issue, I was wrong about it being a Camera2 issue. It is only on a device that is using Camera1. Pretty low priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned
Projects
None yet
Development

No branches or pull requests

2 participants