summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2012-11-26 10:50:55 -0800
committerIgor Murashkin <iam@google.com>2012-11-26 16:01:48 -0800
commitaa9e3e01b86bd9bfb5ac36c0f360d5fe478cbb2d (patch)
tree57a32f0f9b4c601704d9e072ece1f5d05d706f1a /services/camera/libcameraservice/camera2/CaptureSequencer.cpp
parentd983364b3655a547b55bb11dbe148103198c011d (diff)
downloadframeworks_av-aa9e3e01b86bd9bfb5ac36c0f360d5fe478cbb2d.zip
frameworks_av-aa9e3e01b86bd9bfb5ac36c0f360d5fe478cbb2d.tar.gz
frameworks_av-aa9e3e01b86bd9bfb5ac36c0f360d5fe478cbb2d.tar.bz2
Camera: Play shutter sound iff enableShutterSound(true) && ShutterCallback !null
Bug: 7564718 Change-Id: Ie7821cdee57966d88af048759578439a3e6ecb2e
Diffstat (limited to 'services/camera/libcameraservice/camera2/CaptureSequencer.cpp')
-rw-r--r--services/camera/libcameraservice/camera2/CaptureSequencer.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
index fe4abc0..072453b 100644
--- a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
+++ b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
@@ -45,7 +45,8 @@ CaptureSequencer::CaptureSequencer(wp<Camera2Client> client):
mCaptureState(IDLE),
mTriggerId(0),
mTimeoutCount(0),
- mCaptureId(Camera2Client::kCaptureRequestIdStart) {
+ mCaptureId(Camera2Client::kCaptureRequestIdStart),
+ mMsgType(0) {
ALOGV("%s", __FUNCTION__);
}
@@ -58,7 +59,7 @@ void CaptureSequencer::setZslProcessor(wp<ZslProcessor> processor) {
mZslProcessor = processor;
}
-status_t CaptureSequencer::startCapture() {
+status_t CaptureSequencer::startCapture(int msgType) {
ALOGV("%s", __FUNCTION__);
ATRACE_CALL();
Mutex::Autolock l(mInputMutex);
@@ -67,6 +68,7 @@ status_t CaptureSequencer::startCapture() {
return INVALID_OPERATION;
}
if (!mStartCapture) {
+ mMsgType = msgType;
mStartCapture = true;
mStartCaptureSignal.signal();
}
@@ -343,7 +345,7 @@ CaptureSequencer::CaptureState CaptureSequencer::manageZslStart(
SharedParameters::Lock l(client->getParameters());
/* warning: this also locks a SharedCameraClient */
- shutterNotifyLocked(l.mParameters, client);
+ shutterNotifyLocked(l.mParameters, client, mMsgType);
mShutterNotified = true;
mTimeoutCount = kMaxTimeoutsForCaptureEnd;
return STANDARD_CAPTURE_WAIT;
@@ -495,7 +497,7 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCaptureWait(
if (mNewFrameReceived && !mShutterNotified) {
SharedParameters::Lock l(client->getParameters());
/* warning: this also locks a SharedCameraClient */
- shutterNotifyLocked(l.mParameters, client);
+ shutterNotifyLocked(l.mParameters, client, mMsgType);
mShutterNotified = true;
}
while (mNewFrameReceived && !mNewCaptureReceived) {
@@ -639,10 +641,12 @@ status_t CaptureSequencer::updateCaptureRequest(const Parameters &params,
}
/*static*/ void CaptureSequencer::shutterNotifyLocked(const Parameters &params,
- sp<Camera2Client> client) {
+ sp<Camera2Client> client, int msgType) {
ATRACE_CALL();
- if (params.state == Parameters::STILL_CAPTURE && params.playShutterSound) {
+ if (params.state == Parameters::STILL_CAPTURE
+ && params.playShutterSound
+ && (msgType & CAMERA_MSG_SHUTTER)) {
client->getCameraService()->playSound(CameraService::SOUND_SHUTTER);
}