pub struct Transcoder { /* private fields */ }Expand description
A transcoder, split from the future that drives it.
Reads the source catalog, publishes the derivative catalog (rungs strictly
below the source, plus source renditions referenced via Config::source),
and serves each rung just-in-time: a rung track only materializes when a
consumer asks for it, and only encodes while consumed. Where output is
announced (and how its path relates to the source) is the caller’s business.
The split exists so a caller can attach active before any encoding
starts. run consumes the transcoder, so take the cursors you
want first.
Implementations§
Source§impl Transcoder
impl Transcoder
Sourcepub fn new(
source: Consumer,
output: Producer,
config: Config,
) -> Result<Self, Error>
pub fn new( source: Consumer, output: Producer, config: Config, ) -> Result<Self, Error>
Register the catalog tracks and the on-demand rung handler on output.
Synchronous, and everything a consumer can race is in place by the time
it returns, so announce output after this rather than before.
Sourcepub fn active(&self) -> Consumer
pub fn active(&self) -> Consumer
A cursor over the renditions this transcoder produces.
Each call returns an independent cursor, positioned before the ladder so
it reports every rendition once and everything already encoding. See
active::Consumer.