Title: [241200] trunk
Revision
241200
Author
[email protected]
Date
2019-02-08 10:49:23 -0800 (Fri, 08 Feb 2019)

Log Message

Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
https://bugs.webkit.org/show_bug.cgi?id=194380
<rdar://problem/47916514>

Reviewed by Eric Carlson.

Source/WebCore:

Set whether VP8 is supported at creation of the page.
This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.

Add internal API to enable resetting the factory to enable proper testing.

Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/Page.cpp:
(WebCore::m_applicationManifest):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::clearPeerConnectionFactory):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* webrtc/video-mute-vp8-expected.txt:
* webrtc/video-mute-vp8.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (241199 => 241200)


--- trunk/LayoutTests/ChangeLog	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/LayoutTests/ChangeLog	2019-02-08 18:49:23 UTC (rev 241200)
@@ -1,3 +1,14 @@
+2019-02-08  Youenn Fablet  <[email protected]>
+
+        Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
+        https://bugs.webkit.org/show_bug.cgi?id=194380
+        <rdar://problem/47916514>
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/video-mute-vp8-expected.txt:
+        * webrtc/video-mute-vp8.html:
+
 2019-02-08  Andy Estes  <[email protected]>
 
         [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces

Modified: trunk/LayoutTests/webrtc/video-mute-vp8-expected.txt (241199 => 241200)


--- trunk/LayoutTests/webrtc/video-mute-vp8-expected.txt	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/LayoutTests/webrtc/video-mute-vp8-expected.txt	2019-02-08 18:49:23 UTC (rev 241200)
@@ -2,6 +2,7 @@
 Following, should be a snapshot of the video, a black frame and a snapshot of the video.
   
 
+PASS Verify VP8 activation 
 PASS Setting video exchange 
 PASS Ensuring connection state is connected 
 PASS Track is enabled, video should not be black 

Modified: trunk/LayoutTests/webrtc/video-mute-vp8.html (241199 => 241200)


--- trunk/LayoutTests/webrtc/video-mute-vp8.html	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/LayoutTests/webrtc/video-mute-vp8.html	2019-02-08 18:49:23 UTC (rev 241200)
@@ -15,6 +15,20 @@
         <canvas id="canvas3" width="320" height="240"></canvas>
         <script src =""
         <script>
+promise_test(async (test) => {
+    if (window.internals)
+        window.internals.clearPeerConnectionFactory();
+
+    const codecs = RTCRtpSender.getCapabilities("video").codecs;
+    assert_true(codecs.some((codec) => { return codec.mimeType.indexOf("VP8") }), "VP8 is listed as a codec");
+
+    const pc = new RTCPeerConnection();
+    pc.addTransceiver("video");
+    const description = await pc.createOffer();
+    pc.close();
+    assert_true(description.sdp.indexOf("VP8") !== -1, "VP8 codec is in the SDP");
+}, "Verify VP8 activation")
+
 var track;
 var remoteTrack;
 var receivingConnection;

Modified: trunk/Source/WebCore/ChangeLog (241199 => 241200)


--- trunk/Source/WebCore/ChangeLog	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/Source/WebCore/ChangeLog	2019-02-08 18:49:23 UTC (rev 241200)
@@ -1,3 +1,28 @@
+2019-02-08  Youenn Fablet  <[email protected]>
+
+        Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
+        https://bugs.webkit.org/show_bug.cgi?id=194380
+        <rdar://problem/47916514>
+
+        Reviewed by Eric Carlson.
+
+        Set whether VP8 is supported at creation of the page.
+        This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.
+
+        Add internal API to enable resetting the factory to enable proper testing.
+
+        Covered by updated test.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::createLibWebRTCPeerConnectionBackend):
+        * page/Page.cpp:
+        (WebCore::m_applicationManifest):
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::clearPeerConnectionFactory):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2019-02-08  Andy Estes  <[email protected]>
 
         [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp (241199 => 241200)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2019-02-08 18:49:23 UTC (rev 241200)
@@ -58,9 +58,6 @@
     if (!page)
         return nullptr;
 
-#if USE(LIBWEBRTC)
-    page->libWebRTCProvider().supportsVP8(RuntimeEnabledFeatures::sharedFeatures().webRTCVP8CodecEnabled());
-#endif
     return std::make_unique<LibWebRTCPeerConnectionBackend>(peerConnection, page->libWebRTCProvider());
 }
 

Modified: trunk/Source/WebCore/page/Page.cpp (241199 => 241200)


--- trunk/Source/WebCore/page/Page.cpp	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/Source/WebCore/page/Page.cpp	2019-02-08 18:49:23 UTC (rev 241200)
@@ -310,6 +310,10 @@
 #if PLATFORM(COCOA)
     platformInitialize();
 #endif
+
+#if USE(LIBWEBRTC)
+    m_libWebRTCProvider->supportsVP8(RuntimeEnabledFeatures::sharedFeatures().webRTCVP8CodecEnabled());
+#endif
 }
 
 Page::~Page()

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h (241199 => 241200)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h	2019-02-08 18:49:23 UTC (rev 241200)
@@ -113,6 +113,8 @@
     Optional<RTCRtpCapabilities> receiverCapabilities(const String& kind);
     Optional<RTCRtpCapabilities> senderCapabilities(const String& kind);
 
+    void clearFactory() { m_factory = nullptr; }
+
 protected:
     LibWebRTCProvider() = default;
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (241199 => 241200)


--- trunk/Source/WebCore/testing/Internals.cpp	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/Source/WebCore/testing/Internals.cpp	2019-02-08 18:49:23 UTC (rev 241200)
@@ -1463,6 +1463,14 @@
     object.stop();
 }
 
+void Internals::clearPeerConnectionFactory()
+{
+#if USE(LIBWEBRTC)
+    if (auto* page = contextDocument()->page())
+        page->libWebRTCProvider().clearFactory();
+#endif
+}
+
 void Internals::applyRotationForOutgoingVideoSources(RTCPeerConnection& connection)
 {
     connection.applyRotationForOutgoingVideoSources();

Modified: trunk/Source/WebCore/testing/Internals.h (241199 => 241200)


--- trunk/Source/WebCore/testing/Internals.h	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/Source/WebCore/testing/Internals.h	2019-02-08 18:49:23 UTC (rev 241200)
@@ -518,6 +518,7 @@
     void setICECandidateFiltering(bool);
     void setEnumeratingAllNetworkInterfacesEnabled(bool);
     void stopPeerConnection(RTCPeerConnection&);
+    void clearPeerConnectionFactory();
     void applyRotationForOutgoingVideoSources(RTCPeerConnection&);
 #endif
 

Modified: trunk/Source/WebCore/testing/Internals.idl (241199 => 241200)


--- trunk/Source/WebCore/testing/Internals.idl	2019-02-08 18:20:12 UTC (rev 241199)
+++ trunk/Source/WebCore/testing/Internals.idl	2019-02-08 18:49:23 UTC (rev 241200)
@@ -583,6 +583,7 @@
     [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
     [Conditional=WEB_RTC] void setEnumeratingAllNetworkInterfacesEnabled(boolean enabled);
     [Conditional=WEB_RTC] void stopPeerConnection(RTCPeerConnection connection);
+    [Conditional=WEB_RTC] void clearPeerConnectionFactory();
 
     [Conditional=VIDEO] void simulateSystemSleep();
     [Conditional=VIDEO] void simulateSystemWake();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to