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

Commit 196fda61 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Camera: Fix camera orientation

Change-Id: I228bb71853b3417c8a103710b83a68d933cb314c
parent a66a8144
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4274,6 +4274,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(true) :
                    cameraRotationOffset - getDisplayRotationDegrees(true);

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