diff options
Diffstat (limited to 'camera')
-rw-r--r-- | camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 2 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXZoom.cpp | 36 | ||||
-rw-r--r-- | camera/inc/OMXCameraAdapter/OMXCameraAdapter.h | 1 |
3 files changed, 29 insertions, 10 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index 1d1a31c..5019281 100644 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -189,6 +189,8 @@ status_t OMXCameraAdapter::initialize(CameraProperties::Properties* caps) mDeviceOrientation = 0; mCapabilities = caps; + mZoomUpdating = false; + mZoomUpdate = false; mEXIFData.mGPSData.mAltitudeValid = false; mEXIFData.mGPSData.mDatestampValid = false; diff --git a/camera/OMXCameraAdapter/OMXZoom.cpp b/camera/OMXCameraAdapter/OMXZoom.cpp index 4ba44cf..30f7e45 100644 --- a/camera/OMXCameraAdapter/OMXZoom.cpp +++ b/camera/OMXCameraAdapter/OMXZoom.cpp @@ -67,7 +67,12 @@ status_t OMXCameraAdapter::setParametersZoom(const CameraParameters ¶ms, //Immediate zoom should be applied instantly ( CTS requirement ) mCurrentZoomIdx = mTargetZoomIdx; - doZoom(mCurrentZoomIdx); + if(!mZoomUpdating) { + doZoom(mCurrentZoomIdx); + mZoomUpdating = true; + } else { + mZoomUpdate = true; + } CAMHAL_LOGDB("Zoom by App %d", zoom); } @@ -134,6 +139,8 @@ status_t OMXCameraAdapter::advanceZoom() { status_t ret = NO_ERROR; AdapterState state; + Mutex::Autolock lock(mZoomLock); + BaseCameraAdapter::getState(state); if ( mReturnZoomStatus ) @@ -204,18 +211,27 @@ status_t OMXCameraAdapter::advanceZoom() else if ( (mCurrentZoomIdx == mTargetZoomIdx ) && ( ZOOM_ACTIVE & state ) ) { - ret = BaseCameraAdapter::setState(CameraAdapter::CAMERA_STOP_SMOOTH_ZOOM); + ret = BaseCameraAdapter::setState(CameraAdapter::CAMERA_STOP_SMOOTH_ZOOM); + + if ( NO_ERROR == ret ) + { + ret = BaseCameraAdapter::commitState(); + } + else + { + ret |= BaseCameraAdapter::rollbackState(); + } - if ( NO_ERROR == ret ) - { - ret = BaseCameraAdapter::commitState(); - } - else - { - ret |= BaseCameraAdapter::rollbackState(); - } } + if(mZoomUpdate) { + doZoom(mTargetZoomIdx); + mZoomUpdate = false; + mZoomUpdating = true; + } else { + mZoomUpdating = false; + } + return ret; } diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h index da43b44..0e77692 100644 --- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h +++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h @@ -816,6 +816,7 @@ private: //current zoom Mutex mZoomLock; unsigned int mCurrentZoomIdx, mTargetZoomIdx, mPreviousZoomIndx; + bool mZoomUpdating, mZoomUpdate; int mZoomInc; bool mReturnZoomStatus; static const int32_t ZOOM_STEPS []; |