Guard H264 simulcast with a runtime flag
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2018 16:26:51 +0000 (16:26 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2018 16:26:51 +0000 (16:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191025

Reviewed by Eric Carlson.

Source/WebCore:

Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
Covered by existing test.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):

Source/WebKit:

* Shared/WebPreferences.yaml:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml

index 9826e8e..8b7fa0f 100644 (file)
@@ -1,3 +1,19 @@
+2018-10-29  Youenn Fablet  <youenn@apple.com>
+
+        Guard H264 simulcast with a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=191025
+
+        Reviewed by Eric Carlson.
+
+        Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
+        Covered by existing test.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
+        (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
+
 2018-10-29  Zalan Bujtas  <zalan@apple.com>
 
         [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
index 803b1fb..1373058 100644 (file)
@@ -77,7 +77,8 @@ LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint(LibWebRTCPeerConnectionBackend& p
     ASSERT(isMainThread());
     ASSERT(client.factory());
 
-    webrtc::field_trial::InitFieldTrialsFromString("WebRTC-H264Simulcast/Enabled/");
+    if (RuntimeEnabledFeatures::sharedFeatures().webRTCH264SimulcastEnabled())
+        webrtc::field_trial::InitFieldTrialsFromString("WebRTC-H264Simulcast/Enabled/");
 }
 
 bool LibWebRTCMediaEndpoint::setConfiguration(LibWebRTCProvider& client, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
index d4d4ad4..203ac16 100644 (file)
@@ -216,6 +216,8 @@ public:
     void setPeerConnectionEnabled(bool isEnabled) { m_isPeerConnectionEnabled = isEnabled; }
     bool mdnsICECandidatesEnabled() const { return m_mdnsICECandidatesEnabled; }
     void setMDNSICECandidatesEnabled(bool isEnabled) { m_mdnsICECandidatesEnabled = isEnabled; }
+    bool webRTCH264SimulcastEnabled() const { return m_isWebRTCH264SimulcastEnabled; }
+    void setWebRTCH264SimulcastEnabled(bool isEnabled) { m_isWebRTCH264SimulcastEnabled = isEnabled; }
 #endif
 
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
@@ -398,6 +400,7 @@ private:
     bool m_isWebRTCUnifiedPlanEnabled { true };
     bool m_isPeerConnectionEnabled { true };
     bool m_mdnsICECandidatesEnabled { false };
+    bool m_isWebRTCH264SimulcastEnabled { true };
 #endif
 
 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
index b5a7ed3..f23ceca 100644 (file)
@@ -1,3 +1,12 @@
+2018-10-29  Youenn Fablet  <youenn@apple.com>
+
+        Guard H264 simulcast with a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=191025
+
+        Reviewed by Eric Carlson.
+
+        * Shared/WebPreferences.yaml:
+
 2018-10-29  Chris Dumez  <cdumez@apple.com>
 
         [PSON] When Safari restores session state after launching, going back and forward does not swap processes
index 16c7654..d0e2010 100644 (file)
@@ -523,6 +523,15 @@ WebRTCVP8CodecEnabled:
   humanReadableDescription: "Enable WebRTC VP8 codec"
   category: experimental
 
+WebRTCH264SimulcastEnabled:
+  type: bool
+  defaultValue: true
+  webcoreBinding: RuntimeEnabledFeatures
+  condition: ENABLE(WEB_RTC)
+  humanReadableName: "WebRTC H264 Simulcast"
+  humanReadableDescription: "Enable WebRTC H264 Simulcast"
+  category: experimental
+
 UseLegacyTextAlignPositionedElementBehavior:
   type: bool
   defaultValue: false