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
impl ActiveSpeakerObserver
Sourcepub fn on_dominant_speaker<F: Fn(&ActiveSpeakerObserverDominantSpeaker) + Send + Sync + 'static>(
&self,
callback: F,
) -> HandlerId
pub fn on_dominant_speaker<F: Fn(&ActiveSpeakerObserverDominantSpeaker) + Send + Sync + 'static>( &self, callback: F, ) -> HandlerId
Callback is called at most every interval (see ActiveSpeakerObserverOptions
).
Sourcepub fn downgrade(&self) -> WeakActiveSpeakerObserver
pub fn downgrade(&self) -> WeakActiveSpeakerObserver
Downgrade ActiveSpeakerObserver
to WeakActiveSpeakerObserver
instance.
Trait Implementations§
Source§impl Clone for ActiveSpeakerObserver
impl Clone for ActiveSpeakerObserver
Source§fn clone(&self) -> ActiveSpeakerObserver
fn clone(&self) -> ActiveSpeakerObserver
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ActiveSpeakerObserver
impl Debug for ActiveSpeakerObserver
Source§impl RtpObserver for ActiveSpeakerObserver
impl RtpObserver for ActiveSpeakerObserver
Source§fn id(&self) -> RtpObserverId
fn id(&self) -> RtpObserverId
RtpObserver id.
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,
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,
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,
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,
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
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
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
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
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.
Auto Trait Implementations§
impl Freeze for ActiveSpeakerObserver
impl !RefUnwindSafe for ActiveSpeakerObserver
impl Send for ActiveSpeakerObserver
impl Sync for ActiveSpeakerObserver
impl Unpin for ActiveSpeakerObserver
impl !UnwindSafe for ActiveSpeakerObserver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more