crosvm/media
Alexandre Courbot e516e84013 media: cros-codecs: implement MappableHandle for Image
MappableHandle was implemented on the backend handle, but doing so is
sub-optimal in the case of VAAPI which needs to re-create the VA Image
with each call to a method of MappableHandle, which is a costly
operation.

Fix this by implementing MappableHandle on the Image directly. That way
callers can request the mappable handler once to create the image, and
call all the methods on the same instance.

This also allows us to make MappableHandle::image_size return the size
instead of a Result.

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

Change-Id: Iaa048c1f488021d49376f612ebde560e84a11dc4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006228
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-10 09:11:49 +00:00
..
cros-codecs media: cros-codecs: implement MappableHandle for Image 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