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
sourceimpl RTCRtpTransceiver
impl RTCRtpTransceiver
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) -> Option<Arc<RTCRtpSender>>
pub async fn sender(&self) -> Option<Arc<RTCRtpSender>>
sender returns the RTPTransceiver’s RTPSender if it has one
sourcepub async fn set_sender_track(
self: &Arc<Self>,
sender: Option<Arc<RTCRtpSender>>,
track: Option<Arc<dyn TrackLocal + Send + Sync>>
) -> Result<()>
pub async fn set_sender_track(
self: &Arc<Self>,
sender: Option<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: Option<Arc<RTCRtpSender>>)
sourcepub async fn receiver(&self) -> Option<Arc<RTCRtpReceiver>>
pub async fn receiver(&self) -> Option<Arc<RTCRtpReceiver>>
receiver returns the RTPTransceiver’s RTPReceiver if it has one
sourcepub async fn mid(&self) -> String
pub async fn mid(&self) -> String
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
.