From 95395c7d9370323c8c536ab36052715ed9ff06f6 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Thu, 13 Sep 2012 16:50:48 +0300 Subject: CameraHal: Improve performance when queuing shots - When queued shot is running and parameters like tap-out/ins don't change we could skip some of the overhead involved in triggering image capture using the new shots. Change-Id: I9738ed0abbc266da0354c216f852bc2f8971d58c Signed-off-by: Emilian Peev Signed-off-by: Vladimir Petrov --- camera/CameraHal.cpp | 17 +++++++++++++++++ camera/OMXCameraAdapter/OMXCapture.cpp | 9 +++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp index bfb90db..7a43cd0 100644 --- a/camera/CameraHal.cpp +++ b/camera/CameraHal.cpp @@ -3288,6 +3288,23 @@ status_t CameraHal::__takePicture(const char *params) // when we remove legacy TI parameters implementation } + // if we are already in the middle of a capture and using the same + // tapout ST...then we just need setParameters and start image + // capture to queue more shots + if (((mCameraAdapter->getState() & CameraAdapter::CAPTURE_STATE) == + CameraAdapter::CAPTURE_STATE) && + (mCameraAdapter->getNextState() != CameraAdapter::PREVIEW_STATE) && + (reuseTapout) ) { +#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS + //pass capture timestamp along with the camera adapter command + ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_START_IMAGE_CAPTURE, + (int) &mStartCapture); +#else + ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_START_IMAGE_CAPTURE); +#endif + return ret; + } + if ( !mBracketingRunning ) { // if application didn't set burst through android::ShotParameters diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp index 292eea5..9fbd784 100644 --- a/camera/OMXCameraAdapter/OMXCapture.cpp +++ b/camera/OMXCameraAdapter/OMXCapture.cpp @@ -1235,6 +1235,9 @@ status_t OMXCameraAdapter::startImageCapture(bool bracketing, CachedCaptureParam mBurstFramesQueued++; } } + } else { + mCapturedFrames += mBurstFrames; + mBurstFramesAccum += mBurstFrames; } CAMHAL_LOGD("mBurstFramesQueued = %d mBurstFramesAccum = %d index = %d " "capData->mNumBufs = %d queued = %d capData->mMaxQueueable = %d", @@ -1910,12 +1913,6 @@ status_t OMXCameraAdapter::UseBuffersCapture(CameraBuffer * bufArr, int num) } } - { - android::AutoMutex lock(mBurstLock); - mCapturedFrames += mBurstFrames; - mBurstFramesAccum += mBurstFrames; - } - mCaptureConfigured = true; #ifdef CAMERAHAL_USE_RAW_IMAGE_SAVING -- cgit v1.2.3