Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82104ebb authored by Chien-Yu Chen's avatar Chien-Yu Chen
Browse files

Camera: Add video recording stop sound

Add video recording stop sound to match MediaActionSound.

Bug: 24745252
Change-Id: I84b69757c7e0a98abfaafcce5f41dd45fd41cf74
parent ea6a3dc0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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() {
+2 −1
Original line number Diff line number Diff line
@@ -159,7 +159,8 @@ public:

    enum sound_kind {
        SOUND_SHUTTER = 0,
        SOUND_RECORDING = 1,
        SOUND_RECORDING_START = 1,
        SOUND_RECORDING_STOP = 2,
        NUM_SOUNDS
    };

+3 −3
Original line number Diff line number Diff line
@@ -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;
}

+3 −3
Original line number Diff line number Diff line
@@ -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;