pub struct MediaSession { /* private fields */ }Expand description
A complete RTP media session with bidirectional audio.
Manages:
- Audio capture from microphone
- Encoding with the configured codec
- RTP packet transmission
- RTP packet reception
- Decoding and playback to speaker
- RTCP statistics reporting
Implementations§
Source§impl MediaSession
impl MediaSession
Sourcepub async fn start(
local_rtp_port: u16,
remote_addr: SocketAddr,
codec_type: CodecType,
) -> Result<Self>
pub async fn start( local_rtp_port: u16, remote_addr: SocketAddr, codec_type: CodecType, ) -> Result<Self>
Start a media session with the specified codec.
§Arguments
local_rtp_port- Local UDP port for RTPremote_addr- Remote RTP endpoint addresscodec_type- Audio codec to use
Sourcepub async fn start_with_srtp(
local_rtp_port: u16,
remote_addr: SocketAddr,
codec_type: CodecType,
srtp_ctx: SrtpContext,
) -> Result<Self>
pub async fn start_with_srtp( local_rtp_port: u16, remote_addr: SocketAddr, codec_type: CodecType, srtp_ctx: SrtpContext, ) -> Result<Self>
Start a media session with SRTP encryption.
Sourcepub fn remote_addr(&self) -> SocketAddr
pub fn remote_addr(&self) -> SocketAddr
Get the remote address.
Sourcepub fn learned_remote(&self) -> Option<SocketAddr>
pub fn learned_remote(&self) -> Option<SocketAddr>
Get the learned remote address (for symmetric RTP/comedia).
Trait Implementations§
Source§impl Debug for MediaSession
impl Debug for MediaSession
Auto Trait Implementations§
impl Freeze for MediaSession
impl RefUnwindSafe for MediaSession
impl Send for MediaSession
impl Sync for MediaSession
impl Unpin for MediaSession
impl UnsafeUnpin for MediaSession
impl UnwindSafe for MediaSession
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