Struct webrtc::rtp_transceiver::rtp_sender::RTCRtpSender
source · pub struct RTCRtpSender { /* private fields */ }
Expand description
RTPSender allows an application to control how a given Track is encoded and transmitted to a remote peer
Implementations§
source§impl RTCRtpSender
impl RTCRtpSender
pub async fn new( receive_mtu: usize, track: Option<Arc<dyn TrackLocal + Send + Sync>>, transport: Arc<RTCDtlsTransport>, media_engine: Arc<MediaEngine>, interceptor: Arc<dyn Interceptor + Send + Sync>, start_paused: bool ) -> Self
sourcepub fn transport(&self) -> Arc<RTCDtlsTransport>
pub fn transport(&self) -> Arc<RTCDtlsTransport>
transport returns the currently-configured DTLSTransport if one has not yet been configured
sourcepub async fn get_parameters(&self) -> RTCRtpSendParameters
pub async fn get_parameters(&self) -> RTCRtpSendParameters
get_parameters describes the current configuration for the encoding and transmission of media on the sender’s track.
sourcepub async fn track(&self) -> Option<Arc<dyn TrackLocal + Send + Sync>>
pub async fn track(&self) -> Option<Arc<dyn TrackLocal + Send + Sync>>
track returns the RTCRtpTransceiver track, or nil
sourcepub async fn replace_track(
&self,
track: Option<Arc<dyn TrackLocal + Send + Sync>>
) -> Result<()>
pub async fn replace_track( &self, track: Option<Arc<dyn TrackLocal + Send + Sync>> ) -> Result<()>
replace_track replaces the track currently being used as the sender’s source with a new TrackLocal. The new track must be of the same media kind (audio, video, etc) and switching the track should not require negotiation.
sourcepub async fn send(&self, parameters: &RTCRtpSendParameters) -> Result<()>
pub async fn send(&self, parameters: &RTCRtpSendParameters) -> Result<()>
send Attempts to set the parameters controlling the sending of media.
sourcepub async fn read(
&self,
b: &mut [u8]
) -> Result<(Vec<Box<dyn Packet + Send + Sync>>, Attributes)>
pub async fn read( &self, b: &mut [u8] ) -> Result<(Vec<Box<dyn Packet + Send + Sync>>, Attributes)>
read reads incoming RTCP for this RTPReceiver
sourcepub async fn read_rtcp(
&self
) -> Result<(Vec<Box<dyn Packet + Send + Sync>>, Attributes)>
pub async fn read_rtcp( &self ) -> Result<(Vec<Box<dyn Packet + Send + Sync>>, Attributes)>
read_rtcp is a convenience method that wraps Read and unmarshals for you.
sourcepub fn enable_seq_transformer(&self) -> Result<()>
pub fn enable_seq_transformer(&self) -> Result<()>
Enables overriding outgoing RTP
packets’ sequence number
s.
Must be called once before any data sent or never called at all.
§Errors
Errors if this RTCRtpSender
has started to send data or sequence
transforming has been already enabled.