summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2012-06-21 09:59:55 -0500
committerJason Simmons <jsimmons@google.com>2012-11-07 14:36:32 -0800
commit60c916ae7e31dbff92c1c39385a87cf216fc34d9 (patch)
tree3bfd777c32b5a04652bdaf1e1179c06ec3c44748
parent8c4175849a833e6466c16f05c5b68fbe6d0006c5 (diff)
downloadomap4-aah-60c916ae7e31dbff92c1c39385a87cf216fc34d9.tar.gz
CameraHal: OMX: Change shot queue flow
- Since flow through base camera adapter has changed to make call flow for accumulating shots similar to regular capture, OMX capture needs to change it's slow a bit. We should be accumlating burst counters in UseBuffer and go through whole list of buffers trying to find an IDLE one when starting capture. Change-Id: I91bebbb176d29504631095b29ce2a15a44b79f39 Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
-rw-r--r--camera/OMXCameraAdapter/OMXCapture.cpp31
1 files changed, 7 insertions, 24 deletions
diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp
index 5231960..0a62006 100644
--- a/camera/OMXCameraAdapter/OMXCapture.cpp
+++ b/camera/OMXCameraAdapter/OMXCapture.cpp
@@ -1220,9 +1220,7 @@ status_t OMXCameraAdapter::startImageCapture(bool bracketing, CachedCaptureParam
apply3Asettings(mParameters3A);
}
- // check is we are already in capture state...which means we are
- // accumulating shots
- if ((ret == NO_ERROR) && (mBurstFramesQueued > 0)) {
+ if (ret == NO_ERROR) {
int index = 0;
int queued = 0;
android::AutoMutex lock(mBurstLock);
@@ -1237,9 +1235,6 @@ status_t OMXCameraAdapter::startImageCapture(bool bracketing, CachedCaptureParam
mBurstFramesQueued++;
}
}
- } else {
- mCapturedFrames += mBurstFrames;
- mBurstFramesAccum += mBurstFrames;
}
while ((mBurstFramesQueued < mBurstFramesAccum) &&
@@ -1259,21 +1254,6 @@ status_t OMXCameraAdapter::startImageCapture(bool bracketing, CachedCaptureParam
}
index++;
}
- } else if ( NO_ERROR == ret ) {
- ///Queue all the buffers on capture port
- for ( int index = 0 ; index < capData->mMaxQueueable ; index++ ) {
- if (mBurstFramesQueued < mBurstFramesAccum) {
- CAMHAL_LOGDB("Queuing buffer on Capture port - %p",
- capData->mBufferHeader[index]->pBuffer);
- capData->mStatus[index] = OMXCameraPortParameters::FILL;
- eError = OMX_FillThisBuffer(mCameraAdapterParameters.mHandleComp,
- (OMX_BUFFERHEADERTYPE*)capData->mBufferHeader[index]);
- mBurstFramesQueued++;
- } else {
- capData->mStatus[index] = OMXCameraPortParameters::IDLE;
- }
- GOTO_EXIT_IF((eError!=OMX_ErrorNone), eError);
- }
#ifdef CAMERAHAL_USE_RAW_IMAGE_SAVING
if (mRawCapture) {
@@ -1847,6 +1827,7 @@ status_t OMXCameraAdapter::UseBuffersCapture(CameraBuffer * bufArr, int num)
pBufferHdr->nVersion.s.nRevision = 0;
pBufferHdr->nVersion.s.nStep = 0;
imgCaptureData->mBufferHeader[index] = pBufferHdr;
+ imgCaptureData->mStatus[index] = OMXCameraPortParameters::IDLE;
}
// Wait for the image port enable event
@@ -1922,9 +1903,11 @@ status_t OMXCameraAdapter::UseBuffersCapture(CameraBuffer * bufArr, int num)
}
}
- mCapturedFrames = mBurstFrames;
- mBurstFramesAccum = mBurstFrames;
- mBurstFramesQueued = 0;
+ {
+ android::AutoMutex lock(mBurstLock);
+ mCapturedFrames += mBurstFrames;
+ mBurstFramesAccum += mBurstFrames;
+ }
mCaptureConfigured = true;