Struct webrtc::api::media_engine::MediaEngine
source · pub struct MediaEngine { /* private fields */ }
Expand description
A MediaEngine defines the codecs supported by a PeerConnection, and the configuration of those codecs. A MediaEngine must not be shared between PeerConnections.
Implementations§
source§impl MediaEngine
impl MediaEngine
sourcepub fn register_default_codecs(&mut self) -> Result<()>
pub fn register_default_codecs(&mut self) -> Result<()>
register_default_codecs registers the default codecs supported by Pion WebRTC. register_default_codecs is not safe for concurrent use.
sourcepub fn register_codec(
&mut self,
codec: RTCRtpCodecParameters,
typ: RTPCodecType
) -> Result<()>
pub fn register_codec( &mut self, codec: RTCRtpCodecParameters, typ: RTPCodecType ) -> Result<()>
register_codec adds codec to the MediaEngine These are the list of codecs supported by this PeerConnection. register_codec is not safe for concurrent use.
sourcepub fn register_header_extension(
&mut self,
extension: RTCRtpHeaderExtensionCapability,
typ: RTPCodecType,
allowed_direction: Option<RTCRtpTransceiverDirection>
) -> Result<()>
pub fn register_header_extension( &mut self, extension: RTCRtpHeaderExtensionCapability, typ: RTPCodecType, allowed_direction: Option<RTCRtpTransceiverDirection> ) -> Result<()>
Adds a header extension to the MediaEngine
To determine the negotiated value use MediaEngine::get_header_extension_id
after signaling is complete.
The allowed_direction
controls for which transceiver directions the extension matches. If
set to None
it matches all directions. The SendRecv
direction would match all transceiver
directions apart from Inactive
. Inactive only matches inactive.
sourcepub fn register_feedback(&mut self, feedback: RTCPFeedback, typ: RTPCodecType)
pub fn register_feedback(&mut self, feedback: RTCPFeedback, typ: RTPCodecType)
register_feedback adds feedback mechanism to already registered codecs.
sourcepub async fn get_header_extension_id(
&self,
extension: RTCRtpHeaderExtensionCapability
) -> (isize, bool, bool)
pub async fn get_header_extension_id( &self, extension: RTCRtpHeaderExtensionCapability ) -> (isize, bool, bool)
get_header_extension_id returns the negotiated ID for a header extension. If the Header Extension isn’t enabled ok will be false