Overview
MediaEngine defines the codecs supported by a PeerConnection, and the configuration of those codecs. It manages codec registration, negotiation, and header extension configuration.Type Definition
Methods
RegisterDefaultCodecs
Registers the default codecs supported by Pion WebRTC.error
Returns error if codec registration fails
RegisterCodec
Adds a codec to the MediaEngine. These are the list of codecs supported by this PeerConnection.RTPCodecParameters
required
The codec parameters to register
RTPCodecType
required
The codec type (RTPCodecTypeAudio or RTPCodecTypeVideo)
error
Returns error if codec with same payload type already registered or invalid type
RegisterHeaderExtension
Adds a header extension to the MediaEngine. To determine the negotiated value use GetHeaderExtensionID after signaling is complete.RTPHeaderExtensionCapability
required
The header extension capability to register
RTPCodecType
required
The codec type (audio or video)
...RTPTransceiverDirection
Optional list of allowed transceiver directions. Defaults to sendonly and recvonly.
error
Returns error if direction is invalid (must be sendonly or recvonly)
RegisterFeedback
Adds feedback mechanism to already registered codecs.RTCPFeedback
required
The RTCP feedback to add
RTPCodecType
required
The codec type to add feedback to
Usage Examples
Custom Codec Configuration
VP8 Only Configuration
Registering Header Extensions
Multiple Codec Negotiation
Audio-Only Configuration
Common Header Extension URIs
See Also
- RTPTransceiver - Uses MediaEngine for codec negotiation
- API - Created with MediaEngine using WithMediaEngine option
- RTPCodecParameters - Codec parameter structure