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

Commit 40450570 authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

Camera: HeicCompositeStream: Fix IDLE state transition

It's not sufficient to check mPendingInputFrames for wether
the device is idle. mSettingsByFrameNumber contains requests
not yet queued into mPendingInputFrames. And it also needs to be
considered.

Flag: EXEMPT bugfix
Test: vendor test
Bug: 361290241
Change-Id: I9d9a71b2ed29f2191b824078b8fc54ac6250d890
parent 8b428d92
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -1311,10 +1311,12 @@ void HeicCompositeStream::releaseInputFramesLocked() {
        if (firstPendingFrame != mPendingInputFrames.end()) {
        if (firstPendingFrame != mPendingInputFrames.end()) {
            updateCodecQualityLocked(firstPendingFrame->second.quality);
            updateCodecQualityLocked(firstPendingFrame->second.quality);
        } else {
        } else {
            if (mSettingsByFrameNumber.size() == 0) {
                markTrackerIdle();
                markTrackerIdle();
            }
            }
        }
        }
    }
    }
}


status_t HeicCompositeStream::initializeCodec(uint32_t width, uint32_t height,
status_t HeicCompositeStream::initializeCodec(uint32_t width, uint32_t height,
        const sp<CameraDeviceBase>& cameraDevice) {
        const sp<CameraDeviceBase>& cameraDevice) {
@@ -1737,8 +1739,10 @@ bool HeicCompositeStream::threadLoop() {
                    // removed, they are simply skipped.
                    // removed, they are simply skipped.
                    mPendingInputFrames.erase(failingFrameNumber);
                    mPendingInputFrames.erase(failingFrameNumber);
                    if (mPendingInputFrames.size() == 0) {
                    if (mPendingInputFrames.size() == 0) {
                        if (mSettingsByFrameNumber.size() == 0) {
                            markTrackerIdle();
                            markTrackerIdle();
                        }
                        }
                    }
                    return true;
                    return true;
                }
                }