Index: webrtc/modules/video_coding/video_codec_initializer.cc |
diff --git a/webrtc/modules/video_coding/video_codec_initializer.cc b/webrtc/modules/video_coding/video_codec_initializer.cc |
index c759e84a36d8bd19db81cff0af6e291d2f204daa..7917a2789c6fbdef98589c984181334ccf951520 100644 |
--- a/webrtc/modules/video_coding/video_codec_initializer.cc |
+++ b/webrtc/modules/video_coding/video_codec_initializer.cc |
@@ -30,9 +30,9 @@ bool VideoCodecInitializer::SetupCodec( |
bool nack_enabled, |
VideoCodec* codec, |
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator) { |
- *codec = |
- VideoEncoderConfigToVideoCodec(config, streams, settings.payload_name, |
- settings.payload_type, nack_enabled); |
+ *codec = VideoEncoderConfigToVideoCodec( |
+ config, streams, settings.payload_name, settings.payload_type, |
+ settings.stereo_associated_payload_name, nack_enabled); |
std::unique_ptr<TemporalLayersFactory> tl_factory; |
switch (codec->codecType) { |
@@ -88,6 +88,7 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec( |
const std::vector<VideoStream>& streams, |
const std::string& payload_name, |
int payload_type, |
+ const std::string& stereo_associated_payload_name, |
bool nack_enabled) { |
static const int kEncoderMinBitrateKbps = 30; |
RTC_DCHECK(!streams.empty()); |
@@ -98,6 +99,13 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec( |
video_codec.codecType = PayloadNameToCodecType(payload_name) |
.value_or(VideoCodecType::kVideoCodecGeneric); |
+ const bool is_stereo_codec = video_codec.codecType == kVideoCodecStereo; |
+ if (is_stereo_codec) { |
+ video_codec.codecType = |
+ PayloadNameToCodecType(stereo_associated_payload_name) |
+ .value_or(VideoCodecType::kVideoCodecGeneric); |
+ } |
+ |
switch (config.content_type) { |
case VideoEncoderConfig::ContentType::kRealtimeVideo: |
video_codec.mode = kRealtimeVideo; |
@@ -227,6 +235,10 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec( |
RTC_DCHECK_GT(streams[0].max_framerate, 0); |
video_codec.maxFramerate = streams[0].max_framerate; |
+ |
+ if (is_stereo_codec) |
+ video_codec.codecType = kVideoCodecStereo; |
+ |
return video_codec; |
} |