summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2015-10-14 23:36:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-14 23:36:51 +0000
commit5f54de483624a5731d82060bd3e1aab74b32b15e (patch)
treeec9f443ec03bac727740985f6ab08cf6038583a2 /services/camera
parent6e2ea5abb4344bf2e308a03ac488e93ab92778ab (diff)
parent82104ebbb2cc04277ab07b355f38f73045a11770 (diff)
downloadframeworks_av-5f54de483624a5731d82060bd3e1aab74b32b15e.zip
frameworks_av-5f54de483624a5731d82060bd3e1aab74b32b15e.tar.gz
frameworks_av-5f54de483624a5731d82060bd3e1aab74b32b15e.tar.bz2
Merge "Camera: Add video recording stop sound" into mnc-dr-dev
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/CameraService.cpp3
-rw-r--r--services/camera/libcameraservice/CameraService.h3
-rw-r--r--services/camera/libcameraservice/api1/Camera2Client.cpp6
-rw-r--r--services/camera/libcameraservice/api1/CameraClient.cpp6
4 files changed, 10 insertions, 8 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 2aaefe9..19f588a 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -1831,7 +1831,8 @@ void CameraService::loadSound() {
if (mSoundRef++) return;
mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
- mSoundPlayer[SOUND_RECORDING] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
+ mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
+ mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/system/media/audio/ui/VideoStop.ogg");
}
void CameraService::releaseSound() {
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index cd97b08..4b0eeb7 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -159,7 +159,8 @@ public:
enum sound_kind {
SOUND_SHUTTER = 0,
- SOUND_RECORDING = 1,
+ SOUND_RECORDING_START = 1,
+ SOUND_RECORDING_STOP = 2,
NUM_SOUNDS
};
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp
index 48b5a26..4338d64 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.cpp
+++ b/services/camera/libcameraservice/api1/Camera2Client.cpp
@@ -1040,7 +1040,7 @@ status_t Camera2Client::startRecordingL(Parameters &params, bool restart) {
}
if (!restart) {
- mCameraService->playSound(CameraService::SOUND_RECORDING);
+ mCameraService->playSound(CameraService::SOUND_RECORDING_START);
mStreamingProcessor->updateRecordingRequest(params);
if (res != OK) {
ALOGE("%s: Camera %d: Unable to update recording request: %s (%d)",
@@ -1212,7 +1212,7 @@ void Camera2Client::stopRecording() {
return;
};
- mCameraService->playSound(CameraService::SOUND_RECORDING);
+ mCameraService->playSound(CameraService::SOUND_RECORDING_STOP);
// Remove recording stream to prevent it from slowing down takePicture later
if (!l.mParameters.recordingHint && l.mParameters.isJpegSizeOverridden()) {
@@ -1638,7 +1638,7 @@ status_t Camera2Client::commandEnableShutterSoundL(bool enable) {
}
status_t Camera2Client::commandPlayRecordingSoundL() {
- mCameraService->playSound(CameraService::SOUND_RECORDING);
+ mCameraService->playSound(CameraService::SOUND_RECORDING_START);
return OK;
}
diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp
index 38e35cd..30b462b 100644
--- a/services/camera/libcameraservice/api1/CameraClient.cpp
+++ b/services/camera/libcameraservice/api1/CameraClient.cpp
@@ -439,7 +439,7 @@ status_t CameraClient::startRecordingMode() {
// start recording mode
enableMsgType(CAMERA_MSG_VIDEO_FRAME);
- mCameraService->playSound(CameraService::SOUND_RECORDING);
+ mCameraService->playSound(CameraService::SOUND_RECORDING_START);
result = mHardware->startRecording();
if (result != NO_ERROR) {
ALOGE("mHardware->startRecording() failed with status %d", result);
@@ -470,7 +470,7 @@ void CameraClient::stopRecording() {
disableMsgType(CAMERA_MSG_VIDEO_FRAME);
mHardware->stopRecording();
- mCameraService->playSound(CameraService::SOUND_RECORDING);
+ mCameraService->playSound(CameraService::SOUND_RECORDING_STOP);
mPreviewBuffer.clear();
}
@@ -648,7 +648,7 @@ status_t CameraClient::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
}
return OK;
} else if (cmd == CAMERA_CMD_PLAY_RECORDING_SOUND) {
- mCameraService->playSound(CameraService::SOUND_RECORDING);
+ mCameraService->playSound(CameraService::SOUND_RECORDING_START);
} else if (cmd == CAMERA_CMD_SET_VIDEO_BUFFER_COUNT) {
// Silently ignore this command
return INVALID_OPERATION;