diff options
author | Akwasi Boateng <akwasi.boateng@ti.com> | 2011-10-27 05:47:47 -0500 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-10-27 14:07:32 -0700 |
commit | d2aba6e5d51e09e56ec0d246d785e4baa1b2142b (patch) | |
tree | a1901ff1dcd201c4b1e80ae898c9987a6bd924de /camera/OMXCameraAdapter | |
parent | cb036d78d4d4bf95b99b2e1547a63b0939950bec (diff) | |
download | hardware_ti_omap4-d2aba6e5d51e09e56ec0d246d785e4baa1b2142b.zip hardware_ti_omap4-d2aba6e5d51e09e56ec0d246d785e4baa1b2142b.tar.gz hardware_ti_omap4-d2aba6e5d51e09e56ec0d246d785e4baa1b2142b.tar.bz2 |
Only return error for Invalid state
Return error only for when component is in
Invalid state and we make any focus calls
Change-Id: I2efc3fb7859eca713b0ad738b7122ea8f36561c2
Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
related-to-bug: 5472396
Diffstat (limited to 'camera/OMXCameraAdapter')
-rw-r--r-- | camera/OMXCameraAdapter/OMXFocus.cpp | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp index 6b94140..9daea44 100644 --- a/camera/OMXCameraAdapter/OMXFocus.cpp +++ b/camera/OMXCameraAdapter/OMXFocus.cpp @@ -85,11 +85,18 @@ status_t OMXCameraAdapter::doAutoFocus() LOG_FUNCTION_NAME; + if ( OMX_StateInvalid == mComponentState ) + { + CAMHAL_LOGEA("OMX component in Invalid state"); + returnFocusStatus(false); + return -EINVAL; + } + if ( OMX_StateExecuting != mComponentState ) { CAMHAL_LOGEA("OMX component not in executing state"); returnFocusStatus(false); - return NO_INIT; + return NO_ERROR; } if ( 0 != mDoAFSem.Count() ) @@ -204,10 +211,17 @@ status_t OMXCameraAdapter::stopAutoFocus() LOG_FUNCTION_NAME; + if ( OMX_StateInvalid == mComponentState ) + { + CAMHAL_LOGEA("OMX component in Invalid state"); + returnFocusStatus(false); + return -EINVAL; + } + if ( OMX_StateExecuting != mComponentState ) { - CAMHAL_LOGEA("OMX component not in executing state"); - return NO_INIT; + CAMHAL_LOGEA("OMX component not in executing state"); + return NO_ERROR; } if ( mParameters3A.Focus == OMX_IMAGE_FocusControlAutoInfinity ) { @@ -316,10 +330,16 @@ status_t OMXCameraAdapter::setFocusCallback(bool enabled) LOG_FUNCTION_NAME; + if ( OMX_StateInvalid == mComponentState ) + { + CAMHAL_LOGEA("OMX component in Invalid state"); + ret = -EINVAL; + } + if ( OMX_StateExecuting != mComponentState ) { - CAMHAL_LOGEA("OMX component not in executing state"); - ret = -1; + CAMHAL_LOGEA("OMX component not in executing state"); + ret = NO_ERROR; } if ( NO_ERROR == ret ) @@ -466,10 +486,16 @@ status_t OMXCameraAdapter::checkFocus(OMX_PARAM_FOCUSSTATUSTYPE *eFocusStatus) ret = -EINVAL; } + if ( OMX_StateInvalid == mComponentState ) + { + CAMHAL_LOGEA("OMX component in Invalid state"); + ret = -EINVAL; + } + if ( OMX_StateExecuting != mComponentState ) { CAMHAL_LOGEA("OMX component not in executing state"); - ret = -EINVAL; + ret = NO_ERROR; } if ( NO_ERROR == ret ) |