diff options
author | Emilian Peev <epeev@mm-sol.com> | 2011-11-11 19:56:41 +0200 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-07-25 08:55:37 -0500 |
commit | 9c16a59fbce6400c13053128621f6b4750b5dc5b (patch) | |
tree | bf6b9cf16817fdbbc7a22ae529f2cb20c943cd8e | |
parent | 9d2261acc3d56de3a35425b893747e8943bcf98d (diff) | |
download | hardware_ti_omap4-9c16a59fbce6400c13053128621f6b4750b5dc5b.zip hardware_ti_omap4-9c16a59fbce6400c13053128621f6b4750b5dc5b.tar.gz hardware_ti_omap4-9c16a59fbce6400c13053128621f6b4750b5dc5b.tar.bz2 |
CameraHal: Avoids a deadlock during temporal bracketing
- 'startBracketing()' already has BaseCameraAdapter's 'mLock'
and it will eventually call 'startImageCapture()'. This method
will try to query the adapter state and by doing so will end
up in a deadlock. Solution, pass an additional parameter to
'startImageCapture()' and avoid the state query, anyhow it is
not needed in this case.
Change-Id: I625c243175a92df8a2e72aaa3cebe3485cad4a5e
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
-rw-r--r-- | camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 2 | ||||
-rw-r--r-- | camera/OMXCameraAdapter/OMXCapture.cpp | 12 | ||||
-rw-r--r-- | camera/inc/OMXCameraAdapter/OMXCameraAdapter.h | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index f7a2e0f..e207803 100644 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -3349,7 +3349,7 @@ bool OMXCameraAdapter::CommandHandler::Handler() switch ( msg.command ) { case CommandHandler::CAMERA_START_IMAGE_CAPTURE: { - stat = mCameraAdapter->startImageCapture(); + stat = mCameraAdapter->startImageCapture(false); break; } case CommandHandler::CAMERA_PERFORM_AUTOFOCUS: diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp index 03c5167..5e102c5 100644 --- a/camera/OMXCameraAdapter/OMXCapture.cpp +++ b/camera/OMXCameraAdapter/OMXCapture.cpp @@ -683,7 +683,7 @@ status_t OMXCameraAdapter::startBracketing(int range) if ( NO_ERROR == ret ) { - ret = startImageCapture(); + ret = startImageCapture(true); { Mutex::Autolock lock(mBracketingLock); @@ -728,7 +728,7 @@ status_t OMXCameraAdapter::stopBracketing() return ret; } -status_t OMXCameraAdapter::startImageCapture() +status_t OMXCameraAdapter::startImageCapture(bool bracketing) { status_t ret = NO_ERROR; OMX_ERRORTYPE eError = OMX_ErrorNone; @@ -750,9 +750,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; + if ( !bracketing ) { + 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 diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h index 62bee51..55414e4 100644 --- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h +++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h @@ -607,7 +607,7 @@ private: status_t sendBracketFrames(size_t &framesSent); // Image Capture Service - status_t startImageCapture(); + status_t startImageCapture(bool bracketing); status_t disableImagePort(); //Shutter callback notifications |