Skip to content
Snippets Groups Projects
Commit 56ebfa4c authored by Zyta Szpak's avatar Zyta Szpak
Browse files

V4L2Decoder: Terminate drain if host is not streaming

While testing ARM devices a corner case was discovered
that before the first resolution change event is dequeued
Chrome output queues and host driver CAPTURE queues are
not streaming but ARCVM has no knowledge of it. Drain
never finishes because output EOS is expected.
Marking that the resolution change was dequeued allows
to recognize this state and act accordingly when handling
drain.

Bug: 280853786
Bug: 232395110
Test: android.mediav2.cts.CodecDecoderTest#testOnlyEos[15(video/avc)]
Change-Id: I27d0f73a26d31f32a7e4cb473e685278b07f72a3
(cherry picked from commit 05f380eb88f25cb6d598b01ca80a18860de527c7)
parent b4ac6f10
No related branches found
No related tags found
No related merge requests found
......@@ -394,6 +394,18 @@ void V4L2Decoder::pumpDecodeRequest() {
auto request = std::move(mDecodeRequests.front());
mDecodeRequests.pop();
// There is one more case that EOS frame cannot be dequeued because
// the first resolution change event wasn't dequeued before - output
// queues on the host are not streaming but ARCVM has no knowledge about
// it. Check if first resolution change event was received and finish
// drain now if it wasn't.
if (mInitialEosBuffer) {
ALOGV("Terminate drain, because there was no stream");
mTaskRunner->PostTask(FROM_HERE, ::base::BindOnce(std::move(request.decodeCb),
VideoDecoder::DecodeStatus::kOk));
return;
}
if (!sendV4L2DecoderCmd(false)) {
std::move(request.decodeCb).Run(VideoDecoder::DecodeStatus::kError);
onError();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment