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

Commit a8abeff1 authored by Roja Rani, Yarubandi's avatar Roja Rani, Yarubandi Committed by Ricardo Cerqueira
Browse files

Camera: Dont process dataCalllback if recording is stopped

Issue: Here stopRecording is not finished as the previous
recording frame process has not completed. dataCallbackTimeStamp()
in CameraSource.cpp has stuck in the thread itself waiting for a lock.
In between, reset() function in CameraSource.cpp has called
and acquired lock. Reset() function calls stopRecording.
So the dataCallbackTimeStamp() is continuously waiting.
Unless dataCallbackTimeStamp returns, processRecordFrame
in HAL will not finish.

CRs-Fixed: 518351

Change-Id: I19bbdb4b50b0113a419c9229f0e26c56e8ce91e8
parent 5018d39c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -826,6 +826,10 @@ status_t CameraSource::read(
void CameraSource::dataCallbackTimestamp(int64_t timestampUs,
        int32_t msgType, const sp<IMemory> &data) {
    ALOGV("dataCallbackTimestamp: timestamp %lld us", timestampUs);
    if (!mStarted) {
       ALOGD("Stop recording issued. Return here.");
       return;
    }
    Mutex::Autolock autoLock(mLock);
    if (!mStarted || (mNumFramesReceived == 0 && timestampUs < mStartTimeUs)) {
        ALOGV("Drop frame at %lld/%lld us", timestampUs, mStartTimeUs);