Skip to content

Commit

Permalink
android: fix video rotation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
c-g-owen committed Oct 20, 2021
1 parent 70b334b commit 1c13e65
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions android/java/com/waz/avs/VideoCapturer.java
Original file line number Diff line number Diff line change
Expand Up @@ -548,26 +548,6 @@ public void onPreviewFrame(byte[] frame, Camera cam) {
// camera.addCallbackBuffer(frame);
}

public int getViewRotation() {
if (camera == null || cameraInfo == null)
return 0;

Log.d(TAG, "getViewRotation: camrot: " + cameraInfo.orientation +
" facing: " + cameraInfo.facing);

switch (cameraInfo.facing) {
case CameraInfo.CAMERA_FACING_BACK:
return cameraInfo.orientation;

case CameraInfo.CAMERA_FACING_FRONT:
return (360 - cameraInfo.orientation) % 360;

default:
return 0;
}
}


public int getRotation() {
if (camera == null || cameraInfo == null)
return 0;
Expand All @@ -577,7 +557,7 @@ public int getRotation() {
return (360 + ui_rotation - cameraInfo.orientation) % 360;

case CameraInfo.CAMERA_FACING_FRONT:
return (360 - (ui_rotation + cameraInfo.orientation)) % 360;
return (720 - ui_rotation - cameraInfo.orientation) % 360;

default:
return 0;
Expand Down

0 comments on commit 1c13e65

Please sign in to comment.