diff options
-rw-r--r-- | camera/OMXCameraAdapter/OMX3A.cpp | 22 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 5 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXCapture.cpp | 2 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXFocus.cpp | 6 | ||||
-rw-r--r-- | camera/inc/OMXCameraAdapter/OMXCameraAdapter.h | 5 |
5 files changed, 26 insertions, 14 deletions
diff --git a/camera/OMXCameraAdapter/OMX3A.cpp b/camera/OMXCameraAdapter/OMX3A.cpp index cc8f665..530e8ae 100644 --- a/camera/OMXCameraAdapter/OMX3A.cpp +++ b/camera/OMXCameraAdapter/OMX3A.cpp @@ -222,16 +222,19 @@ status_t OMXCameraAdapter::setParameters3A(const CameraParameters ¶ms, if ( (str != NULL) && (!strcmp(str, "true")) ) { OMX_BOOL lock = OMX_FALSE; + mUserSetExpLock = OMX_FALSE; str = params.get(CameraParameters::KEY_AUTO_EXPOSURE_LOCK); if ( (strcmp(str, "true")) == 0) { CAMHAL_LOGVA("Locking Exposure"); lock = OMX_TRUE; + mUserSetExpLock = OMX_TRUE; } else { CAMHAL_LOGVA("UnLocking Exposure"); } + if (mParameters3A.ExposureLock != lock) { mParameters3A.ExposureLock = lock; @@ -244,11 +247,13 @@ status_t OMXCameraAdapter::setParameters3A(const CameraParameters ¶ms, if ( (str != NULL) && (!strcmp(str, "true")) ) { OMX_BOOL lock = OMX_FALSE; + mUserSetWbLock = OMX_FALSE; str = params.get(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK); if ( (strcmp(str, "true")) == 0) { CAMHAL_LOGVA("Locking WhiteBalance"); lock = OMX_TRUE; + mUserSetWbLock = OMX_TRUE; } else { @@ -1022,7 +1027,7 @@ status_t OMXCameraAdapter::setExposureLock(Gen3A_settings& Gen3A) return ErrorUtils::omxToAndroidError(eError); } -status_t OMXCameraAdapter::set3ALock(OMX_BOOL toggle) +status_t OMXCameraAdapter::set3ALock(OMX_BOOL toggleExp, OMX_BOOL toggleWb) { OMX_ERRORTYPE eError = OMX_ErrorNone; OMX_IMAGE_CONFIG_LOCKTYPE lock; @@ -1039,8 +1044,8 @@ status_t OMXCameraAdapter::set3ALock(OMX_BOOL toggle) OMX_INIT_STRUCT_PTR (&lock, OMX_IMAGE_CONFIG_LOCKTYPE); lock.nPortIndex = mCameraAdapterParameters.mPrevPortIndex; - mParameters3A.ExposureLock = toggle; - mParameters3A.WhiteBalanceLock = toggle; + mParameters3A.ExposureLock = toggleExp; + mParameters3A.WhiteBalanceLock = toggleWb; eError = OMX_GetConfig( mCameraAdapterParameters.mHandleComp, (OMX_INDEXTYPE)OMX_IndexConfigImageExposureLock, @@ -1055,7 +1060,7 @@ status_t OMXCameraAdapter::set3ALock(OMX_BOOL toggle) } /* Apply locks only when not applied already */ - if ( lock.bLock != toggle ) + if ( lock.bLock != toggleExp ) { setExposureLock(mParameters3A); } @@ -1073,14 +1078,15 @@ status_t OMXCameraAdapter::set3ALock(OMX_BOOL toggle) } /* Apply locks only when not applied already */ - if ( lock.bLock != toggle ) + if ( lock.bLock != toggleWb ) { setWhiteBalanceLock(mParameters3A); } - const char *lock_state = toggle ? TRUE : FALSE; - mParams.set(CameraParameters::KEY_AUTO_EXPOSURE_LOCK, lock_state); - mParams.set(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK, lock_state); + const char *lock_state_exp = toggleExp ? TRUE : FALSE; + const char *lock_state_wb = toggleWb ? TRUE : FALSE; + mParams.set(CameraParameters::KEY_AUTO_EXPOSURE_LOCK, lock_state_exp); + mParams.set(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK, lock_state_wb); return ErrorUtils::omxToAndroidError(eError); diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index 2f32915..38779a5 100644 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -1843,7 +1843,7 @@ status_t OMXCameraAdapter::stopPreview() } //Release 3A locks - ret = set3ALock(OMX_FALSE); + ret = set3ALock(OMX_FALSE, OMX_FALSE); if(ret!=NO_ERROR) { CAMHAL_LOGEB("Error Releaseing 3A locks%d", ret); @@ -3097,6 +3097,9 @@ OMXCameraAdapter::OMXCameraAdapter():mComponentState (OMX_StateInvalid) mCameraAdapterParameters.mHandleComp = 0; + mUserSetExpLock = OMX_FALSE; + mUserSetWbLock = OMX_FALSE; + LOG_FUNCTION_NAME_EXIT; } diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp index 4e82d3d..5f3a7f8 100644 --- a/camera/OMXCameraAdapter/OMXCapture.cpp +++ b/camera/OMXCameraAdapter/OMXCapture.cpp @@ -858,7 +858,7 @@ status_t OMXCameraAdapter::stopImageCapture() ret = setShutterCallback(false); //release any 3A locks if locked - ret = set3ALock(OMX_FALSE); + ret = set3ALock(OMX_FALSE, OMX_FALSE); if(ret!=NO_ERROR) { CAMHAL_LOGEB("Error Releaseing 3A locks%d", ret); diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp index f57e6ba..f7e781e 100644 --- a/camera/OMXCameraAdapter/OMXFocus.cpp +++ b/camera/OMXCameraAdapter/OMXFocus.cpp @@ -268,8 +268,8 @@ status_t OMXCameraAdapter::cancelAutoFocus() OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE focusMode; LOG_FUNCTION_NAME; - // Unlock 3A locks since they were locked by AF - if( set3ALock(OMX_FALSE) != NO_ERROR) { + // Unlock 3A locks since they were locked by AF conditionally + if( set3ALock(mUserSetExpLock, mUserSetWbLock) != NO_ERROR) { CAMHAL_LOGEA("Error Unlocking 3A locks"); } else{ @@ -409,7 +409,7 @@ status_t OMXCameraAdapter::returnFocusStatus(bool timeoutReached) focusStatus = true; //Lock the AE and AWB here sinc the focus is locked // Apply 3A locks after AF - if( set3ALock(OMX_TRUE) != NO_ERROR) { + if( set3ALock(OMX_TRUE, OMX_TRUE) != NO_ERROR) { CAMHAL_LOGEA("Error Applying 3A locks"); } else diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h index f6fc69a..a29095d 100644 --- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h +++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h @@ -478,7 +478,7 @@ private: status_t setExposureLock(Gen3A_settings& Gen3A); status_t setWhiteBalanceLock(Gen3A_settings& Gen3A); - status_t set3ALock(OMX_BOOL toggle); + status_t set3ALock(OMX_BOOL toggleExp, OMX_BOOL toggleWb); status_t setMeteringAreas(Gen3A_settings& Gen3A); //API to set FrameRate using VFR interface @@ -858,6 +858,9 @@ private: Semaphore mCaptureSem; bool mCaptureSignalled; + OMX_BOOL mUserSetExpLock; + OMX_BOOL mUserSetWbLock; + }; }; //// namespace #endif //OMX_CAMERA_ADAPTER_H |