Skip to main content

Transcoder

Trait Transcoder 

Source
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§

Source

fn id(&self) -> &str

Stable identifier (e.g. "nvenc-abr").

Source

fn renditions(&self) -> &[RenditionSpec]

The renditions this transcoder emits.

Source

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§

Source

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,

Flush any buffered output at end-of-stream.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§