diff options
author | Sundar Raman <sunds@ti.com> | 2011-11-08 11:10:16 -0800 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-11-10 13:48:29 -0800 |
commit | 3ec18006399d61e97382601d14aaa43ee339c8b6 (patch) | |
tree | ebf4a581c181fe06b14e2228c75953934f6c0162 /camera/OMXCameraAdapter | |
parent | 2136042f80a20aeeef3ece24bab027c401426334 (diff) | |
download | hardware_ti_omap4xxx-3ec18006399d61e97382601d14aaa43ee339c8b6.zip hardware_ti_omap4xxx-3ec18006399d61e97382601d14aaa43ee339c8b6.tar.gz hardware_ti_omap4xxx-3ec18006399d61e97382601d14aaa43ee339c8b6.tar.bz2 |
CameraHAL: Fixes for ANR and a setParameter issue
Fix 1/3 for b/5593964.
1. Ensure we don't race with stopImageCapture when stopPreview is called
2. Signal the shutter callback correctly
3. Do not crash the media server if focus APIs and image capture returns error
Still go ahead and perform de-init
4. Replace setParameter from CameraHAl to AppCallbackNotifier with getParameter
when needed.
Change-Id: I2b2745827d227a8d7927ce1611a84c29129e8891
Signed-off-by: Sundar Raman <sunds@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'camera/OMXCameraAdapter')
-rwxr-xr-x | camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 8 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXCapture.cpp | 18 |
2 files changed, 12 insertions, 14 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index e97244c..2268e44 100755 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -3331,14 +3331,6 @@ bool OMXCameraAdapter::CommandHandler::Handler() } } - if ( NO_ERROR != stat ) - { - errorNotify = ( ErrorNotifier * ) msg.arg1; - if ( NULL != errorNotify ) - { - errorNotify->errorNotify(CAMERA_ERROR_HARD); - } - } } LOG_FUNCTION_NAME_EXIT; diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp index 68111b8..9ba438c 100644 --- a/camera/OMXCameraAdapter/OMXCapture.cpp +++ b/camera/OMXCameraAdapter/OMXCapture.cpp @@ -741,6 +741,11 @@ status_t OMXCameraAdapter::startImageCapture() return NO_INIT; } + if ((getNextState() & (CAPTURE_ACTIVE|BRACKETING_ACTIVE)) == 0) { + CAMHAL_LOGDA("trying starting capture when already canceled"); + return NO_ERROR; + } + // Camera framework doesn't expect face callbacks once capture is triggered pauseFaceDetection(true); @@ -899,12 +904,13 @@ status_t OMXCameraAdapter::stopImageCapture() // if anybody is waiting on the shutter callback // signal them and then recreate the semaphore if ( 0 != mStartCaptureSem.Count() ) { - for (int i = mStopCaptureSem.Count(); i > 0; i--) { - ret |= SignalEvent(mCameraAdapterParameters.mHandleComp, - (OMX_EVENTTYPE) OMX_EventIndexSettingChanged, - OMX_ALL, - OMX_TI_IndexConfigShutterCallback, - NULL ); + + for (int i = mStartCaptureSem.Count(); i < 0; i++) { + ret |= SignalEvent(mCameraAdapterParameters.mHandleComp, + (OMX_EVENTTYPE) OMX_EventIndexSettingChanged, + OMX_ALL, + OMX_TI_IndexConfigShutterCallback, + NULL ); } mStartCaptureSem.Create(0); } |