diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-10-09 12:17:38 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-09 12:17:38 -0700 |
commit | 5fa8add64b7f7614c288a9e3b790ab7bfc7858b5 (patch) | |
tree | 48b7f54b1106003a11ab1e53fb80c73be12bc676 /services | |
parent | 915b08fe3e65c8391a60404c52c1f87a4499eaab (diff) | |
parent | 240a538b59b905b68d46e39d79c8d48d1662161c (diff) | |
download | frameworks_av-5fa8add64b7f7614c288a9e3b790ab7bfc7858b5.zip frameworks_av-5fa8add64b7f7614c288a9e3b790ab7bfc7858b5.tar.gz frameworks_av-5fa8add64b7f7614c288a9e3b790ab7bfc7858b5.tar.bz2 |
am 240a538b: am d016cf5b: Merge "Camera2: Move non-ZSL shutter sound firing to be later." into jb-mr1-dev
* commit '240a538b59b905b68d46e39d79c8d48d1662161c':
Camera2: Move non-ZSL shutter sound firing to be later.
Diffstat (limited to 'services')
-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 */ |