Expand description
Job progress reporting.
Every transcode job reports progress through a ProgressSink — a small
trait that receives a uniform RungProgress struct (status,
percentage, frame/segment/byte counters) for each rung as the job runs,
plus coarse JobEvents for job-level lifecycle.
The sink methods are synchronous but are called as the job progresses
(i.e. asynchronously with respect to completion). To bridge into async
code — e.g. forward progress to a websocket/SQS reporter — wrap a
tokio::sync::mpsc::Sender with channel_sink, or implement
ProgressSink and try_send into your own channel.
Structs§
- Channel
Sink - A sink that forwards every
RungProgressinto a Tokio mpsc channel, turning the callback into an async stream the caller can.recv().await. Sends are non-blocking (try_send); if the channel is full or closed the update is dropped (progress is advisory, never load-bearing). - FnSink
- Wraps a closure as a
ProgressSink. - Null
Sink - A sink that drops every update. Useful as a default.
- Rung
Progress - A uniform progress update for one rung. Emitted repeatedly over the life of the job. Consumers can render a per-rung progress bar straight from these fields without knowing anything about the output mode.
Enums§
- JobEvent
- Job-level lifecycle events, independent of any single rung.
- Rung
Status - Lifecycle status of a single rung (one rendition of the ABR ladder).
Traits§
- Progress
Sink - Receiver for job progress. Implement to consume updates; or use
channel_sink/fn_sinkfor the common cases.
Functions§
- channel_
sink - Convenience: wrap an mpsc sender as an
Arc<dyn ProgressSink>. - fn_sink
- Build a
ProgressSinkfrom a closure:fn_sink(|p| println!("{}", p.percent)).