From 8e02ca748bf41e1357b94170226dfb5e8ca11f10 Mon Sep 17 00:00:00 2001 From: Nipun Kwatra Date: Tue, 14 Sep 2010 21:22:59 -0700 Subject: [PATCH] Disable shutter sound and play recording sound for still mode time lapse. Disabling shutter sound when using still capture for time lapse recording. We also play recording sound at the start and stop of recording as is done for usual video recording. Change-Id: I6a6fa0c7c867979624105eea74fc17945db1f517 --- media/libstagefright/CameraSourceTimeLapse.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp index 7595a28f87be7..44d159ac74110 100644 --- a/media/libstagefright/CameraSourceTimeLapse.cpp +++ b/media/libstagefright/CameraSourceTimeLapse.cpp @@ -202,6 +202,10 @@ void CameraSourceTimeLapse::startCameraRecording() { mCamera->setParameters(params.flatten()); mCameraIdle = true; + // disable shutter sound and play the recording sound. + mCamera->sendCommand(CAMERA_CMD_ENABLE_SHUTTER_SOUND, 0, 0); + mCamera->sendCommand(CAMERA_CMD_PLAY_RECORDING_SOUND, 0, 0); + // create a thread which takes pictures in a loop pthread_attr_t attr; pthread_attr_init(&attr); @@ -219,6 +223,9 @@ void CameraSourceTimeLapse::stopCameraRecording() { if (mUseStillCameraForTimeLapse) { void *dummy; pthread_join(mThreadTimeLapse, &dummy); + + // play the recording sound and restart preview. + mCamera->sendCommand(CAMERA_CMD_PLAY_RECORDING_SOUND, 0, 0); CHECK_EQ(OK, mCamera->startPreview()); } else { mCamera->stopRecording();