diff options
author | Milen Mitkov <mmitkov@mm-sol.com> | 2011-11-10 16:14:49 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-10 16:14:49 +0000 |
commit | 10b83a41160584d7501cde883a95b943bab23268 (patch) | |
tree | 6fd4725c9081b1738dd83012c9dc06d6006e4594 | |
parent | 77d0865ccfaee8e4b73325413b656bd7bb9e2b4e (diff) | |
parent | 5cd54309c97eed29eaf84b6a028d9f3d4fa1e41b (diff) | |
download | hardware_ti_omap4-10b83a41160584d7501cde883a95b943bab23268.zip hardware_ti_omap4-10b83a41160584d7501cde883a95b943bab23268.tar.gz hardware_ti_omap4-10b83a41160584d7501cde883a95b943bab23268.tar.bz2 |
am c087cd70: am 69077c25: am 2136042f: CameraHAL: Setting focus mode shouldnt start focus scanning
* commit 'c087cd70cfa6dcbcdbafaa5f85a48a585263068c':
CameraHAL: Setting focus mode shouldnt start focus scanning
-rw-r--r-- | camera/OMXCameraAdapter/OMX3A.cpp | 36 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXFocus.cpp | 8 |
2 files changed, 38 insertions, 6 deletions
diff --git a/camera/OMXCameraAdapter/OMX3A.cpp b/camera/OMXCameraAdapter/OMX3A.cpp index 73f3714..6b4aa63 100644 --- a/camera/OMXCameraAdapter/OMX3A.cpp +++ b/camera/OMXCameraAdapter/OMX3A.cpp @@ -210,12 +210,7 @@ status_t OMXCameraAdapter::setParameters3A(const CameraParameters ¶ms, mode = getLUTvalue_HALtoOMX(str, FocusLUT); if ( (mFirstTimeInit || ((str != NULL) && (mParameters3A.Focus != mode)))) { - //Apply focus mode immediatly only if CAF or Inifinity are selected - if ( ( mode == OMX_IMAGE_FocusControlAuto ) || - ( mode == OMX_IMAGE_FocusControlAutoInfinity ) ) - { - mPending3Asettings |= SetFocus; - } + mPending3Asettings |= SetFocus; mParameters3A.Focus = mode; @@ -582,6 +577,7 @@ status_t OMXCameraAdapter::setFocusMode(Gen3A_settings& Gen3A) OMX_ERRORTYPE eError = OMX_ErrorNone; OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE focus; size_t top, left, width, height, weight; + OMX_CONFIG_BOOLEANTYPE bOMX; LOG_FUNCTION_NAME; @@ -635,6 +631,34 @@ status_t OMXCameraAdapter::setFocusMode(Gen3A_settings& Gen3A) if ( NO_ERROR == ret && ((state & AF_ACTIVE) == 0) ) { + OMX_INIT_STRUCT_PTR (&bOMX, OMX_CONFIG_BOOLEANTYPE); + + if ( Gen3A.Focus == OMX_IMAGE_FocusControlAutoInfinity) + { + // Don't lock at infinity, otherwise the AF cannot drive + // the lens at infinity position + if( set3ALock(mUserSetExpLock, mUserSetWbLock, OMX_FALSE) != NO_ERROR) + { + CAMHAL_LOGEA("Error Applying 3A locks"); + } else { + CAMHAL_LOGDA("Focus locked. Applied focus locks successfully"); + } + } + if ( Gen3A.Focus == OMX_IMAGE_FocusControlAuto || + Gen3A.Focus == OMX_IMAGE_FocusControlAutoInfinity) + { + // Run focus scanning if switching to continuous infinity focus mode + bOMX.bEnabled = OMX_TRUE; + } + else + { + bOMX.bEnabled = OMX_FALSE; + } + + eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp, + (OMX_INDEXTYPE)OMX_TI_IndexConfigAutofocusEnable, + &bOMX); + OMX_INIT_STRUCT_PTR (&focus, OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE); focus.nPortIndex = mCameraAdapterParameters.mPrevPortIndex; focus.eFocusControl = (OMX_IMAGE_FOCUSCONTROLTYPE)Gen3A.Focus; diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp index 7655d90..ce569ec 100644 --- a/camera/OMXCameraAdapter/OMXFocus.cpp +++ b/camera/OMXCameraAdapter/OMXFocus.cpp @@ -82,6 +82,7 @@ status_t OMXCameraAdapter::doAutoFocus() OMX_ERRORTYPE eError = OMX_ErrorNone; OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE focusControl; OMX_PARAM_FOCUSSTATUSTYPE focusStatus; + OMX_CONFIG_BOOLEANTYPE bOMX; LOG_FUNCTION_NAME; @@ -153,6 +154,13 @@ status_t OMXCameraAdapter::doAutoFocus() && focusStatus.eFocusStatus == OMX_FocusStatusRequest) || (mParameters3A.Focus != (OMX_IMAGE_FOCUSCONTROLTYPE)OMX_IMAGE_FocusControlAuto) ) { + OMX_INIT_STRUCT_PTR (&bOMX, OMX_CONFIG_BOOLEANTYPE); + bOMX.bEnabled = OMX_TRUE; + + //Enable focus scanning + eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp, + (OMX_INDEXTYPE)OMX_TI_IndexConfigAutofocusEnable, + &bOMX); ret = RegisterForEvent(mCameraAdapterParameters.mHandleComp, (OMX_EVENTTYPE) OMX_EventIndexSettingChanged, |