From 697f06bc7657009b807865ba424e0b6dd33392e2 Mon Sep 17 00:00:00 2001 From: Sundar Raman Date: Thu, 20 Oct 2011 13:30:07 -0700 Subject: CameraHAL: Disable AF assist in stop preview If AF assist is ON when switching to video mode and flash is not set to OFF before switching, then the torch mode is somehow turned ON and never turns OFF. Since AF assist is not used after stopping preview, set it to OFF Change-Id: I44c9e6359a0488d235929f6bf1cdd4b257565caf Signed-off-by: Sundar Raman --- camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index ba2de71..cae2815 100755 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -1899,6 +1899,23 @@ status_t OMXCameraAdapter::stopPreview() // Error, but we probably still want to continue to stop preview } + OMX_CONFIG_FOCUSASSISTTYPE focusAssist; + OMX_INIT_STRUCT_PTR (&focusAssist, OMX_CONFIG_FOCUSASSISTTYPE); + focusAssist.nPortIndex = OMX_ALL; + focusAssist.bFocusAssist = OMX_FALSE; + CAMHAL_LOGDB("Configuring AF Assist mode 0x%x", focusAssist.bFocusAssist); + eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp, + (OMX_INDEXTYPE) OMX_IndexConfigFocusAssist, + &focusAssist); + if ( OMX_ErrorNone != eError ) + { + CAMHAL_LOGEB("Error while configuring AF Assist mode 0x%x", eError); + } + else + { + CAMHAL_LOGDA("Camera AF Assist mode configured successfully"); + } + if ( 0 != mStopPreviewSem.Count() ) { CAMHAL_LOGEB("Error mStopPreviewSem semaphore count %d", mStopPreviewSem.Count()); -- cgit v1.1