crosvm/media
Alexandre Courbot 49b08a0e2c media: cros-codecs: replace mapped resolution with image size in bytes
The concept of mapped resolution is only used in the context of copying
the frame to a CPU-mapped buffer in order to compute the size of said
buffer according to the underlying format.

This requires the caller to check the buffer format and perform the
computation themselves. It would be more efficient to just have a
function performing that computation in a single place and returning the
final buffer size.

Thus, replace MappedHandle's mapped_resolution() method with
image_size(), which returns the size of the buffer that should be passed
to read().

BUG=b:214478588
TEST=cargo build --features `video-decoder,video-encoder,ffmpeg,vaapi`
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: Icff17aa5e2e08676edb450a53316e44897604958
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005492
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
2022-11-10 09:11:49 +00:00
..
cros-codecs media: cros-codecs: replace mapped resolution with image size in bytes 2022-11-10 09:11:49 +00:00
ffmpeg Re-enable video-decoder feature 2022-10-06 18:28:56 +00:00
libva video: decoder: ffmpeg: fix H.264 decoding with ffmpeg in guest 2022-11-07 10:50:23 +00:00
libvda test_runner: Add separate cargo target dir for each platform 2022-10-31 21:33:33 +00:00