Skip to main content

FrameSource

Trait FrameSource 

Source
pub trait FrameSource: Send {
    // Required method
    fn next<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<MediaFrame>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn replay(&mut self) -> Vec<MediaFrame> { ... }
}
Expand description

A transport-generic source of frames for the shared mirror loop (mirror). Both relays mirror the same way — replay the instant-start GOP, then forward live frames — differing only in where the frames come from: an in-process StreamHandle subscription, or a TCP read_record loop in the network relay. Implement this for the transport and call mirror instead of hand-copying the loop.

Required Methods§

Source

fn next<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<MediaFrame>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The next live frame, or None when the source has ended.

Provided Methods§

Source

fn replay(&mut self) -> Vec<MediaFrame>

Frames to replay immediately for instant start (the origin’s cached GOP), in order. Defaults to none.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§