pub struct MediaStream {
pub cancel_token: CancellationToken,
pub packet_sender: TrackPacketSender,
/* private fields */
}Fields§
§cancel_token: CancellationToken§packet_sender: TrackPacketSenderImplementations§
Source§impl MediaStream
impl MediaStream
pub async fn serve(&self) -> Result<()>
Sourcepub async fn ensure_ambiance(
&self,
option: AmbianceOption,
source_track_id: TrackId,
) -> Result<Option<Arc<StdMutex<AmbianceProcessor>>>>
pub async fn ensure_ambiance( &self, option: AmbianceOption, source_track_id: TrackId, ) -> Result<Option<Arc<StdMutex<AmbianceProcessor>>>>
Load ambiance once per call and keep mixing it while TTS/file playback is silent.
pub fn stop(&self, _reason: Option<String>, _initiator: Option<String>)
pub async fn cleanup(&self) -> Result<()>
pub async fn track_count(&self) -> usize
Sourcepub fn set_bridge_peer(&self, peer: Option<&Arc<MediaStream>>)
pub fn set_bridge_peer(&self, peer: Option<&Arc<MediaStream>>)
Record the stream this one is bridged to (None when unbridged). A
new bridge ends recordings adopted from a previous peer: that call is
over and this leg now talks to someone else.
Sourcepub fn clear_bridge_peer(&self, peer_id: &str)
pub fn clear_bridge_peer(&self, peer_id: &str)
Clear the bridge peer if it is peer_id.
pub async fn update_recorder_option(&self, recorder_config: RecorderOption)
Sourcepub async fn enable_monitor(&self) -> MonitorHub
pub async fn enable_monitor(&self) -> MonitorHub
Create the session’s monitor hub on first use and return it. Idempotent.
Sourcepub async fn monitor_hub(&self) -> Option<MonitorHub>
pub async fn monitor_hub(&self) -> Option<MonitorHub>
The session’s monitor hub, if enable_monitor was called.
Sourcepub async fn has_live_track(&self, id: &TrackId) -> bool
pub async fn has_live_track(&self, id: &TrackId) -> bool
Whether a track that has not ended is registered under id.
pub async fn remove_track(&self, id: &TrackId, graceful: bool)
pub async fn update_remote_description( &self, track_id: &TrackId, answer: &String, ) -> Result<()>
pub async fn update_remote_description_force( &self, track_id: &TrackId, answer: &String, ) -> Result<()>
Sourcepub async fn update_remote_description_provisional(
&self,
track_id: &TrackId,
answer: &String,
) -> Result<()>
pub async fn update_remote_description_provisional( &self, track_id: &TrackId, answer: &String, ) -> Result<()>
Apply a provisional remote description (SIP 183 early media). See
Track::update_remote_description_provisional.
pub async fn handshake( &self, track_id: &TrackId, offer: String, timeout: Option<Duration>, ) -> Result<String>
pub async fn update_track(&self, track: Box<dyn Track>, play_id: Option<String>)
pub async fn mute_track(&self, id: Option<TrackId>)
pub async fn unmute_track(&self, id: Option<TrackId>)
Sourcepub async fn renegotiate(&self, offer: String) -> Result<String>
pub async fn renegotiate(&self, offer: String) -> Result<String>
Apply a new remote offer to the session’s own (WebRTC) track without recreating it, e.g. for an ICE restart, and return the new answer.
Sourcepub async fn on_answered(
&self,
track_id: &TrackId,
rtp_timeout: Option<Duration>,
)
pub async fn on_answered( &self, track_id: &TrackId, rtp_timeout: Option<Duration>, )
See Track::on_answered.
Sourcepub async fn add_ice_candidate(
&self,
candidate: &str,
sdp_mid: Option<&str>,
sdp_mline_index: Option<u32>,
) -> Result<()>
pub async fn add_ice_candidate( &self, candidate: &str, sdp_mid: Option<&str>, sdp_mline_index: Option<u32>, ) -> Result<()>
Trickle ICE: feed a remote candidate into the ICE-backed (WebRTC)
track, if it’s up yet, or buffer it for update_track to replay
otherwise.
pub async fn pause_playback(&self, id: TrackId) -> Result<()>
pub async fn resume_playback(&self, id: TrackId) -> Result<()>
pub async fn hold_track(&self, id: Option<TrackId>)
pub async fn resume_track(&self, id: Option<TrackId>)
pub async fn suppress_forwarding(&self, track_id: &TrackId)
pub async fn resume_forwarding(&self, track_id: &TrackId)
pub async fn remove_processor<T: 'static>( &self, track_id: &TrackId, ) -> Result<()>
pub async fn append_processor( &self, track_id: &TrackId, processor: Box<dyn Processor>, ) -> Result<()>
Source§impl MediaStream
impl MediaStream
pub async fn start_recorder(&self) -> Result<()>
pub async fn set_track_refer(&self, track_id: &TrackId, refer: Option<bool>)
pub async fn set_track_dtmf_forward(&self, track_id: &TrackId, forward: bool)
Trait Implementations§
Source§impl Drop for MediaStream
impl Drop for MediaStream
Auto Trait Implementations§
impl !Freeze for MediaStream
impl !RefUnwindSafe for MediaStream
impl !UnwindSafe for MediaStream
impl Forget for MediaStream
impl Move for MediaStream
impl Send for MediaStream
impl Sync for MediaStream
impl Unpin for MediaStream
impl UnsafeUnpin for MediaStream
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more