summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2011-08-02 01:25:02 -0500
committerIliyan Malchev <malchev@google.com>2011-08-10 11:46:06 -0700
commit226b496d5cce18e5898383bf479fdd42f2b5abdb (patch)
tree3d0c997c0626d13b0bf67b7e3b9ff92294afff5b
parent80c50ac56bfa97be0cf04332ec1d314637c8770f (diff)
downloadhardware_ti_omap4xxx-226b496d5cce18e5898383bf479fdd42f2b5abdb.zip
hardware_ti_omap4xxx-226b496d5cce18e5898383bf479fdd42f2b5abdb.tar.gz
hardware_ti_omap4xxx-226b496d5cce18e5898383bf479fdd42f2b5abdb.tar.bz2
CameraHal: Fix a few corner cases with smooth zoom
Fixing a few robustness issues with smooth zoom. 1) Notify application about smooth zoom success only after setting the state internally. If we notify application first, it can signal another smooth zoom start breaking our state. 2) If we notify in goal reached, we don't have return zoom status again. Double notification can lead to crash Change-Id: Idda594957822373cb3fd73f1a00459dd9900d955 Signed-off-by: Tyler Luu <tluu@ti.com>
-rw-r--r--camera/OMXCameraAdapter/OMXZoom.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/camera/OMXCameraAdapter/OMXZoom.cpp b/camera/OMXCameraAdapter/OMXZoom.cpp
index 9e59f3d..c5bcb97 100644
--- a/camera/OMXCameraAdapter/OMXZoom.cpp
+++ b/camera/OMXCameraAdapter/OMXZoom.cpp
@@ -173,7 +173,6 @@ status_t OMXCameraAdapter::advanceZoom()
CAMHAL_LOGDB("[Goal Reached] Smooth Zoom notify currentIdx = %d, targetIdx = %d",
mCurrentZoomIdx,
mTargetZoomIdx);
- notifyZoomSubscribers(mCurrentZoomIdx, true);
if ( NO_ERROR == ret )
{
@@ -190,6 +189,8 @@ status_t OMXCameraAdapter::advanceZoom()
}
}
+ mReturnZoomStatus = false;
+ notifyZoomSubscribers(mCurrentZoomIdx, true);
}
else
{
@@ -234,6 +235,7 @@ status_t OMXCameraAdapter::startSmoothZoom(int targetIdx)
{
mTargetZoomIdx = targetIdx;
mZoomParameterIdx = mCurrentZoomIdx;
+ mReturnZoomStatus = false;
}
else
{