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

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

Merge "Camera1: JpegProcessor: Do not lock until we have to" into nyc-mr1-dev

parents f81362f6 8e73af9b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -67,10 +67,15 @@ void JpegProcessor::onBufferAcquired(const BufferInfo& /*bufferInfo*/) {
}

void JpegProcessor::onBufferReleased(const BufferInfo& bufferInfo) {
    Mutex::Autolock l(mInputMutex);
    ALOGV("%s", __FUNCTION__);

    if (bufferInfo.mError) {
        // Only lock in case of error, since we get one of these for each
        // onFrameAvailable as well, and scheduling may delay this call late
        // enough to run into later preview restart operations, for non-error
        // cases.
        // b/29524651
        ALOGV("%s: JPEG buffer lost", __FUNCTION__);
        Mutex::Autolock l(mInputMutex);
        mCaptureDone = true;
        mCaptureSuccess = false;
        mCaptureDoneSignal.signal();