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

Unified Diff: webrtc/media/engine/internalencoderfactory.cc

Issue 2511703002: Wire up FlexFEC in VideoEngine2. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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 | « webrtc/media/engine/fakewebrtccall.cc ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {}
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.cc ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698