guard flexfec usage with fieldtrial

otherwise if the client receives a flexfec-enabled offer
and receiving flexfec is enabled by default, an answer
or subsequent offer will enable sending flexfec.

BUG=webrtc:8151

Change-Id: I632094f69ffa68518b6b8f31175eb093efaf51c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193862
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#32628}
diff --git a/pc/media_session.cc b/pc/media_session.cc
index cbff216..6d8a9a4 100644
--- a/pc/media_session.cc
+++ b/pc/media_session.cc
@@ -36,6 +36,7 @@
 #include "rtc_base/logging.h"
 #include "rtc_base/third_party/base64/base64.h"
 #include "rtc_base/unique_id_generator.h"
+#include "system_wrappers/include/field_trial.h"
 
 namespace {
 
@@ -336,6 +337,12 @@
            "a single media streams. This session has multiple "
            "media streams however, so no FlexFEC SSRC will be generated.";
   }
+  if (include_flexfec_stream &&
+      !webrtc::field_trial::IsEnabled("WebRTC-FlexFEC-03")) {
+    include_flexfec_stream = false;
+    RTC_LOG(LS_WARNING)
+        << "WebRTC-FlexFEC trial is not enabled, not sending FlexFEC";
+  }
 
   result.GenerateSsrcs(sender.num_sim_layers, include_rtx_streams,
                        include_flexfec_stream, ssrc_generator);