pub trait Transcoder: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn renditions(&self) -> &[RenditionSpec];
fn transcode<'life0, 'async_trait>(
&'life0 mut self,
frame: MediaFrame,
) -> Pin<Box<dyn Future<Output = Result<Vec<MediaFrame>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn flush<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<MediaFrame>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Transforms frames: decode/scale/encode, packetize, or fan into renditions.
Returning a Vec lets one input frame yield several outputs (e.g. one per
ABR rung) or none (e.g. while priming an encoder).
Required Methods§
Sourcefn renditions(&self) -> &[RenditionSpec]
fn renditions(&self) -> &[RenditionSpec]
The renditions this transcoder emits.
Sourcefn transcode<'life0, 'async_trait>(
&'life0 mut self,
frame: MediaFrame,
) -> Pin<Box<dyn Future<Output = Result<Vec<MediaFrame>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transcode<'life0, 'async_trait>(
&'life0 mut self,
frame: MediaFrame,
) -> Pin<Box<dyn Future<Output = Result<Vec<MediaFrame>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process one input frame into zero or more output frames.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".