diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-09-06 18:26:58 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2012-09-06 18:31:58 -0700 |
commit | 609acc0c96bc2aedd42246862b537e045f5184b6 (patch) | |
tree | 5b299a07edc39b1bb0e4a88a14a16c5b07ab8807 | |
parent | d06ab147394b0b49679c924a51d77c91dea04d82 (diff) | |
download | frameworks_av-609acc0c96bc2aedd42246862b537e045f5184b6.zip frameworks_av-609acc0c96bc2aedd42246862b537e045f5184b6.tar.gz frameworks_av-609acc0c96bc2aedd42246862b537e045f5184b6.tar.bz2 |
Camera2: Play shutter and recording sounds.
Bug: 6987540
Change-Id: Icd441a757c4b68fc4988b3bfbef428adb8d1ba28
-rw-r--r-- | services/camera/libcameraservice/Camera2Client.cpp | 8 | ||||
-rw-r--r-- | services/camera/libcameraservice/Camera2Client.h | 1 | ||||
-rw-r--r-- | services/camera/libcameraservice/camera2/CaptureSequencer.cpp | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp index 5400604..2c8a6a2 100644 --- a/services/camera/libcameraservice/Camera2Client.cpp +++ b/services/camera/libcameraservice/Camera2Client.cpp @@ -816,6 +816,8 @@ status_t Camera2Client::startRecordingL(Parameters ¶ms, bool restart) { return INVALID_OPERATION; } + mCameraService->playSound(CameraService::SOUND_RECORDING); + res = updateRecordingStream(params); if (res != OK) { ALOGE("%s: Camera %d: Unable to update recording stream: %s (%d)", @@ -910,6 +912,8 @@ void Camera2Client::stopRecording() { return; }; + mCameraService->playSound(CameraService::SOUND_RECORDING); + // Back to preview. Since record can only be reached through preview, // all preview stream setup should be up to date. res = mDevice->setStreamingRequest(mPreviewRequest); @@ -1448,6 +1452,10 @@ const sp<Camera2Device>& Camera2Client::getCameraDevice() { return mDevice; } +const sp<CameraService>& Camera2Client::getCameraService() { + return mCameraService; +} + camera2::SharedParameters& Camera2Client::getParameters() { return mParameters; } diff --git a/services/camera/libcameraservice/Camera2Client.h b/services/camera/libcameraservice/Camera2Client.h index df5dbf4..264000e 100644 --- a/services/camera/libcameraservice/Camera2Client.h +++ b/services/camera/libcameraservice/Camera2Client.h @@ -99,6 +99,7 @@ public: int getCameraId() const; const sp<Camera2Device>& getCameraDevice(); + const sp<CameraService>& getCameraService(); camera2::SharedParameters& getParameters(); int getPreviewStreamId() const; diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp index 532d2aa..1c42cbf 100644 --- a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp +++ b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp @@ -388,6 +388,10 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCapture( return DONE; } + if (l.mParameters.playShutterSound) { + client->getCameraService()->playSound(CameraService::SOUND_SHUTTER); + } + mTimeoutCount = kMaxTimeoutsForCaptureEnd; return STANDARD_CAPTURE_WAIT; } |