#[non_exhaustive]pub struct Config {
pub kind: Kind,
pub latency_max: Option<Duration>,
pub resize: Option<Size>,
pub gpu_frames: bool,
}Expand description
Decoder configuration.
#[non_exhaustive]: build via Config::new (or default()) and set the
optional fields, so future knobs don’t break callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: KindWhich backend to use.
latency_max: Option<Duration>Upper bound on buffering before a stalled group is skipped. None uses
the moq-mux default (skip aggressively); set it to your playout buffer for
a softer skip. Forwarded to the container consumer’s with_latency.
resize: Option<Size>Ask the decoder to emit frames at this size (both dimensions even) instead
of the stream’s native one. Best effort: a hardware decoder with a
built-in scaler (NVDEC) honors it for free, other backends ignore it.
Check each Frame’s dimensions and scale the remainder
yourself.
gpu_frames: boolAsk the decoder to leave each picture on the GPU, as the surface the hardware decoded it into, rather than downloading it to CPU memory.
For a consumer that draws the frames, render::Renderer imports such a
surface directly, so the picture never touches system memory. Off by
default because it is not free to a consumer that does not draw: handing a
surface out retires it from the decoder’s recycling pool, which costs an
allocation per picture, and a CPU consumer then pays the download it would
have paid anyway.
Best effort, like resize: only the VAAPI backend honors
it today and the others ignore it, so match on each
Frame’s surface rather than assuming. A frame that does
come back GPU-resident still answers
Surface::into_i420, so nothing downstream
breaks on it.