diff options
author | Milen Mitkov <mmitkov@mm-sol.com> | 2011-11-02 17:29:42 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-02 17:29:42 +0000 |
commit | 5447d760597ccea181ddf2c25bd372d5975f84f8 (patch) | |
tree | fbd977e5d50ef65d9e1d996540f95ff1f0899f4e /camera/OMXCameraAdapter | |
parent | b6b5fd496163c0540ab152dad8b04438b8f0427e (diff) | |
parent | a23f3c96908808adc80ab8f03415564893fe42e9 (diff) | |
download | hardware_ti_omap4-5447d760597ccea181ddf2c25bd372d5975f84f8.zip hardware_ti_omap4-5447d760597ccea181ddf2c25bd372d5975f84f8.tar.gz hardware_ti_omap4-5447d760597ccea181ddf2c25bd372d5975f84f8.tar.bz2 |
am eb3ed8e7: am 3c272a99: CameraHAL: Return status after CAF finishes
* commit 'eb3ed8e75abbe8785b86a47851f4d7e98300006c':
CameraHAL: Return status after CAF finishes
Diffstat (limited to 'camera/OMXCameraAdapter')
-rwxr-xr-x | camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 11 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXFocus.cpp | 33 |
2 files changed, 19 insertions, 25 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index 976fe8f..2bc40d0 100755 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -225,7 +225,7 @@ status_t OMXCameraAdapter::initialize(CameraProperties::Properties* caps) { if( ret == INVALID_OPERATION){ CAMHAL_LOGDA("command handler thread already runnning!!"); - ret = NO_ERROR; + ret = NO_ERROR; } else { CAMHAL_LOGEA("Couldn't run command handlerthread"); @@ -248,7 +248,7 @@ status_t OMXCameraAdapter::initialize(CameraProperties::Properties* caps) { if( ret == INVALID_OPERATION){ CAMHAL_LOGDA("omx callback handler thread already runnning!!"); - ret = NO_ERROR; + ret = NO_ERROR; }else { CAMHAL_LOGEA("Couldn't run omx callback handler thread"); @@ -1883,6 +1883,12 @@ status_t OMXCameraAdapter::startPreview() if ( mPending3Asettings ) apply3Asettings(mParameters3A); + // enable focus callbacks just once here + // fixes an issue with slow callback registration in Ducati + if ( NO_ERROR == ret ) { + ret = setFocusCallback(true); + } + //reset frame rate estimates mFPS = 0.0f; mLastFPS = 0.0f; @@ -3600,4 +3606,3 @@ extern "C" int CameraAdapter_Capabilities(CameraProperties::Properties* properti /*--------------------Camera Adapter Class ENDS here-----------------------------*/ - diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp index 102daeb..7655d90 100644 --- a/camera/OMXCameraAdapter/OMXFocus.cpp +++ b/camera/OMXCameraAdapter/OMXFocus.cpp @@ -149,9 +149,10 @@ status_t OMXCameraAdapter::doAutoFocus() } } - if ( ( focusControl.eFocusControl != OMX_IMAGE_FocusControlAuto ) && - ( focusControl.eFocusControl != ( OMX_IMAGE_FOCUSCONTROLTYPE ) - OMX_IMAGE_FocusControlAutoInfinity ) ) { + if ( (focusControl.eFocusControl == OMX_IMAGE_FocusControlAuto + && focusStatus.eFocusStatus == OMX_FocusStatusRequest) || + (mParameters3A.Focus != (OMX_IMAGE_FOCUSCONTROLTYPE)OMX_IMAGE_FocusControlAuto) ) + { ret = RegisterForEvent(mCameraAdapterParameters.mHandleComp, (OMX_EVENTTYPE) OMX_EventIndexSettingChanged, @@ -159,13 +160,12 @@ status_t OMXCameraAdapter::doAutoFocus() OMX_IndexConfigCommonFocusStatus, mDoAFSem); - if ( NO_ERROR == ret ) { - ret = setFocusCallback(true); - } - - eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp, - OMX_IndexConfigFocusControl, - &focusControl); + if ( focusControl.eFocusControl != OMX_IMAGE_FocusControlAuto ) + { + eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp, + OMX_IndexConfigFocusControl, + &focusControl); + } if ( OMX_ErrorNone != eError ) { CAMHAL_LOGEB("Error while starting focus 0x%x", eError); @@ -181,9 +181,6 @@ status_t OMXCameraAdapter::doAutoFocus() return EINVAL; } - //Disable auto focus callback from Ducati - setFocusCallback(false); - CAMHAL_LOGEA("Autofocus callback timeout expired"); RemoveEvent(mCameraAdapterParameters.mHandleComp, (OMX_EVENTTYPE) OMX_EventIndexSettingChanged, OMX_ALL, @@ -191,9 +188,7 @@ status_t OMXCameraAdapter::doAutoFocus() NULL ); returnFocusStatus(true); } else { - CAMHAL_LOGDA("Autofocus callback received"); - //Disable auto focus callback from Ducati - setFocusCallback(false); + ret = returnFocusStatus(false); } } else { // Focus mode in continuous @@ -235,12 +230,6 @@ status_t OMXCameraAdapter::stopAutoFocus() } if ( NO_ERROR == ret ) - { - //Disable the callback first - ret = setFocusCallback(false); - } - - if ( NO_ERROR == ret ) { OMX_INIT_STRUCT_PTR (&focusControl, OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE); focusControl.eFocusControl = OMX_IMAGE_FocusControlOff; |