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§
Sourcefn id(&self) -> RtpObserverId
fn id(&self) -> RtpObserverId
RtpObserver id.
Sourcefn pause<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
Sourcefn resume<'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,
Resumes the RTP observer. RTP is inspected again.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn on_pause(&self, callback: Box<dyn Fn() + Send + Sync + 'static>) -> HandlerId
fn on_pause(&self, callback: Box<dyn Fn() + Send + Sync + 'static>) -> HandlerId
Callback is called when the RTP observer is paused.
Sourcefn on_resume(
&self,
callback: Box<dyn Fn() + Send + Sync + 'static>,
) -> HandlerId
fn on_resume( &self, callback: Box<dyn Fn() + Send + Sync + 'static>, ) -> HandlerId
Callback is called when the RTP observer is resumed.
Sourcefn on_add_producer(
&self,
callback: Box<dyn Fn(&Producer) + Send + Sync + 'static>,
) -> HandlerId
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.
Sourcefn on_remove_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
Callback is called when a producer is removed from the RTP observer.