diff options
author | Tyler Luu <tluu@ti.com> | 2011-09-23 15:45:30 -0500 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-09-23 14:01:19 -0700 |
commit | bbdc0fa0b8720bcfcf602861f62802c1fa1995c4 (patch) | |
tree | df09e2c223616d5125598b9917519128a73626cc /camera | |
parent | 18d4cb78c873c0ac1ab145f9b70d8f3d0e715185 (diff) | |
download | hardware_ti_omap4xxx-bbdc0fa0b8720bcfcf602861f62802c1fa1995c4.zip hardware_ti_omap4xxx-bbdc0fa0b8720bcfcf602861f62802c1fa1995c4.tar.gz hardware_ti_omap4xxx-bbdc0fa0b8720bcfcf602861f62802c1fa1995c4.tar.bz2 |
CameraHal: Timing issue in returning focus callback
If the CommandHandler thread in OMXCameraAdapter preempts
the main thread before the AF state can be commited, there
was a chance that we would never send a focus callback.
This patch makes returnFocusStatus check for next state as
well as current state.
Change-Id: I7dfd68061ab5391bea1d12f5c978dba7544bfc9a
Signed-off-by: Tyler Luu <tluu@ti.com>
Diffstat (limited to 'camera')
-rw-r--r-- | camera/OMXCameraAdapter/OMXFocus.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp index 784f5e2..692e60a 100644 --- a/camera/OMXCameraAdapter/OMXFocus.cpp +++ b/camera/OMXCameraAdapter/OMXFocus.cpp @@ -366,16 +366,18 @@ status_t OMXCameraAdapter::returnFocusStatus(bool timeoutReached) status_t ret = NO_ERROR; OMX_PARAM_FOCUSSTATUSTYPE eFocusStatus; bool focusStatus = false; - BaseCameraAdapter::AdapterState state; + BaseCameraAdapter::AdapterState state, nextState; BaseCameraAdapter::getState(state); + BaseCameraAdapter::getNextState(nextState); LOG_FUNCTION_NAME; OMX_INIT_STRUCT(eFocusStatus, OMX_PARAM_FOCUSSTATUSTYPE); - if( ( AF_ACTIVE & state ) != AF_ACTIVE ) + if( ((AF_ACTIVE & state ) != AF_ACTIVE) && ((AF_ACTIVE & nextState ) != AF_ACTIVE) ) { /// We don't send focus callback if focus was not started + CAMHAL_LOGDA("Not sending focus callback because focus was not started"); return NO_ERROR; } |