From 5a1fc91d12042c7ccd09008cb264b40c89634230 Mon Sep 17 00:00:00 2001 From: Vladimir Petrov Date: Fri, 31 Aug 2012 16:38:53 +0300 Subject: CameraHal: Reset shot config queue in stop image capture - Adding code to reset shot config queue when stopping image capture permanently. Change-Id: I037268613d4c48bf6bdc4f98d33b98bea59f8551 Signed-off-by: Vladimir Petrov --- camera/OMXCameraAdapter/OMXCapture.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'camera/OMXCameraAdapter') diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp index 1857781..ac799a6 100644 --- a/camera/OMXCameraAdapter/OMXCapture.cpp +++ b/camera/OMXCameraAdapter/OMXCapture.cpp @@ -1388,6 +1388,23 @@ status_t OMXCameraAdapter::stopImageCapture() } mStartCaptureSem.Create(0); } + } else if (CP_CAM == mCapMode) { + // Reset shot config queue + OMX_TI_CONFIG_ENQUEUESHOTCONFIGS resetShotConfigs; + OMX_INIT_STRUCT_PTR(&resetShotConfigs, OMX_TI_CONFIG_ENQUEUESHOTCONFIGS); + + resetShotConfigs.nPortIndex = mCameraAdapterParameters.mImagePortIndex; + resetShotConfigs.bFlushQueue = OMX_TRUE; + resetShotConfigs.nNumConfigs = 0; + eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp, + ( OMX_INDEXTYPE ) OMX_TI_IndexConfigEnqueueShotConfigs, + &resetShotConfigs); + if ( OMX_ErrorNone != eError ) { + CAMHAL_LOGEB("Error while reset shot config 0x%x", eError); + goto EXIT; + } else { + CAMHAL_LOGDA("Shot config reset successfully"); + } } //Wait here for the capture to be done, in worst case timeout and proceed with cleanup -- cgit v1.1