Add logging and ASSERTs to investigate issue with VPModuleInitialize
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2019 03:34:53 +0000 (03:34 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2019 03:34:53 +0000 (03:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196573

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Expand macros directly to add some logging.
Removed the dispatch_once since VPModuleInitialize is already called in one.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp:
(webrtc::initVideoProcessingVPModuleInitialize):

Source/WebCore:

Add some ASSERTs.
No change of behavior.

* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):

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

Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp

index 420452f..bf8a168 100644 (file)
@@ -1,5 +1,18 @@
 2019-04-03  Youenn Fablet  <youenn@apple.com>
 
+        Add logging and ASSERTs to investigate issue with VPModuleInitialize
+        https://bugs.webkit.org/show_bug.cgi?id=196573
+
+        Reviewed by Eric Carlson.
+
+        Expand macros directly to add some logging.
+        Removed the dispatch_once since VPModuleInitialize is already called in one.
+
+        * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp:
+        (webrtc::initVideoProcessingVPModuleInitialize):
+
+2019-04-03  Youenn Fablet  <youenn@apple.com>
+
         Remove unneeded libwebrtc files
         https://bugs.webkit.org/show_bug.cgi?id=196553
 
index 7228810..9b12be6 100644 (file)
 }
 
 SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(webrtc, VideoProcessing)
-SOFT_LINK_FUNCTION_FOR_SOURCE(webrtc, VideoProcessing, VPModuleInitialize, void, (), ())
+
+namespace webrtc {
+static void initVideoProcessingVPModuleInitialize();
+void (*softLinkVideoProcessingVPModuleInitialize) () = initVideoProcessingVPModuleInitialize;
+static void initVideoProcessingVPModuleInitialize()
+{
+    auto* library = VideoProcessingLibrary();
+    if (!library)
+        fprintf(stderr, "Cannot find VideoProcessingLibrary: %s\n", dlerror());
+    softLinkVideoProcessingVPModuleInitialize = (void (*)()) dlsym(library, "VPModuleInitialize");
+    if (!softLinkVideoProcessingVPModuleInitialize)
+        fprintf(stderr, "Cannot find function VPModuleInitialize: %s\n", dlerror());
+    softLinkVideoProcessingVPModuleInitialize();
+}
+
+}
 
 #endif
 
index df3fff6..0c882b0 100644 (file)
@@ -1,3 +1,17 @@
+2019-04-03  Youenn Fablet  <youenn@apple.com>
+
+        Add logging and ASSERTs to investigate issue with VPModuleInitialize
+        https://bugs.webkit.org/show_bug.cgi?id=196573
+
+        Reviewed by Eric Carlson.
+
+        Add some ASSERTs.
+        No change of behavior.
+
+        * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
+        (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
+        (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
+
 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
 
         Remove some redundant memebers from ScrollingStateFrameScrollingNode
index 1a4d3e6..e784c35 100644 (file)
@@ -51,12 +51,16 @@ void LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed(bool allowed)
 
 std::unique_ptr<webrtc::VideoDecoderFactory> LibWebRTCProviderCocoa::createDecoderFactory()
 {
+    ASSERT(isMainThread());
+
     auto codecSupport = m_supportsVP8 ? webrtc::WebKitCodecSupport::H264AndVP8 : webrtc::WebKitCodecSupport::H264;
     return webrtc::createWebKitDecoderFactory(codecSupport);
 }
 
 std::unique_ptr<webrtc::VideoEncoderFactory> LibWebRTCProviderCocoa::createEncoderFactory()
 {
+    ASSERT(isMainThread());
+
     auto codecSupport = m_supportsVP8 ? webrtc::WebKitCodecSupport::H264AndVP8 : webrtc::WebKitCodecSupport::H264;
     return webrtc::createWebKitEncoderFactory(codecSupport);
 }