pub trait TranscoderFactory:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &str;
fn rendition(&self) -> &RenditionSpec;
fn build(&self, ctx: &TranscoderContext) -> Option<Box<dyn Transcoder>>;
}Expand description
Factory that builds a Transcoder for one specific
rendition of one specific (broadcast, track) stream.
One factory instance per rendition: for an ABR ladder of three
rungs the caller registers three factory instances on the
crate::TranscodeRunner, each carrying its own
RenditionSpec. The factory either returns a fresh
Box<dyn Transcoder> (one instance per source stream the
factory opts into) or None to skip this stream.
Send + Sync + 'static so the factory lives behind an Arc
shared across the registry callback’s worker thread.
Required Methods§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
Stable identifier used in metric labels and logs (e.g.
"passthrough", "x264", "nvenc"). Pick something
short, lowercase, snake_case.
Sourcefn rendition(&self) -> &RenditionSpec
fn rendition(&self) -> &RenditionSpec
Target rendition this factory produces. Consumed by the
crate::TranscodeRunner when building the
TranscoderContext.
Sourcefn build(&self, ctx: &TranscoderContext) -> Option<Box<dyn Transcoder>>
fn build(&self, ctx: &TranscoderContext) -> Option<Box<dyn Transcoder>>
Build a fresh transcoder for ctx, or return None to
skip this (broadcast, track) entirely. Returning None
is the correct path when the factory wants to opt out –
e.g. a video transcoder returning None for an audio
track, or a factory targeting only source broadcasts (not
already-transcoded renditions).