Commit dbc04d68 authored by wuchengli's avatar wuchengli Committed by Commit bot

V4L2VDA: do not queue output buffer during resolution change.

This issue happens when a resolution change happens right
after a reset. First the client requests a reset. The image
processor is still processing some buffers and they will be
ignored when returning to V4L2VideoAccelerator. Then a
resolution change occurs and V4L2VDA stops the output queue.
The image processor returns a buffer and V4L2VDA queues it
back. Since the queue is stopped, STREAMON will be called to
start the queue. Finally REQBUFS will fail during resolution
change because the queue is not stopped.

The fix is we should not queue the buffer returned from
image proessor if a resolution change is in progress.

BUG=chrome-os-partner:55347
TEST=Seek when playing switch_1080p_720p.mp4 on oak.
The video is from gs://chromiumos-test-assets-public/Shaka-Dash.

Review-Url: https://codereview.chromium.org/2156003002
Cr-Commit-Position: refs/heads/master@{#405991}
parent 760bfbf5
...@@ -2229,7 +2229,11 @@ void V4L2VideoDecodeAccelerator::FrameProcessed(int32_t bitstream_buffer_id, ...@@ -2229,7 +2229,11 @@ void V4L2VideoDecodeAccelerator::FrameProcessed(int32_t bitstream_buffer_id,
<< "because of Reset. Drop the buffer"; << "because of Reset. Drop the buffer";
output_record.state = kFree; output_record.state = kFree;
free_output_buffers_.push(output_buffer_index); free_output_buffers_.push(output_buffer_index);
Enqueue(); // Do not queue the buffer if a resolution change is in progress. The queue
// is about to be destroyed anyway. Otherwise, the queue will be started in
// Enqueue and REQBUFS(0) will fail.
if (decoder_state_ != kChangingResolution)
Enqueue();
} }
} }
......
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