crosvm/devices
Daniel Almeida 6312dbd533 virtio: video: vaapi: do not drain ready queue if no buffers available
Do not drain the ready queue if we have not been provided buffers by
CrosVM.

The previous implementation would attempt to drain as soon as a picture
was ready to be outputted, but this does not account for the fact that
there is a window of time between ProvidePictureBuffers being emitted
and set_output_parameters() being called, as the guest needs to process
the request.

This meant that ready frames would be dequeued, but the call to
output_picture would return Err, effectively dropping the frames before
they could be outputted.

Simply return early if OutputQueueState != OutputQueueState::Decoding,
leaving the queue as is.

BUG=b:214478588
TEST="Decoding test-25fps.h264 yields exactly 250 frames."

Change-Id: I6042f4556933d4b59a54c6ca986510356a040e18
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3903094
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-10-28 07:28:00 +00:00
..
src virtio: video: vaapi: do not drain ready queue if no buffers available 2022-10-28 07:28:00 +00:00
tests/irqchip Extract devices integration tests 2022-10-26 17:53:08 +00:00
Cargo.toml video: decoder: vaapi: port the VAAPI backend to cros-codecs 2022-10-28 03:23:31 +00:00