Skip to main content

FanoutOutput

Struct FanoutOutput 

Source
pub struct FanoutOutput { /* private fields */ }
Expand description

A StreamOutput wrapper that fans frames out to multiple targets.

Create with FanoutOutput::new, passing a Vec<Box<dyn StreamOutput>>. Every call to push_video, push_audio, or finish is forwarded to all targets in order.

§Failure behaviour

When one or more targets return an error, the remaining targets still receive the frame. All errors are collected and returned as a single StreamError::FanoutFailure.

Implementations§

Source§

impl FanoutOutput

Source

pub fn new(targets: Vec<Box<dyn StreamOutput>>) -> Self

Create a new fanout output that delivers frames to all targets.

§Example
use ff_stream::{FanoutOutput, LiveHlsOutput, StreamOutput};

let out = FanoutOutput::new(vec![Box::new(hls_output)]);

Trait Implementations§

Source§

impl StreamOutput for FanoutOutput

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. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.