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

Commit 399565a0 authored by Emilian Peev's avatar Emilian Peev Committed by android-build-merger
Browse files

Merge "Camera: Clear available callback buffers during recording stop" into oc-dev am: 7d25f0f5

am: 27a66265

Change-Id: I2dfcca35c589da7a08533a52b2518c7559958a53
parents c82bb720 27a66265
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -478,6 +478,7 @@ void CameraClient::stopPreview() {
// stop recording mode
void CameraClient::stopRecording() {
    LOG1("stopRecording (pid %d)", getCallingPid());
    {
        Mutex::Autolock lock(mLock);
        if (checkPidAndHardware() != NO_ERROR) return;

@@ -488,6 +489,14 @@ void CameraClient::stopRecording() {
        mPreviewBuffer.clear();
    }

    {
        Mutex::Autolock l(mAvailableCallbackBuffersLock);
        if (!mAvailableCallbackBuffers.empty()) {
            mAvailableCallbackBuffers.clear();
        }
    }
}

// release a recording frame
void CameraClient::releaseRecordingFrame(const sp<IMemory>& mem) {
    Mutex::Autolock lock(mLock);