Skip to main content

DynMuxer

Trait DynMuxer 

Source
pub trait DynMuxer {
    // Required methods
    fn begin(
        &mut self,
        tracks: &[TrackInfo],
        hint: MuxHint,
    ) -> Result<MuxTiming, SessionError<ErasedError>>;
    fn write_packet(
        &mut self,
        packet: Packet,
        pulse: Option<&dyn Pulse>,
    ) -> Result<(), SessionError<ErasedError>>;
    fn pending_output(&self) -> &[u8] ⓘ;
    fn consume_output(&mut self, n: usize);
    fn take_output(&mut self, into: &mut Vec<u8>);
    fn finish(
        self: Box<Self>,
        pulse: Option<&dyn Pulse>,
    ) -> Result<MuxFinish, SessionError<ErasedError>>;

    // Provided method
    fn begin_exact_timing(
        &mut self,
        tracks: &[TrackInfo],
        hint: MuxHint,
    ) -> Result<MuxTiming, SessionError<ErasedError>> { ... }
}
Expand description

Object-safe muxer (finish by box), the DynAnimationFrameEncoder pattern.

Required Methods§

Source

fn begin( &mut self, tracks: &[TrackInfo], hint: MuxHint, ) -> Result<MuxTiming, SessionError<ErasedError>>

Source

fn write_packet( &mut self, packet: Packet, pulse: Option<&dyn Pulse>, ) -> Result<(), SessionError<ErasedError>>

Source

fn pending_output(&self) -> &[u8] ⓘ

Source

fn consume_output(&mut self, n: usize)

Source

fn take_output(&mut self, into: &mut Vec<u8>)

Source

fn finish( self: Box<Self>, pulse: Option<&dyn Pulse>, ) -> Result<MuxFinish, SessionError<ErasedError>>

Provided Methods§

Source

fn begin_exact_timing( &mut self, tracks: &[TrackInfo], hint: MuxHint, ) -> Result<MuxTiming, SessionError<ErasedError>>

See Muxer::begin_exact_timing. Default refuses without calling begin.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§