Add optional stereo codec to SDP negotiation

- Defines stereo codec case, similar to RTX, that adds stereo codec to the SDP
negotiation. The underlying codec's payload type is similarly defined by "apt".
- If this negotiation is successful, codec name is included in sdp line via
"acn".
- Adds codec setting initializers for these specific stereo cases.
- Introduces new Stereo*Factory classes as optional convenience wrappers that
inserts stereo codec to the existing set of supported codecs on demand.

This CL is the step 5 for adding alpha channel support over the wire in webrtc.
Design Doc: https://goo.gl/sFeSUT

Bug: webrtc:7671
Change-Id: Ie12c56c8fcf7934e216135d73af33adec5248f76
Reviewed-on: https://webrtc-review.googlesource.com/22901
Commit-Queue: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21210}
This commit is contained in:
Emircan Uysaler
2017-12-11 12:21:02 +05:30
committed by Commit Bot
parent 654320666d
commit 0a37547033
15 changed files with 298 additions and 26 deletions

View File

@ -39,6 +39,20 @@ bool VideoCodecInitializer::SetupCodec(
bool nack_enabled,
VideoCodec* codec,
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator) {
if (PayloadStringToCodecType(settings.payload_name) == kVideoCodecStereo) {
VideoSendStream::Config::EncoderSettings associated_codec_settings =
settings;
associated_codec_settings.payload_name =
CodecTypeToPayloadString(kVideoCodecVP9);
if (!SetupCodec(config, associated_codec_settings, streams, nack_enabled,
codec, bitrate_allocator)) {
RTC_LOG(LS_ERROR) << "Failed to create stereo encoder configuration.";
return false;
}
codec->codecType = kVideoCodecStereo;
return true;
}
*codec =
VideoEncoderConfigToVideoCodec(config, streams, settings.payload_name,
settings.payload_type, nack_enabled);