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

Commit 54a4d67a authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by android-build-merger
Browse files

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

am: a1cad728

Change-Id: I20fda033f58fdfeeebf983bb7b2f60d7533d8df3
parents b44eb7ed a1cad728
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();