virtio: video: clear output resources when the output queue is cleared

Originally, we clear all the output resources when getting
ProvidePictureBuffers command from VDA. At this point only VDA
discards the output buffers. crosvm should keep the output resources
until the output queue is cleared.

Note that at crrev.com/c/2494602, GAVDA will ignore the output buffers
after calling ProvidePictureBuffers(). So it's safe that crosvm passes
the output buffers after getting ProvidePictureBuffers command.

BUG=b:171442927
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP9_adaptiveDrc

Change-Id: I54dd364e7509c18fb3a3cd193da97dd107ceec44
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2494322
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
This commit is contained in:
Chih-Yu Huang 2020-10-23 12:00:01 +09:00 committed by Commit Bot
parent efb2186785
commit 8ba5fc9819

View file

@ -261,9 +261,6 @@ impl Context {
// No need to set `frame_rate`, as it's only for the encoder.
..Default::default()
};
// All the output buffers at VDA are dropped. Clear the output resources.
self.out_res = Default::default();
}
fn handle_picture_ready(
@ -745,7 +742,7 @@ impl<'a> Decoder<'a> {
session.reset().map_err(VideoError::VdaError)?;
}
QueueType::Output => {
ctx.out_res.queued_res_ids.clear();
ctx.out_res = Default::default();
}
}
Ok(())