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

Commit 89821204 authored by Wu-cheng Li's avatar Wu-cheng Li Committed by Android (Google) Code Review
Browse files

Merge "Remove the FLIP_H/ROT_90 workaround from CameraService.do not merge" into gingerbread

parents 145550a0 994c02bb
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -153,7 +153,7 @@ sp<ICamera> CameraService::connect(
    CameraInfo info;
    CameraInfo info;
    HAL_getCameraInfo(cameraId, &info);
    HAL_getCameraInfo(cameraId, &info);
    client = new Client(this, cameraClient, hardware, cameraId, info.facing,
    client = new Client(this, cameraClient, hardware, cameraId, info.facing,
                        info.orientation, callingPid);
                        callingPid);
    mClient[cameraId] = client;
    mClient[cameraId] = client;
    LOG1("CameraService::connect X");
    LOG1("CameraService::connect X");
    return client;
    return client;
@@ -295,7 +295,7 @@ void CameraService::playSound(sound_kind kind) {
CameraService::Client::Client(const sp<CameraService>& cameraService,
CameraService::Client::Client(const sp<CameraService>& cameraService,
        const sp<ICameraClient>& cameraClient,
        const sp<ICameraClient>& cameraClient,
        const sp<CameraHardwareInterface>& hardware,
        const sp<CameraHardwareInterface>& hardware,
        int cameraId, int cameraFacing, int cameraOrientation, int clientPid) {
        int cameraId, int cameraFacing, int clientPid) {
    int callingPid = getCallingPid();
    int callingPid = getCallingPid();
    LOG1("Client::Client E (pid %d)", callingPid);
    LOG1("Client::Client E (pid %d)", callingPid);


@@ -304,7 +304,6 @@ CameraService::Client::Client(const sp<CameraService>& cameraService,
    mHardware = hardware;
    mHardware = hardware;
    mCameraId = cameraId;
    mCameraId = cameraId;
    mCameraFacing = cameraFacing;
    mCameraFacing = cameraFacing;
    mCameraOrientation = cameraOrientation;
    mClientPid = clientPid;
    mClientPid = clientPid;
    mUseOverlay = mHardware->useOverlay();
    mUseOverlay = mHardware->useOverlay();
    mMsgEnabled = 0;
    mMsgEnabled = 0;
@@ -1203,18 +1202,15 @@ int CameraService::Client::getOrientation(int degrees, bool mirror) {
        else if (degrees == 90) return HAL_TRANSFORM_ROT_90;
        else if (degrees == 90) return HAL_TRANSFORM_ROT_90;
        else if (degrees == 180) return HAL_TRANSFORM_ROT_180;
        else if (degrees == 180) return HAL_TRANSFORM_ROT_180;
        else if (degrees == 270) return HAL_TRANSFORM_ROT_270;
        else if (degrees == 270) return HAL_TRANSFORM_ROT_270;
    } else {  // mirror (horizontal flip)
    } else {  // Do mirror (horizontal flip)
        // Now overlay does ROT_90 before FLIP_V or FLIP_H. It should be FLIP_V
        // or FLIP_H first.
        // TODO: change this after overlay is fixed.
        if (degrees == 0) {           // FLIP_H and ROT_0
        if (degrees == 0) {           // FLIP_H and ROT_0
            return HAL_TRANSFORM_FLIP_H;
            return HAL_TRANSFORM_FLIP_H;
        } else if (degrees == 90) {   // FLIP_H and ROT_90
        } else if (degrees == 90) {   // FLIP_H and ROT_90
            return HAL_TRANSFORM_ROT_90 | HAL_TRANSFORM_FLIP_V;
            return HAL_TRANSFORM_FLIP_H | HAL_TRANSFORM_ROT_90;
        } else if (degrees == 180) {  // FLIP_H and ROT_180
        } else if (degrees == 180) {  // FLIP_H and ROT_180
            return HAL_TRANSFORM_FLIP_V;
            return HAL_TRANSFORM_FLIP_V;
        } else if (degrees == 270) {  // FLIP_H and ROT_270
        } else if (degrees == 270) {  // FLIP_H and ROT_270
            return HAL_TRANSFORM_ROT_90 | HAL_TRANSFORM_FLIP_H;
            return HAL_TRANSFORM_FLIP_V | HAL_TRANSFORM_ROT_90;
        }
        }
    }
    }
    LOGE("Invalid setDisplayOrientation degrees=%d", degrees);
    LOGE("Invalid setDisplayOrientation degrees=%d", degrees);
+0 −2
Original line number Original line Diff line number Diff line
@@ -109,7 +109,6 @@ private:
                                       const sp<CameraHardwareInterface>& hardware,
                                       const sp<CameraHardwareInterface>& hardware,
                                       int cameraId,
                                       int cameraId,
                                       int cameraFacing,
                                       int cameraFacing,
                                       int mCameraOrientation,
                                       int clientPid);
                                       int clientPid);
                                ~Client();
                                ~Client();


@@ -162,7 +161,6 @@ private:
        sp<ICameraClient>               mCameraClient;
        sp<ICameraClient>               mCameraClient;
        int                             mCameraId;       // immutable after constructor
        int                             mCameraId;       // immutable after constructor
        int                             mCameraFacing;   // immutable after constructor
        int                             mCameraFacing;   // immutable after constructor
        int                             mCameraOrientation;  // immutable after constructor
        pid_t                           mClientPid;
        pid_t                           mClientPid;
        sp<CameraHardwareInterface>     mHardware;       // cleared after disconnect()
        sp<CameraHardwareInterface>     mHardware;       // cleared after disconnect()
        bool                            mUseOverlay;     // immutable after constructor
        bool                            mUseOverlay;     // immutable after constructor