0
Fork 0
mirror of https://github.com/Droid-VM/crosvm.git synced 2026-11-17 06:58:03 +00:00
crosvm/android_codec/src
lateautumn233 fe24182b62 virtio-media: MediaCodec decoders within a pixel budget, asked to decode as fast as they can
A 4096x2160 hardware decoder holds about 500 MB of the host's memory in
its own output buffers, which no guest memory limit bounds: macOS's
lock-screen video opened a new 4K session every few seconds without
closing the last, and five took 2.5 GB in half a minute until the host's
low-memory killer ended the VM. The hardware decoders of the process
now share a budget of two 4K pictures (CROSVM_MEDIA_DECODE_MAX_MPX
megapixels); a session past it is refused at STREAMON(OUTPUT) with
EBUSY, which a guest takes as a decoder it cannot have.

A guest's timestamps are its own (macOS's VideoToolbox host sends frame
numbers a second apart), so a codec setting its clocks by them read
1 fps and a 4K Main10 stream came out at ~25 fps: KEY_PRIORITY 0 at the
highest KEY_OPERATING_RATE, and configure retried without the two keys
where a component refuses them. KEY_MAX_INPUT_SIZE is capped at 2 MiB
(23 x 6.3 MiB of input dma-buf per 4K HEVC session before); a larger
access unit goes in over several buffers as before.
History 2026-11-04 11:20:40 -05:00
..
bitstream.rs android_codec: the MediaCodec NDK crate and codec_probe (M6, design 7.2) 2026-10-28 06:23:28 +08:00
image.rs android_codec: release_output ends the output borrow, and a bottom-up layout is refused, not indexed 2026-10-28 06:23:29 +08:00
lib.rs virtio-media: MediaCodec decoders within a pixel budget, asked to decode as fast as they can 2026-11-04 11:20:40 -05:00
probe.rs android_codec: codec_probe takes hex levels, keeps its banners off stdout, and leaves through _exit 2026-10-28 06:23:29 +08:00
synth.rs android_codec: the MediaCodec NDK crate and codec_probe (M6, design 7.2) 2026-10-28 06:23:28 +08:00