Skip to main content

StreamOutput

Trait StreamOutput 

Source
pub trait StreamOutput: Send {
    // Required methods
    fn push_video(&mut self, frame: &VideoFrame) -> Result<(), StreamError>;
    fn push_audio(&mut self, frame: &AudioFrame) -> Result<(), StreamError>;
    fn finish(self: Box<Self>) -> Result<(), StreamError>;
}
Expand description

Common interface for all live stream outputs.

Implementors: LiveHlsOutput, LiveDashOutput, RtmpOutput, FanoutOutput.

Required Methods§

Source

fn push_video(&mut self, frame: &VideoFrame) -> Result<(), StreamError>

Push one video frame into the stream.

Source

fn push_audio(&mut self, frame: &AudioFrame) -> Result<(), StreamError>

Push one audio frame into the stream.

Source

fn finish(self: Box<Self>) -> Result<(), StreamError>

Flush all buffered data and close the output.

Consumes the boxed value so the output cannot be used after finishing.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§