Struct webrtc::rtp_transceiver::RTCRtpTransceiver
source · pub struct RTCRtpTransceiver { /* private fields */ }
Expand description
RTPTransceiver represents a combination of an RTPSender and an RTPReceiver that share a common mid.
Implementations§
source§impl RTCRtpTransceiver
impl RTCRtpTransceiver
pub async fn new( receiver: Arc<RTCRtpReceiver>, sender: Arc<RTCRtpSender>, direction: RTCRtpTransceiverDirection, kind: RTPCodecType, codecs: Vec<RTCRtpCodecParameters>, media_engine: Arc<MediaEngine>, trigger_negotiation_needed: TriggerNegotiationNeededFnOption ) -> Arc<Self>
sourcepub async fn set_codec_preferences(
&self,
codecs: Vec<RTCRtpCodecParameters>
) -> Result<()>
pub async fn set_codec_preferences( &self, codecs: Vec<RTCRtpCodecParameters> ) -> Result<()>
set_codec_preferences sets preferred list of supported codecs if codecs is empty or nil we reset to default from MediaEngine
sourcepub async fn sender(&self) -> Arc<RTCRtpSender>
pub async fn sender(&self) -> Arc<RTCRtpSender>
sender returns the RTPTransceiver’s RTPSender if it has one
sourcepub async fn set_sender_track(
self: &Arc<Self>,
sender: Arc<RTCRtpSender>,
track: Option<Arc<dyn TrackLocal + Send + Sync>>
) -> Result<()>
pub async fn set_sender_track( self: &Arc<Self>, sender: Arc<RTCRtpSender>, track: Option<Arc<dyn TrackLocal + Send + Sync>> ) -> Result<()>
set_sender_track sets the RTPSender and Track to current transceiver
pub async fn set_sender(self: &Arc<Self>, s: Arc<RTCRtpSender>)
sourcepub async fn receiver(&self) -> Arc<RTCRtpReceiver>
pub async fn receiver(&self) -> Arc<RTCRtpReceiver>
receiver returns the RTPTransceiver’s RTPReceiver if it has one
sourcepub fn mid(&self) -> Option<SmolStr>
pub fn mid(&self) -> Option<SmolStr>
mid gets the Transceiver’s mid value. When not already set, this value will be set in CreateOffer or create_answer.
sourcepub fn kind(&self) -> RTPCodecType
pub fn kind(&self) -> RTPCodecType
kind returns RTPTransceiver’s kind.
sourcepub fn direction(&self) -> RTCRtpTransceiverDirection
pub fn direction(&self) -> RTCRtpTransceiverDirection
direction returns the RTPTransceiver’s desired direction.
sourcepub async fn set_direction(&self, d: RTCRtpTransceiverDirection)
pub async fn set_direction(&self, d: RTCRtpTransceiverDirection)
Set the direction of this transceiver. This might trigger a renegotiation.
sourcepub fn current_direction(&self) -> RTCRtpTransceiverDirection
pub fn current_direction(&self) -> RTCRtpTransceiverDirection
current_direction returns the RTPTransceiver’s current direction as negotiated.
If this transceiver has never been negotiated or if it’s stopped this returns RTCRtpTransceiverDirection::Unspecified
.