Index: webrtc/media/engine/internalencoderfactory.cc |
diff --git a/webrtc/media/engine/internalencoderfactory.cc b/webrtc/media/engine/internalencoderfactory.cc |
index 4c9801544744c4b61fb3fcdb434217bab48954c6..28e336deb03a2679652c77e84f28cb0941bfb6c8 100644 |
--- a/webrtc/media/engine/internalencoderfactory.cc |
+++ b/webrtc/media/engine/internalencoderfactory.cc |
@@ -15,9 +15,20 @@ |
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
+#include "webrtc/system_wrappers/include/field_trial.h" |
namespace cricket { |
+namespace { |
+ |
+const char kFlexfecFieldTrialName[] = "WebRTC-FlexFEC-03"; |
+ |
+bool IsFlexfecFieldTrialEnabled() { |
+ return webrtc::field_trial::FindFullName(kFlexfecFieldTrialName) == "Enabled"; |
+} |
+ |
+} // namespace |
+ |
InternalEncoderFactory::InternalEncoderFactory() { |
supported_codecs_.push_back(cricket::VideoCodec(kVp8CodecName)); |
if (webrtc::VP9Encoder::IsSupported()) |
@@ -36,6 +47,16 @@ InternalEncoderFactory::InternalEncoderFactory() { |
supported_codecs_.push_back(cricket::VideoCodec(kRedCodecName)); |
supported_codecs_.push_back(cricket::VideoCodec(kUlpfecCodecName)); |
+ |
+ if (IsFlexfecFieldTrialEnabled()) { |
+ 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 |
+ // we never use the actual value anywhere in our code however. |
+ // TODO(brandtr): Consider honouring this value in the sender and receiver. |
+ flexfec_codec.SetParam(kFlexfecFmtpRepairWindow, "10000000"); |
+ supported_codecs_.push_back(flexfec_codec); |
+ } |
} |
InternalEncoderFactory::~InternalEncoderFactory() {} |