tl;dr: It is now possible for applications to support codecs that aren’t included in the WebRTC code base, and to omit support for codecs that are included.
(This isn’t a single recent change, but rather a summary of what a bunch of recent and not-so-recent changes add up to.)
As of M63, webrtc::CreatePeerConnectionFactory() accepts audio encoder and decoder factory arguments; WebRTC will use the supplied factories when creating audio encoder and decoder objects. The point is that the factories determine the set of supported codecs; it is now possible for applications to support codecs that aren’t included in the WebRTC code base, and to omit support for codecs that are included. In the near future, omitting support for a built-in codec will also mean that the final binary will not contain the code for that codec (bug 8396).
webrtc::CreatePeerConnectionFactory() still has overloads that don’t take audio codec factory arguments, but they will soon go away. Using them is equivalent to creating factories with webrtc::CreateBuiltinAudioEncoderFactory() and webrtc::CreateBuiltinAudioEncoderFactory() and passing them to the corresponding overload that does take audio codec factory arguments.
Encoder factory examples (decoders work just the same; just replace Encoder with Decoder):
// A factory with the same old set of codecs:
webrtc::CreateBuiltinAudioEncoderFactory()
// A factory that supports only Opus and G.711:
webrtc::CreateAudioEncoderFactory<webrtc::AudioEncoderOpus,
webrtc::AudioEncoderG711>()
// A factory that supports a codec that isn’t part of the
// WebRTC code base, plus Opus and G.711:
webrtc::CreateAudioEncoderFactory<MyHomemadeAudioEncoder,
webrtc::AudioEncoderOpus,
webrtc::AudioEncoderG711>()
See also real-life examples in Chromium.
Karl Wiberg | | Software Engineer | | kwi...@google.com | | +46 70 696 1024 |