Commit 7cf2167e authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/vaapi: Post DecodeTask() from ReusePictureBuffer()

DecodeTask() is posted from mainly QueueInputBuffer() or
RecycleVASurfaceID() in most cases.
Some DecodeTask() posted from QueueInputBuffer() do nothing since va
surface is not available yet. It will be available after AssignPictureBuffers().
If the first buffer contains information about coded size, DecodeTask() for the
succeeding buffers are pended. In this case, DecodeTask() may be called twice;
in QueueInputBuffer() and the other once in AssignPictureBuffers().
If the third buffer is a dummy buffer queued by Flush(), the buffer is not
popped in DecodeTask() and thus FlushTask() is not executed permanently.
It can be a problem when a client expects the picture decoded from second buffer
is returned, because decoding of the second buffer might be pending in driver.
FlushTask() which can ask driver to decode the second buffer is not executed now
due to the above reason.
The following CTS tests behave similarly to the problem case.
* android.media.cts.DecoderTest#testEOSBehaviorH264
* android.media.cts.DecoderTest#testEOSBehaviorVP8"
* android.media.cts.DecoderTest#testEOSBehaviorVP9"

These CTS starts to fail from crrev.com/c/973684. In the CL, DecodeTask() was
changed to not execute DecodeTask() to the succeeding buffers.

This changes VDA as to post DecodeTask() from ReusePictureBuffer(), and the
number of executing DecodeTask() is sufficient to get driver finish decoding
storing picture buffers.

BUG=b:77840176
TEST=CtsMediaTestCases on eve
TEST=VDA unittest

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;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I31adbaf6cd01b79d1872acf56856cd10e46f9043
Reviewed-on: https://chromium-review.googlesource.com/1006563
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarPawel Osciak <posciak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550155}
parent c28c8d48
...@@ -600,6 +600,10 @@ void VaapiVideoDecodeAccelerator::ReusePictureBuffer( ...@@ -600,6 +600,10 @@ void VaapiVideoDecodeAccelerator::ReusePictureBuffer(
available_picture_buffers_.push(picture_buffer_id); available_picture_buffers_.push(picture_buffer_id);
TryOutputPicture(); TryOutputPicture();
decoder_thread_task_runner_->PostTask(
FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask,
base::Unretained(this)));
} }
void VaapiVideoDecodeAccelerator::FlushTask() { void VaapiVideoDecodeAccelerator::FlushTask() {
......
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