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

Commit 5edc7529 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "libcameraservice: Add exceptions to handle the FFC on the LGE star" into gingerbread

parents 1895ffef 287189a1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -96,4 +96,8 @@ ifeq ($(BOARD_FIRST_CAMERA_FRONT_FACING),true)
    LOCAL_CFLAGS += -DFIRST_CAMERA_FACING=CAMERA_FACING_FRONT -DFIRST_CAMERA_ORIENTATION=0
endif

ifeq ($(BOARD_HAS_LGE_FFC), true)
    LOCAL_CFLAGS += -DBOARD_HAS_LGE_FFC
endif

include $(BUILD_SHARED_LIBRARY)
+20 −7
Original line number Diff line number Diff line
@@ -223,17 +223,20 @@ sp<ICamera> CameraService::connect(
        hardware->setParameters(params);
    }
#endif
#ifdef BOARD_HAS_LGE_FFC
    CameraParameters params(hardware->getParameters());
    if (cameraId == 1) {
        params.set("nv-flip-mode","vertical");
    } else {
        params.set("nv-flip-mode","off");
    }
    hardware->setParameters(params);
#endif


    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;
@@ -978,7 +981,9 @@ status_t CameraService::Client::setParameters(const String8& params) {
    status_t result = checkPidAndHardware();
    if (result != NO_ERROR) return result;


    CameraParameters p(params);

    return mHardware->setParameters(p);
}

@@ -1395,6 +1400,14 @@ void CameraService::Client::copyFrameAndPostCopiedFrame(
}

int CameraService::Client::getOrientation(int degrees, bool mirror) {
#ifdef BOARD_HAS_LGE_FFC
    /* FLIP_* generate weird behaviors that don't include flipping */
    LOGV("Asking orientation %d with %d",degrees,mirror);
    if (mirror && 
          degrees == 270 || degrees == 90)  // ROTATE_90 just for these orientations
            return HAL_TRANSFORM_ROT_90;
    mirror = 0;
#endif
    if (!mirror) {
        if (degrees == 0) return 0;
        else if (degrees == 90) return HAL_TRANSFORM_ROT_90;