OLD | NEW |
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 Loading... |
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 sending ULPFEC is enabled."; |
| 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 Loading... |
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 rtp_rtcp->SetUlpfecConfig(red_payload_type, ulpfec_payload_type); |
1049 rtp_rtcp->SetUlpfecConfig(red_payload_type, ulpfec_payload_type); | |
1050 } | |
1051 } | 1054 } |
1052 | 1055 |
1053 // Currently, both ULPFEC and FlexFEC use the same FEC rate calculation logic, | 1056 // 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. | 1057 // so enable that logic if either of those FEC schemes are enabled. |
1055 protection_bitrate_calculator_.SetProtectionMethod( | 1058 protection_bitrate_calculator_.SetProtectionMethod( |
1056 flexfec_enabled || IsUlpfecEnabled(), nack_enabled); | 1059 flexfec_enabled || IsUlpfecEnabled(), nack_enabled); |
1057 } | 1060 } |
1058 | 1061 |
1059 void VideoSendStreamImpl::ConfigureSsrcs() { | 1062 void VideoSendStreamImpl::ConfigureSsrcs() { |
1060 RTC_DCHECK_RUN_ON(worker_queue_); | 1063 RTC_DCHECK_RUN_ON(worker_queue_); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 std::min(config_->rtp.max_packet_size, | 1253 std::min(config_->rtp.max_packet_size, |
1251 kPathMTU - transport_overhead_bytes_per_packet_); | 1254 kPathMTU - transport_overhead_bytes_per_packet_); |
1252 | 1255 |
1253 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1256 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
1254 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); | 1257 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); |
1255 } | 1258 } |
1256 } | 1259 } |
1257 | 1260 |
1258 } // namespace internal | 1261 } // namespace internal |
1259 } // namespace webrtc | 1262 } // namespace webrtc |
OLD | NEW |