Trait mediasoup::rtp_observer::RtpObserver[][src]

pub trait RtpObserver {
    fn id(&self) -> RtpObserverId;
fn paused(&self) -> bool;
fn app_data(&self) -> &AppData;
fn closed(&self) -> bool;
#[must_use] fn pause<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn resume<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn add_producer<'life0, 'async_trait>(
        &'life0 self,
        rtp_observer_add_producer_options: RtpObserverAddProducerOptions
    ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn remove_producer<'life0, 'async_trait>(
        &'life0 self,
        producer_id: ProducerId
    ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: '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; }

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

mediasoup implements the following RTP observers:

Required methods

fn id(&self) -> RtpObserverId[src]

RtpObserver id.

fn paused(&self) -> bool[src]

Whether the RtpObserver is paused.

fn app_data(&self) -> &AppData[src]

Custom application data.

fn closed(&self) -> bool[src]

Whether the RTP observer is closed.

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

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

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

Resumes the RTP observer. RTP is inspected again.

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

Provides the RTP observer with a new producer to monitor.

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

Removes the given producer from the RTP observer.

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

Callback is called when the RTP observer is paused.

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

Callback is called when the RTP observer is resumed.

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

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

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

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

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

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

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

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

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

Loading content...

Implementors

impl RtpObserver for AudioLevelObserver[src]

Loading content...