No description
Find a file
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
.cargo tools: Set "-D warnings" for run_tests 2022-11-09 20:43:30 +00:00
.devcontainer Add devcontainer config for codespaces 2022-11-09 19:28:15 +00:00
.github Cleanup: Remove old, deprecated and no longer used files 2022-09-20 21:05:57 +00:00
.vscode Document feature flags and introduce new feature sets 2022-10-14 20:31:19 +00:00
aarch64 cargo: Deny compiler warnings 2022-11-08 16:53:48 +00:00
acpi_tables acpi: Add More AML objects 2022-10-11 13:32:01 +00:00
anti_tamper Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
arch crosvm: Allow specyfing gdb feature on unsupported platform 2022-11-09 16:40:42 +00:00
argh_helpers Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
base Revert "data_model: remove VolatileRef" 2022-11-09 23:37:26 +00:00
bit_field Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
broker_ipc crash-report: Build with feature crash-report 2022-09-28 14:45:00 +00:00
common Revert "data_model: remove VolatileRef" 2022-11-09 23:37:26 +00:00
crash_report crash_report: Update Cargo.toml dependency for windows cfg. 2022-10-11 16:54:37 +00:00
cros_async cros_async: Reduce timeout for CancellablePool in testing 2022-11-09 18:39:33 +00:00
cros_fdt arch: split fdt code into its own crate 2022-10-19 17:43:19 +00:00
cros_tracing tracing: rename tracing to cros_tracing. 2022-10-17 20:49:16 +00:00
crosvm-fuzz crosvm-fuzz: update call to BlockAsync::new 2022-10-28 17:38:26 +00:00
crosvm_cli devices: add err code for disk image open failed. 2022-10-20 20:27:58 +00:00
crosvm_control Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
crosvm_plugin Remove plugin-render-server feature 2022-10-14 20:31:19 +00:00
devices media: cros-codecs: replace mapped resolution with image size in bytes 2022-11-10 09:11:49 +00:00
disk disk/qcow: Write less blocks for testing 2022-11-09 18:39:33 +00:00
docs/book docs: book: update references to deprecated disk and network options 2022-11-03 20:32:43 +00:00
e2e_tests e2e_tests: vsock: use a random cid for a guest 2022-11-08 04:26:47 +00:00
fuse Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
gpu_display crosvm: Fix windows clippy warnings 2022-11-03 18:36:29 +00:00
hypervisor cargo: Deny compiler warnings 2022-11-08 16:53:48 +00:00
infra infra/recipes: Fix crOS container build recipe 2022-11-09 20:34:37 +00:00
io_uring io_uring: Move tests into integration test 2022-11-09 20:45:59 +00:00
kernel_cmdline Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
kernel_loader cargo doc: fix warnings 2022-10-06 20:23:59 +00:00
kvm kvm: Extract integration tests 2022-11-09 18:39:33 +00:00
kvm_sys tree-wide: use LFS variants of libc functions 2022-11-02 22:20:18 +00:00
libcras_stub tree-wide: apply cargo fmt --nightly 2022-10-03 21:39:26 +00:00
linux_input_sys Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
logo README: Use PNG logo image 2021-10-29 01:56:23 +00:00
media media: cros-codecs: replace mapped resolution with image size in bytes 2022-11-10 09:11:49 +00:00
metrics crosvm: Fix windows clippy warnings 2022-11-03 18:36:29 +00:00
net_sys tree-wide: use "crosvm" capitalization everywhere 2022-10-07 01:10:12 +00:00
net_util LSC: safe removal of needless_returns 2022-11-09 18:27:14 +00:00
power_monitor power_monitor: Enable feature in all-linux 2022-09-20 21:06:47 +00:00
prebuilts test_runner: Add separate cargo target dir for each platform 2022-10-31 21:33:33 +00:00
protos protos: delete unused test helper function 2022-11-07 22:12:32 +00:00
qcow_utils qcow_utils: add qcow feature to Cargo.toml 2022-11-04 08:27:03 +00:00
resources resources: reject unknown fields when deserializing AddressRange 2022-10-24 02:56:12 +00:00
rutabaga_gfx rutabaga_gfx: set render_server_fd to None without virgl_renderer_next 2022-11-03 22:22:42 +00:00
sandbox Reformat all files with nightly 2022-10-31 21:33:33 +00:00
seccomp Generate constants.json offline 2022-11-02 00:13:08 +00:00
serde_keyvalue serde_keyvalue: allow parsing of inner structs 2022-10-26 17:41:37 +00:00
src Allow exceptions to needless return 2022-11-09 20:50:14 +00:00
system_api Fix compilation with vtpm enabled 2022-09-29 17:17:21 +00:00
tests Document feature flags and introduce new feature sets 2022-10-14 20:31:19 +00:00
third_party devices: vhost-user: add protocol flag for shmem 2022-10-21 01:09:07 +00:00
tools base: Move newly added process tests into an integration test 2022-11-09 20:45:59 +00:00
tpm2 Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
tpm2-sys Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
tube_transporter base: cross platform Event API 2022-10-19 20:17:42 +00:00
usb_sys Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
usb_util Replace common/assertions with static_assertions 2022-10-31 21:33:33 +00:00
vfio_sys vfio_pci: add support for runtime power management 2022-10-10 10:56:05 +00:00
vhost vhost: Move tests into an integration test 2022-11-04 06:49:36 +00:00
virtio_sys bindgen: update bindings to Linux 5.15 2022-09-14 22:09:30 +00:00
vm_control Nontrivial fixes to needless_return 2022-11-09 18:29:24 +00:00
vm_memory Revert "data_model: remove VolatileRef" 2022-11-09 23:37:26 +00:00
win_audio win_audio: Change Activate audio interface completion event to be unnamed 2022-11-03 00:14:20 +00:00
win_util crosvm: move enum ProcessType to win_util. 2022-09-21 19:28:49 +00:00
x86_64 LSC: safe removal of needless_returns 2022-11-09 18:27:14 +00:00
.dockerignore add docker supported builds and tests 2019-05-15 13:36:19 -07:00
.gitignore Add python configs for consistency between IDE and CI 2022-08-16 18:33:23 +00:00
.gitmodules health-check: Add infra checks 2022-08-18 00:17:04 +00:00
.rustfmt.toml rustfmt, win_util: update to 2021 edition 2022-05-31 23:35:02 +00:00
ARCHITECTURE.md Rename integration_tests to e2e_tests 2022-11-03 22:49:39 +00:00
build.rs build.rs: find compile_seccomp_policy via which 2022-11-02 20:18:42 +00:00
Cargo.lock Remove crosvm-fuzz from workspace 2022-11-09 18:39:33 +00:00
Cargo.toml Add media crates to workspace 2022-11-09 18:39:33 +00:00
CONTRIBUTING.md CONTRIBUTING: Add a section about commit messages' format 2022-10-19 06:22:42 +00:00
DIR_METADATA DIR_METADATA: Add public buganizer component 2022-09-21 17:43:59 +00:00
LICENSE Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
mypy.ini Add python configs for consistency between IDE and CI 2022-08-16 18:33:23 +00:00
OWNERS Add rizhang@ to OWNERS 2022-08-17 01:14:13 +00:00
PRESUBMIT.cfg Cleanup: Remove old, deprecated and no longer used files 2022-09-20 21:05:57 +00:00
pyproject.toml Add python configs for consistency between IDE and CI 2022-08-16 18:33:23 +00:00
README.chromeos.md crosvm: update book and doc links to crosvm.dev 2022-07-29 22:54:01 +00:00
README.md docs: Replace crbug link with issuetracker.google.com 2022-10-18 06:22:41 +00:00
rust-toolchain dev_container: Upgrade to debian bookworm 2022-09-14 22:32:36 +00:00

crosvm - The Chrome OS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linuxs KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesnt emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on Chrome OS devices.

Logo