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

Commit d1a65518 authored by Christopher Lais's avatar Christopher Lais
Browse files

libcameraservice: fix orientation on HTC FFC pictures

This will probably need some board-specific stuff if the other phones
forced to use the froyo libcamera.so have different ideas of the orientation.

Change-Id: Ibc258d3e482c5884623e277a40ca387d93cc7672
parent e97f0c52
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1295,9 +1295,7 @@ void CameraService::Client::copyFrameAndPostCopiedFrame(
}

int CameraService::Client::getOrientation(int degrees, bool mirror) {
#ifndef BOARD_USE_FROYO_LIBCAMERA
    if (!mirror) {
#endif
        if (degrees == 0) return 0;
        else if (degrees == 90) return HAL_TRANSFORM_ROT_90;
        else if (degrees == 180) return HAL_TRANSFORM_ROT_180;
@@ -1314,6 +1312,13 @@ int CameraService::Client::getOrientation(int degrees, bool mirror) {
            return HAL_TRANSFORM_FLIP_V | HAL_TRANSFORM_ROT_90;
        }
    }
#else
    } else {
        if (degrees == 0) return HAL_TRANSFORM_ROT_180;
        else if (degrees == 90) return HAL_TRANSFORM_ROT_270;
        else if (degrees == 180) return 0;
        else if (degrees == 270) return HAL_TRANSFORM_ROT_90;
    }
#endif
    LOGE("Invalid setDisplayOrientation degrees=%d", degrees);
    return -1;
@@ -1402,7 +1407,7 @@ static const CameraInfo sCameraInfo[] = {
    },
    {
        CAMERA_FACING_FRONT,
        270, /* orientation */
        90,  /* orientation */
    }
};