Commit 4694c1d4 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2vda: fix STREAMON sequence

The codec API specifies that when starting streaming, the OUTPUT queue
should start first, followed by the CAPTURE queue. However it can happen
in some reset scenarios that CAPTURE buffers are queued ahead of OUTPUT
buffers, which results in the CAPTURE queue starting first. Fix this by
only allowing the CAPTURE queue to start if the OUTPUT queue is already
streaming.

BUG=b:111670886
TEST=Checked that VDA unittest was passing on Hana and Cheza.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Id27b5202dc6f910880e52099773df26e73a50304
Reviewed-on: https://chromium-review.googlesource.com/1212211
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarPawel Osciak <posciak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589479}
parent 85ef12e4
...@@ -1331,6 +1331,10 @@ void V4L2VideoDecodeAccelerator::Enqueue() { ...@@ -1331,6 +1331,10 @@ void V4L2VideoDecodeAccelerator::Enqueue() {
} }
} }
// OUTPUT queue must be started before CAPTURE queue as per codec API.
if (!input_streamon_)
return;
// Enqueue all the outputs we can. // Enqueue all the outputs we can.
const int old_outputs_queued = output_buffer_queued_count_; const int old_outputs_queued = output_buffer_queued_count_;
while (!free_output_buffers_.empty()) { while (!free_output_buffers_.empty()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment