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

Commit 123e5b82 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

camera: Support non-standard FFC orientations

Most of the FFC-related code assumes a number of rotation and
reorientation hooks are required before the image can be
displayed and/or saved.
If the FFC claims an orientation of 90 degrees (same as a back-cam)
skip all of those, and treat it like a back-facing camera.

Change-Id: Ia0a77a94d0fe56790330ec581610adaec975edb9
parent ee03f82a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -226,6 +226,14 @@ sp<ICamera> CameraService::connect(

    CameraInfo info;
    HAL_getCameraInfo(cameraId, &info);

    /* If the FFC claims standard back-facing orientation,
     * treat it as such. This avoid all the mirroring and rotation
     * hooks */
    if (info.facing == CAMERA_FACING_FRONT && info.orientation == 90) {
        info.facing = CAMERA_FACING_BACK;
    }

    client = new Client(this, cameraClient, hardware, cameraId, info.facing,
                        callingPid);
    mClient[cameraId] = client;