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

Commit 2d1ef137 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Play shutter and recording sounds." into jb-mr1-dev

parents 261fd211 609acc0c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -816,6 +816,8 @@ status_t Camera2Client::startRecordingL(Parameters &params, 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;
}
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ public:

    int getCameraId() const;
    const sp<Camera2Device>& getCameraDevice();
    const sp<CameraService>& getCameraService();
    camera2::SharedParameters& getParameters();

    int getPreviewStreamId() const;
+4 −0
Original line number Diff line number Diff line
@@ -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;
}