Skip to main content

Module decode_pump

Module decode_pump 

Source
Expand description

Shared source decode pump.

One pump per job (not per rung): demux + decode the source once, run the rung-agnostic per-frame work (4:4:4 → 4:2:0 downsample + HDR tonemap), and fan the normalized frame out to N per-rung mpsc channels via cheap VideoFrame::clone() (the inner Bytes is Arc-backed).

Per-rung scaling + encoding consume from those channels. Eliminating the redundant per-rung decode is the whole point — a 5-rung ladder decodes the source once, not five times. The cost: the slowest rung backpressures the pump (usually the largest rung, whose encoder is slowest).

Structs§

DecodePumpConfig
Configuration for one decode pump.

Functions§

run_shared_decode_pump_blocking
Blocking decode loop, designed for tokio::task::spawn_blocking. Fans every normalized frame out to all senders. If a sender’s channel is closed (its rung gave up) the pump continues with the rest; it stops only when every sender is closed. rt bridges into the async send().await.