pub struct RtpSender { /* private fields */ }Implementations§
Source§impl RtpSender
impl RtpSender
pub fn builder(track: Arc<dyn MediaStreamTrack>, ssrc: u32) -> RtpSenderBuilder
pub fn new( track: Arc<dyn MediaStreamTrack>, ssrc: u32, stream_id: String, params: RtpCodecParameters, interceptors: Vec<Arc<dyn RtpSenderInterceptor + Send + Sync>>, ) -> Self
pub fn ssrc(&self) -> u32
Sourcepub fn next_sequence_number(&self) -> u16
pub fn next_sequence_number(&self) -> u16
Next sequence number the paced send loop will put on the wire.
Sourcepub fn last_rtp_timestamp(&self) -> u32
pub fn last_rtp_timestamp(&self) -> u32
RTP timestamp of the last packet this sender (or an external writer
via Self::note_external_packet) put on the wire.
Sourcepub fn packets_sent(&self) -> u32
pub fn packets_sent(&self) -> u32
Packets counted for RTCP SR (paced send + Self::note_external_packet).
Sourcepub fn note_external_packet(
&self,
sequence_number: u16,
timestamp: u32,
payload_len: u32,
)
pub fn note_external_packet( &self, sequence_number: u16, timestamp: u32, payload_len: u32, )
Record a packet that left on this SSRC outside the paced send loop
(typically the RTP rewrite bridge). Keeps RTCP Sender Reports and the
next paced sequence/timestamp coherent when IVR and fast-path share
the SDP/a=ssrc stream.
pub fn cname(&self) -> &str
Sourcepub fn transport(&self) -> Option<Arc<RtpTransport>>
pub fn transport(&self) -> Option<Arc<RtpTransport>>
The RTP transport this sender writes to (the per-media transport, set
on negotiation). None until the transport is wired.
pub fn track_id(&self) -> &str
pub fn stream_id(&self) -> &str
pub fn set_sdes_mid(&self, ext_id: u8, mid: Arc<str>)
pub fn sdes_mid(&self) -> Option<(u8, Arc<str>)>
pub fn subscribe_rtcp(&self) -> Receiver<RtcpPacket>
pub fn params(&self) -> RtpCodecParameters
pub fn set_params(&self, params: RtpCodecParameters)
pub fn interceptors(&self) -> &[Arc<dyn RtpSenderInterceptor + Send + Sync>]
pub fn nack_handler(&self) -> Option<Arc<dyn NackStats>>
Sourcepub fn set_rtx(&self, config: Option<RtxSenderConfig>) -> bool
pub fn set_rtx(&self, config: Option<RtxSenderConfig>) -> bool
Configure RFC 4588 RTX retransmission on the sender NACK interceptor.
Pass None to fall back to plain clone-resend of original packets.
Returns true when an RTX-capable NACK handler was found and updated,
false if no attached interceptor implements RTX (the call is a no-op
in that case, e.g. a custom sender without DefaultRtpSenderNackHandler).