diff options
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/camera2/CaptureSequencer.cpp | 15 | ||||
-rw-r--r-- | services/camera/libcameraservice/camera2/CaptureSequencer.h | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp index 5156539..fe4abc0 100644 --- a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp +++ b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp @@ -40,6 +40,7 @@ CaptureSequencer::CaptureSequencer(wp<Camera2Client> client): mNewAEState(false), mNewFrameReceived(false), mNewCaptureReceived(false), + mShutterNotified(false), mClient(client), mCaptureState(IDLE), mTriggerId(0), @@ -308,6 +309,7 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStart( } else { nextState = STANDARD_START; } + mShutterNotified = false; return nextState; } @@ -342,7 +344,7 @@ CaptureSequencer::CaptureState CaptureSequencer::manageZslStart( SharedParameters::Lock l(client->getParameters()); /* warning: this also locks a SharedCameraClient */ shutterNotifyLocked(l.mParameters, client); - + mShutterNotified = true; mTimeoutCount = kMaxTimeoutsForCaptureEnd; return STANDARD_CAPTURE_WAIT; } @@ -474,9 +476,6 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCapture( return DONE; } - /* warning: this also locks a SharedCameraClient */ - shutterNotifyLocked(l.mParameters, client); - mTimeoutCount = kMaxTimeoutsForCaptureEnd; return STANDARD_CAPTURE_WAIT; } @@ -493,7 +492,13 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCaptureWait( break; } } - while (!mNewCaptureReceived) { + if (mNewFrameReceived && !mShutterNotified) { + SharedParameters::Lock l(client->getParameters()); + /* warning: this also locks a SharedCameraClient */ + shutterNotifyLocked(l.mParameters, client); + mShutterNotified = true; + } + while (mNewFrameReceived && !mNewCaptureReceived) { res = mNewCaptureSignal.waitRelative(mInputMutex, kWaitDuration); if (res == TIMED_OUT) { mTimeoutCount--; diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.h b/services/camera/libcameraservice/camera2/CaptureSequencer.h index 8df6d95..4cde9c8 100644 --- a/services/camera/libcameraservice/camera2/CaptureSequencer.h +++ b/services/camera/libcameraservice/camera2/CaptureSequencer.h @@ -94,6 +94,8 @@ class CaptureSequencer: sp<MemoryBase> mCaptureBuffer; Condition mNewCaptureSignal; + bool mShutterNotified; + /** * Internal to CaptureSequencer */ |