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

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 2997363002: Add experiment to disable ulpfec. (Closed)
Patch Set: Cleanup Created 3 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include "webrtc/video/video_send_stream.h" 10 #include "webrtc/video/video_send_stream.h"
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 const bool nack_enabled = config_->rtp.nack.rtp_history_ms > 0; 980 const bool nack_enabled = config_->rtp.nack.rtp_history_ms > 0;
981 int red_payload_type = config_->rtp.ulpfec.red_payload_type; 981 int red_payload_type = config_->rtp.ulpfec.red_payload_type;
982 int ulpfec_payload_type = config_->rtp.ulpfec.ulpfec_payload_type; 982 int ulpfec_payload_type = config_->rtp.ulpfec.ulpfec_payload_type;
983 983
984 // Shorthands. 984 // Shorthands.
985 auto IsRedEnabled = [&]() { return red_payload_type >= 0; }; 985 auto IsRedEnabled = [&]() { return red_payload_type >= 0; };
986 auto DisableRed = [&]() { red_payload_type = -1; }; 986 auto DisableRed = [&]() { red_payload_type = -1; };
987 auto IsUlpfecEnabled = [&]() { return ulpfec_payload_type >= 0; }; 987 auto IsUlpfecEnabled = [&]() { return ulpfec_payload_type >= 0; };
988 auto DisableUlpfec = [&]() { ulpfec_payload_type = -1; }; 988 auto DisableUlpfec = [&]() { ulpfec_payload_type = -1; };
989 989
990 if (webrtc::field_trial::IsEnabled("WebRTC-DisableUlpFecExperiment")) {
991 LOG(LS_INFO) << "Experiment to disable FlexFEC is enabled.";
brandtr 2017/08/23 14:10:44 FlexFEC -> Ulpfec. For clarity, mention that we o
stefan-webrtc 2017/08/23 14:27:08 Done.
992 DisableUlpfec();
993 }
994
990 // If enabled, FlexFEC takes priority over RED+ULPFEC. 995 // If enabled, FlexFEC takes priority over RED+ULPFEC.
991 if (flexfec_enabled) { 996 if (flexfec_enabled) {
992 // We can safely disable RED here, because if the remote supports FlexFEC, 997 // We can safely disable RED here, because if the remote supports FlexFEC,
993 // we know that it has a receiver without the RED/RTX workaround. 998 // we know that it has a receiver without the RED/RTX workaround.
994 // See http://crbug.com/webrtc/6650 for more information. 999 // See http://crbug.com/webrtc/6650 for more information.
995 if (IsRedEnabled()) { 1000 if (IsRedEnabled()) {
996 LOG(LS_INFO) << "Both FlexFEC and RED are configured. Disabling RED."; 1001 LOG(LS_INFO) << "Both FlexFEC and RED are configured. Disabling RED.";
997 DisableRed(); 1002 DisableRed();
998 } 1003 }
999 if (IsUlpfecEnabled()) { 1004 if (IsUlpfecEnabled()) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 DisableUlpfec(); 1043 DisableUlpfec();
1039 } 1044 }
1040 } 1045 }
1041 1046
1042 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 1047 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
1043 // Set NACK. 1048 // Set NACK.
1044 rtp_rtcp->SetStorePacketsStatus( 1049 rtp_rtcp->SetStorePacketsStatus(
1045 true, 1050 true,
1046 kMinSendSidePacketHistorySize); 1051 kMinSendSidePacketHistorySize);
1047 // Set RED/ULPFEC information. 1052 // Set RED/ULPFEC information.
1048 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 1053 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
brandtr 2017/08/23 14:10:44 Not your change, but would you mind removing this
stefan-webrtc 2017/08/23 14:27:08 Yes!
1049 rtp_rtcp->SetUlpfecConfig(red_payload_type, ulpfec_payload_type); 1054 rtp_rtcp->SetUlpfecConfig(red_payload_type, ulpfec_payload_type);
1050 } 1055 }
1051 } 1056 }
1052 1057
1053 // Currently, both ULPFEC and FlexFEC use the same FEC rate calculation logic, 1058 // Currently, both ULPFEC and FlexFEC use the same FEC rate calculation logic,
1054 // so enable that logic if either of those FEC schemes are enabled. 1059 // so enable that logic if either of those FEC schemes are enabled.
1055 protection_bitrate_calculator_.SetProtectionMethod( 1060 protection_bitrate_calculator_.SetProtectionMethod(
1056 flexfec_enabled || IsUlpfecEnabled(), nack_enabled); 1061 flexfec_enabled || IsUlpfecEnabled(), nack_enabled);
1057 } 1062 }
1058 1063
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 std::min(config_->rtp.max_packet_size, 1255 std::min(config_->rtp.max_packet_size,
1251 kPathMTU - transport_overhead_bytes_per_packet_); 1256 kPathMTU - transport_overhead_bytes_per_packet_);
1252 1257
1253 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 1258 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
1254 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); 1259 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size);
1255 } 1260 }
1256 } 1261 }
1257 1262
1258 } // namespace internal 1263 } // namespace internal
1259 } // namespace webrtc 1264 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/video_send_stream_tests.cc » ('j') | webrtc/video/video_send_stream_tests.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698