Skip to main content

DEFAULT_MAX_FRAME_BYTES

Constant DEFAULT_MAX_FRAME_BYTES 

Source
pub const DEFAULT_MAX_FRAME_BYTES: usize = _; // 536_870_912usize
Expand description

Default ceiling on the bytes one decoded frame may export — 512 MiB.

Why this number. Pixels alone do not bound the copy: bit depth, plane count and stride padding all multiply it. The widest realistic frame is 8K 4:4:4 16-bit with alpha (7680×4320×8 bytes ≈ 253 MiB); 8K P010 is ~96 MiB and 4K P010 ~24 MiB. 512 MiB clears the worst of those by 2× and still bounds a single frame to something a process can survive.

Checked against the sum of what the planes will actually export — after the stride decision, so it is the number this crate is about to allocate rather than an estimate of it.