mediasoup::rtp_observer

Trait RtpObserver

Source
pub trait RtpObserver {
Show 15 methods // Required methods fn id(&self) -> RtpObserverId; fn router(&self) -> &Router; fn paused(&self) -> bool; fn app_data(&self) -> &AppData; fn closed(&self) -> bool; fn pause<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn resume<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn add_producer<'life0, 'async_trait>( &'life0 self, rtp_observer_add_producer_options: RtpObserverAddProducerOptions, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn remove_producer<'life0, 'async_trait>( &'life0 self, producer_id: ProducerId, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn on_pause( &self, callback: Box<dyn Fn() + Send + Sync + 'static>, ) -> HandlerId; fn on_resume( &self, callback: Box<dyn Fn() + Send + Sync + 'static>, ) -> HandlerId; fn on_add_producer( &self, callback: Box<dyn Fn(&Producer) + Send + Sync + 'static>, ) -> HandlerId; fn on_remove_producer( &self, callback: Box<dyn Fn(&Producer) + Send + Sync + 'static>, ) -> HandlerId; fn on_router_close( &self, callback: Box<dyn FnOnce() + Send + 'static>, ) -> HandlerId; fn on_close( &self, callback: Box<dyn FnOnce() + Send + 'static>, ) -> HandlerId;
}
Expand description

An RTP observer inspects the media received by a set of selected producers.

mediasoup implements the following RTP observers:

Required Methods§

Source

fn id(&self) -> RtpObserverId

RtpObserver id.

Source

fn router(&self) -> &Router

Router to which RTP observer belongs.

Source

fn paused(&self) -> bool

Whether the RtpObserver is paused.

Source

fn app_data(&self) -> &AppData

Custom application data.

Source

fn closed(&self) -> bool

Whether the RTP observer is closed.

Source

fn pause<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Pauses the RTP observer. No RTP is inspected until resume() is called.

Source

fn resume<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Resumes the RTP observer. RTP is inspected again.

Source

fn add_producer<'life0, 'async_trait>( &'life0 self, rtp_observer_add_producer_options: RtpObserverAddProducerOptions, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provides the RTP observer with a new producer to monitor.

Source

fn remove_producer<'life0, 'async_trait>( &'life0 self, producer_id: ProducerId, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes the given producer from the RTP observer.

Source

fn on_pause(&self, callback: Box<dyn Fn() + Send + Sync + 'static>) -> HandlerId

Callback is called when the RTP observer is paused.

Source

fn on_resume( &self, callback: Box<dyn Fn() + Send + Sync + 'static>, ) -> HandlerId

Callback is called when the RTP observer is resumed.

Source

fn on_add_producer( &self, callback: Box<dyn Fn(&Producer) + Send + Sync + 'static>, ) -> HandlerId

Callback is called when a new producer is added into the RTP observer.

Source

fn on_remove_producer( &self, callback: Box<dyn Fn(&Producer) + Send + Sync + 'static>, ) -> HandlerId

Callback is called when a producer is removed from the RTP observer.

Source

fn on_router_close( &self, callback: Box<dyn FnOnce() + Send + 'static>, ) -> HandlerId

Callback is called when the router this RTP observer belongs to is closed for whatever reason. The RTP observer itself is also closed.

Source

fn on_close(&self, callback: Box<dyn FnOnce() + Send + 'static>) -> HandlerId

Callback is called when the RTP observer is closed for whatever reason.

NOTE: Callback will be called in place if observer is already closed.

Implementors§