Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: talk/media/webrtc/webrtcvideoengine2.cc

Issue 1291673006: Disallow simulcast for non-vp8. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: small unit test change (LE->EQ for stream count) Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvideoengine2.cc
diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc
index 05cd6bbcf1a582380d1c35b5aeb3dbdfb98f2b31..8a1ea82fc0edcb89d777dd636eee90ad447d6730 100644
--- a/talk/media/webrtc/webrtcvideoengine2.cc
+++ b/talk/media/webrtc/webrtcvideoengine2.cc
@@ -303,6 +303,12 @@ static void MergeFecConfig(const webrtc::FecConfig& other,
output->red_rtx_payload_type = other.red_rtx_payload_type;
}
}
+
+// Returns true if the given codec is disallowed from doing simulcast.
+bool IsCodecBlacklistedForSimulcast(const std::string& codec_name) {
+ return CodecNamesEq(codec_name, kH264CodecName);
+}
+
} // namespace
// Constants defined in talk/media/webrtc/constants.h
@@ -2099,9 +2105,17 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoderConfig(
clamped_codec.width = width;
clamped_codec.height = height;
- encoder_config.streams = CreateVideoStreams(
- clamped_codec, parameters_.options, parameters_.max_bitrate_bps,
- dimensions.is_screencast ? 1 : parameters_.config.rtp.ssrcs.size());
+ // By default, the stream count for the codec configuration should match the
+ // number of negotiated ssrcs. But if the codec is blacklisted for simulcast
+ // or a screencast, only configure a single stream.
+ size_t stream_count = parameters_.config.rtp.ssrcs.size();
+ if (IsCodecBlacklistedForSimulcast(codec.name) || dimensions.is_screencast) {
+ stream_count = 1;
+ }
+
+ encoder_config.streams =
+ CreateVideoStreams(clamped_codec, parameters_.options,
+ parameters_.max_bitrate_bps, stream_count);
// Conference mode screencast uses 2 temporal layers split at 100kbit.
if (parameters_.options.conference_mode.GetWithDefaultIfUnset(false) &&
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698