mediasoup::active_speaker_observer

Struct ActiveSpeakerObserver

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

An active speaker observer monitors the volume of the selected audio producers.

It just handles audio producers (if ActiveSpeakerObserver::add_producer() is called with a video producer it will fail).

Audio levels are read from an RTP header extension. No decoding of audio data is done. See RFC6464 for more information.

Implementations§

Source§

impl ActiveSpeakerObserver

Source

pub fn on_dominant_speaker<F: Fn(&ActiveSpeakerObserverDominantSpeaker) + Send + Sync + 'static>( &self, callback: F, ) -> HandlerId

Callback is called at most every interval (see ActiveSpeakerObserverOptions).

Source

pub fn downgrade(&self) -> WeakActiveSpeakerObserver

Downgrade ActiveSpeakerObserver to WeakActiveSpeakerObserver instance.

Trait Implementations§

Source§

impl Clone for ActiveSpeakerObserver

Source§

fn clone(&self) -> ActiveSpeakerObserver

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActiveSpeakerObserver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RtpObserver for ActiveSpeakerObserver

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, __arg1: 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. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.