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 | b192289737a7616f76a1cc236ed3cbc704696c03 (patch) | |
| tree | fc6a40275b1e76ec5e43f2cc86292210a3309909 /camera | |
| parent | fd705eb8b757a4f3d1d80b736cf20cade04524d7 (diff) | |
| download | hardware_ti_omap4xxx-b192289737a7616f76a1cc236ed3cbc704696c03.zip hardware_ti_omap4xxx-b192289737a7616f76a1cc236ed3cbc704696c03.tar.gz hardware_ti_omap4xxx-b192289737a7616f76a1cc236ed3cbc704696c03.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')
| -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 ) |
