summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2011-09-09 12:12:53 -0500
committerIliyan Malchev <malchev@google.com>2011-09-12 16:06:41 -0700
commit66c3c1ee3b437116654c7cb68bc71ba2358f6463 (patch)
treec15eaa906b3fece1cd65aa9f0e434a0b86eebed2
parent1ac47bb2079e89a649deeb89c4f82f84aadfdd1e (diff)
downloadhardware_ti_omap4-66c3c1ee3b437116654c7cb68bc71ba2358f6463.zip
hardware_ti_omap4-66c3c1ee3b437116654c7cb68bc71ba2358f6463.tar.gz
hardware_ti_omap4-66c3c1ee3b437116654c7cb68bc71ba2358f6463.tar.bz2
CameraHal: Handle a few corner cases with capture
1. Do not apply 3A settings in the middle of a capture. Causing an issue with the capture pipe 2. If we happen to unregister shutter callback while somebody is still waiting for it, go ahead and signal them. Change-Id: I961571a1feeec5349b9888748cf002e1e30cea4e Signed-off-by: Tyler Luu <tluu@ti.com>
-rw-r--r--camera/OMXCameraAdapter/OMXCameraAdapter.cpp9
-rw-r--r--camera/OMXCameraAdapter/OMXCapture.cpp13
2 files changed, 19 insertions, 3 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index 38779a5..0d05b28 100644
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -2709,8 +2709,9 @@ OMX_ERRORTYPE OMXCameraAdapter::OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLE
OMX_ERRORTYPE eError = OMX_ErrorNone;
CameraFrame::FrameType typeOfFrame = CameraFrame::ALL_FRAMES;
unsigned int refCount = 0;
- BaseCameraAdapter::AdapterState state;
+ BaseCameraAdapter::AdapterState state, nextState;
BaseCameraAdapter::getState(state);
+ BaseCameraAdapter::getNextState(nextState);
sp<CameraFDResult> fdResult = NULL;
res1 = res2 = NO_ERROR;
@@ -2738,8 +2739,10 @@ OMX_ERRORTYPE OMXCameraAdapter::OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLE
stat |= advanceZoom();
- ///On the fly update to 3A settings not working
- if( mPending3Asettings )
+ // On the fly update to 3A settings not working
+ // Do not update 3A here if we are in the middle of a capture
+ // or in the middle of transitioning to it
+ if( mPending3Asettings && ((nextState & CAPTURE_ACTIVE) == 0))
{
apply3Asettings(mParameters3A);
}
diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp
index 5f3a7f8..6626e2f 100644
--- a/camera/OMXCameraAdapter/OMXCapture.cpp
+++ b/camera/OMXCameraAdapter/OMXCapture.cpp
@@ -857,6 +857,19 @@ status_t OMXCameraAdapter::stopImageCapture()
//Disable the callback first
ret = setShutterCallback(false);
+ // 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 );
+ }
+ mStartCaptureSem.Create(0);
+ }
+
//release any 3A locks if locked
ret = set3ALock(OMX_FALSE, OMX_FALSE);
if(ret!=NO_ERROR)