Title: [238159] trunk/Source/WebCore
Revision
238159
Author
[email protected]
Date
2018-11-13 19:57:23 -0800 (Tue, 13 Nov 2018)

Log Message

[WebRTC] Provide default implementation of LibWebRTCProvider
https://bugs.webkit.org/show_bug.cgi?id=191611

Reviewed by Michael Catanzaro.

Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.

* PlatformWin.cmake:
* platform/GStreamer.cmake:
* platform/SourcesGLib.txt:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
* platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
* platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (238158 => 238159)


--- trunk/Source/WebCore/ChangeLog	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/ChangeLog	2018-11-14 03:57:23 UTC (rev 238159)
@@ -1,3 +1,21 @@
+2018-11-13  Ross Kirsling  <[email protected]>
+
+        [WebRTC] Provide default implementation of LibWebRTCProvider
+        https://bugs.webkit.org/show_bug.cgi?id=191611
+
+        Reviewed by Michael Catanzaro.
+
+        Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
+
+        * PlatformWin.cmake:
+        * platform/GStreamer.cmake:
+        * platform/SourcesGLib.txt:
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
+        * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
+        * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
+        * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
+        * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
+
 2018-11-13  Timothy Hatcher  <[email protected]>
 
         Use a light scrollbar for transparent web views in dark mode.

Modified: trunk/Source/WebCore/PlatformWin.cmake (238158 => 238159)


--- trunk/Source/WebCore/PlatformWin.cmake	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/PlatformWin.cmake	2018-11-14 03:57:23 UTC (rev 238159)
@@ -71,8 +71,6 @@
     platform/graphics/win/TransformationMatrixWin.cpp
     platform/graphics/win/UniscribeController.cpp
 
-    platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp
-
     platform/network/win/DownloadBundleWin.cpp
     platform/network/win/NetworkStateNotifierWin.cpp
 

Modified: trunk/Source/WebCore/platform/GStreamer.cmake (238158 => 238159)


--- trunk/Source/WebCore/platform/GStreamer.cmake	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/platform/GStreamer.cmake	2018-11-14 03:57:23 UTC (rev 238159)
@@ -37,6 +37,7 @@
         platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp
         platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp
         platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp
+        platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp
 
         platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp
         platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp

Modified: trunk/Source/WebCore/platform/SourcesGLib.txt (238158 => 238159)


--- trunk/Source/WebCore/platform/SourcesGLib.txt	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/platform/SourcesGLib.txt	2018-11-14 03:57:23 UTC (rev 238159)
@@ -33,5 +33,3 @@
 platform/glib/UserAgentGLib.cpp
 
 platform/network/glib/NetworkStateNotifierGLib.cpp
-
-platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp (238158 => 238159)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp	2018-11-14 03:57:23 UTC (rev 238159)
@@ -52,11 +52,16 @@
 
 namespace WebCore {
 
-#if !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE)
+#if !USE(LIBWEBRTC)
 UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
 {
     return makeUniqueRef<LibWebRTCProvider>();
 }
+
+bool LibWebRTCProvider::webRTCAvailable()
+{
+    return false;
+}
 #endif
 
 void LibWebRTCProvider::setActive(bool)

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp (238158 => 238159)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp	2018-11-14 03:57:23 UTC (rev 238159)
@@ -27,25 +27,19 @@
 #include "LibWebRTCProviderCocoa.h"
 
 #if USE(LIBWEBRTC)
+
 #include <webrtc/media/engine/webrtcvideodecoderfactory.h>
 #include <webrtc/media/engine/webrtcvideoencoderfactory.h>
 #include <webrtc/sdk/WebKit/WebKitUtilities.h>
 #include <wtf/darwin/WeakLinking.h>
-#endif
 
 namespace WebCore {
 
 UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
 {
-#if USE(LIBWEBRTC) && PLATFORM(COCOA)
     return makeUniqueRef<LibWebRTCProviderCocoa>();
-#else
-    return makeUniqueRef<LibWebRTCProvider>();
-#endif
 }
 
-#if USE(LIBWEBRTC)
-
 LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa()
 {
 }
@@ -72,15 +66,11 @@
     webrtc::setApplicationStatus(value);
 }
 
-#endif // USE(LIBWEBRTC)
-
 bool LibWebRTCProvider::webRTCAvailable()
 {
-#if USE(LIBWEBRTC)
     return !isNullFunctionPointer(rtc::LogMessage::LogToDebug);
-#else
-    return true;
-#endif
 }
 
 } // namespace WebCore
+
+#endif // USE(LIBWEBRTC)

Copied: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp (from rev 238158, trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp) (0 => 238159)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp	2018-11-14 03:57:23 UTC (rev 238159)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "LibWebRTCProviderGStreamer.h"
+
+#if USE(LIBWEBRTC) && USE(GSTREAMER)
+
+#include <wtf/UniqueRef.h>
+
+namespace WebCore {
+
+UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
+{
+    return makeUniqueRef<LibWebRTCProviderGStreamer>();
+}
+
+bool LibWebRTCProvider::webRTCAvailable()
+{
+    return true;
+}
+
+std::unique_ptr<webrtc::VideoDecoderFactory> LibWebRTCProviderGStreamer::createDecoderFactory()
+{
+    return std::make_unique<GStreamerVideoDecoderFactory>();
+}
+
+std::unique_ptr<webrtc::VideoEncoderFactory> LibWebRTCProviderGStreamer::createEncoderFactory()
+{
+    return std::make_unique<GStreamerVideoEncoderFactory>();
+}
+
+} // namespace WebCore
+
+#endif // USE(LIBWEBRTC) && USE(GSTREAMER)

Copied: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h (from rev 238158, trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h) (0 => 238159)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h	2018-11-14 03:57:23 UTC (rev 238159)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "LibWebRTCProvider.h"
+
+#if USE(LIBWEBRTC) && USE(GSTREAMER)
+
+#include "GStreamerVideoDecoderFactory.h"
+#include "GStreamerVideoEncoderFactory.h"
+
+namespace WebCore {
+
+class WEBCORE_EXPORT LibWebRTCProviderGStreamer : public LibWebRTCProvider {
+public:
+    LibWebRTCProviderGStreamer() = default;
+
+    std::unique_ptr<webrtc::VideoEncoderFactory> createEncoderFactory() final;
+    std::unique_ptr<webrtc::VideoDecoderFactory> createDecoderFactory() final;
+};
+
+} // namespace WebCore
+
+#endif

Deleted: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp (238158 => 238159)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp	2018-11-14 03:57:23 UTC (rev 238159)
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2017 Igalia S.L. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LibWebRTCProviderGlib.h"
-
-#include <wtf/UniqueRef.h>
-
-namespace WebCore {
-
-UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
-{
-#if USE(LIBWEBRTC) && (PLATFORM(GTK) || PLATFORM(WPE))
-    return makeUniqueRef<LibWebRTCProviderGlib>();
-#else
-    return makeUniqueRef<LibWebRTCProvider>();
-#endif
-}
-
-bool LibWebRTCProvider::webRTCAvailable()
-{
-#if USE(LIBWEBRTC) && USE(GSTREAMER)
-    return true;
-#else
-    return false;
-#endif
-}
-
-#if USE(LIBWEBRTC) && USE(GSTREAMER)
-std::unique_ptr<webrtc::VideoDecoderFactory> LibWebRTCProviderGlib::createDecoderFactory()
-{
-    return std::make_unique<GStreamerVideoDecoderFactory>();
-}
-
-std::unique_ptr<webrtc::VideoEncoderFactory> LibWebRTCProviderGlib::createEncoderFactory()
-{
-    return std::make_unique<GStreamerVideoEncoderFactory>();
-}
-#endif // USE(LIBWEBRTC) && USE(GSTREAMER)
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h (238158 => 238159)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h	2018-11-14 03:57:23 UTC (rev 238159)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2017 Igalia S.L. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if USE(GSTREAMER)
-#include "GStreamerVideoDecoderFactory.h"
-#include "GStreamerVideoEncoderFactory.h"
-#endif
-
-#include "LibWebRTCProvider.h"
-
-#if USE(LIBWEBRTC)
-
-namespace WebCore {
-
-class WEBCORE_EXPORT LibWebRTCProviderGlib : public LibWebRTCProvider {
-public:
-    LibWebRTCProviderGlib() = default;
-
-#if USE(GSTREAMER)
-    std::unique_ptr<webrtc::VideoEncoderFactory> createEncoderFactory() final;
-    std::unique_ptr<webrtc::VideoDecoderFactory> createDecoderFactory() final;
-#endif
-};
-
-} // namespace WebCore
-
-#endif

Deleted: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp (238158 => 238159)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp	2018-11-14 03:48:53 UTC (rev 238158)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp	2018-11-14 03:57:23 UTC (rev 238159)
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2018 Sony Interactive Entertainment Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LibWebRTCProvider.h"
-
-namespace WebCore {
-
-bool LibWebRTCProvider::webRTCAvailable()
-{
-    return false;
-}
-
-} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to