Split FlexFEC field trial in two.
- The "flexfec-03" codec is advertised in the SDP whenever the
"WebRTC-FlexFEC-03-Advertised" field trial is enabled.
- Sending FlexFEC packets is enabled whenever the "flexfec-03" codec is
negotiated, and the "WebRTC-FlexFEC-03" field trial is enabled.
After this CL, the number of calls to
WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodec during renegotiation
will be reduced for cases when only one endpoint has the "WebRTC-FlexFEC-03"
field trial enabled.
BUG=webrtc:5654
Review-Url: https://codereview.webrtc.org/2716733005
Cr-Commit-Position: refs/heads/master@{#16925}
diff --git a/webrtc/media/engine/internalencoderfactory.cc b/webrtc/media/engine/internalencoderfactory.cc
index 65c1ba9..544070f 100644
--- a/webrtc/media/engine/internalencoderfactory.cc
+++ b/webrtc/media/engine/internalencoderfactory.cc
@@ -21,10 +21,13 @@
namespace {
-const char kFlexfecFieldTrialName[] = "WebRTC-FlexFEC-03";
-
-bool IsFlexfecFieldTrialEnabled() {
- return webrtc::field_trial::IsEnabled(kFlexfecFieldTrialName);
+// If this field trial is enabled, the "flexfec-03" codec will be advertised
+// as being supported by the InternalEncoderFactory. This means that
+// "flexfec-03" will appear in the default local SDP, and we therefore need to
+// be ready to receive FlexFEC packets from the remote.
+bool IsFlexfecAdvertisedFieldTrialEnabled() {
+ return webrtc::field_trial::FindFullName("WebRTC-FlexFEC-03-Advertised") ==
+ "Enabled";
}
} // namespace
@@ -46,7 +49,7 @@
supported_codecs_.push_back(cricket::VideoCodec(kRedCodecName));
supported_codecs_.push_back(cricket::VideoCodec(kUlpfecCodecName));
- if (IsFlexfecFieldTrialEnabled()) {
+ if (IsFlexfecAdvertisedFieldTrialEnabled()) {
cricket::VideoCodec flexfec_codec(kFlexfecCodecName);
// This value is currently arbitrarily set to 10 seconds. (The unit
// is microseconds.) This parameter MUST be present in the SDP, but