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

Commit 21e571fa authored by Houxiang Dai's avatar Houxiang Dai Committed by Harris Dai
Browse files

Fix CodecLooper queue block issue

The message from C2 HAL should queued itself, but not in CodecLooper
queue. Then it will not block other command such as stop from
APP(MediaCodec).

Test:
HDMI stress test pass

Bug: 294965253, 234324371
Change-Id: I55c5c8e53d71084f1c46b508012f3b9ef12cbc93
parent 0369b4ac
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2311,10 +2311,13 @@ status_t CCodec::unsubscribeFromParameters(const std::vector<std::string> &names
void CCodec::onWorkDone(std::list<std::unique_ptr<C2Work>> &workItems) {
    if (!workItems.empty()) {
        Mutexed<std::list<std::unique_ptr<C2Work>>>::Locked queue(mWorkDoneQueue);
        bool shouldPost = queue->empty();
        queue->splice(queue->end(), workItems);
    }
        if (shouldPost) {
            (new AMessage(kWhatWorkDone, this))->post();
        }
    }
}

void CCodec::onInputBufferDone(uint64_t frameIndex, size_t arrayIndex) {
    mChannel->onInputBufferDone(frameIndex, arrayIndex);