Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5daab802 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '5315-master-orientation' into 'master'

Camera: Fix camera orientation

See merge request !50
parents df1f7a3e dd1652d8
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4033,6 +4033,13 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
            if (MyDebug.LOG)
                Log.d(TAG, "getImageVideoRotation() lock to portrait, returns " + result);
            return result;
        } else {
            int cameraRotationOffset = camera_controller.getCameraOrientation();
            boolean isFrontFacing = camera_controller.getFacing() == CameraController.Facing.FACING_FRONT;
            int rotation = isFrontFacing ? cameraRotationOffset + getDisplayRotationDegrees() :
                    cameraRotationOffset - getDisplayRotationDegrees();

            current_rotation = (360 + rotation) % 360;
        }
        if (MyDebug.LOG)
            Log.d(TAG, "getImageVideoRotation() returns current_rotation " + current_rotation);