[cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
authoreocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Oct 2016 08:48:19 +0000 (08:48 +0000)
committereocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Oct 2016 08:48:19 +0000 (08:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162928

Reviewed by Xabier Rodriguez-Calvar.

.:

Consolidate all the source file tree changes after refactoring.

This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).

* Source/cmake/FindLibGcrypt.cmake: Added.
* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Consolidate all the source file tree changes after refactoring.

This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).

* platform/GStreamer.cmake:

Tools:

Explicitly enable MSE and EME on WebKitGTK+ buildbots.

This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).

* Scripts/webkitperl/FeatureList.pm:

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

ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/platform/GStreamer.cmake
Source/cmake/FindLibGcrypt.cmake [new file with mode: 0644]
Source/cmake/OptionsGTK.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm

index 435cc6e..9a4ce98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
 
+        [cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
+        https://bugs.webkit.org/show_bug.cgi?id=162928
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Consolidate all the source file tree changes after refactoring.
+
+        This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
+
+        * Source/cmake/FindLibGcrypt.cmake: Added.
+        * Source/cmake/OptionsGTK.cmake:
+
+2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
+
         [GTK][GStreamer] Disable MEDIA_SOURCE and ENCRYPTED_MEDIA_V2 by default
         https://bugs.webkit.org/show_bug.cgi?id=162623
 
index eacda94..871ec31 100644 (file)
@@ -1,5 +1,18 @@
 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
 
+        [cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
+        https://bugs.webkit.org/show_bug.cgi?id=162928
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Consolidate all the source file tree changes after refactoring.
+
+        This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
+
+        * platform/GStreamer.cmake:
+
+2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
+
         [MSE][GStreamer] Enable QUOTA_EXCEEDED_ERR support for GStreamer
         https://bugs.webkit.org/show_bug.cgi?id=162922
 
index 37fed6f..76de085 100644 (file)
@@ -23,6 +23,8 @@ endif ()
 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
     list(APPEND WebCore_INCLUDE_DIRECTORIES
         "${WEBCORE_DIR}/platform/graphics/gstreamer"
+        "${WEBCORE_DIR}/platform/graphics/gstreamer/mse"
+        "${WEBCORE_DIR}/platform/graphics/gstreamer/eme"
     )
 
     list(APPEND WebCore_SOURCES
@@ -32,15 +34,25 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
         platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
         platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
         platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
-        platform/graphics/gstreamer/MediaSourceGStreamer.cpp
-        platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp
         platform/graphics/gstreamer/TextCombinerGStreamer.cpp
         platform/graphics/gstreamer/TextSinkGStreamer.cpp
         platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
         platform/graphics/gstreamer/VideoSinkGStreamer.cpp
         platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
-        platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp
         platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
+
+        platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp
+        platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
+
+        platform/graphics/gstreamer/mse/AppendPipeline.cpp
+        platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp
+        platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp
+        platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
+        platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp
+        platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp
+        platform/graphics/gstreamer/mse/PlaybackPipeline.cpp
+        platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp
+        platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp
     )
 
     list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
@@ -117,3 +129,12 @@ if (ENABLE_WEB_AUDIO)
         ${GSTREAMER_FFT_LIBRARIES}
     )
 endif ()
+
+if (ENABLE_LEGACY_ENCRYPTED_MEDIA)
+    list(APPEND WebCore_INCLUDE_DIRECTORIES
+        ${LIBGCRYPT_INCLUDE_DIRS}
+    )
+    list(APPEND WebCore_LIBRARIES
+        ${LIBGCRYPT_LIBRARIES} -lgpg-error
+    )
+endif ()
diff --git a/Source/cmake/FindLibGcrypt.cmake b/Source/cmake/FindLibGcrypt.cmake
new file mode 100644 (file)
index 0000000..f295682
--- /dev/null
@@ -0,0 +1,91 @@
+#.rst
+# FindLibGcrypt
+# -------------
+#
+# Finds the Libgcrypt library.
+#
+# This will define the following variables:
+#
+# ``LIBGCRYPT_FOUND``
+#     True if the requested version of gcrypt was found
+# ``LIBGCRYPT_VERSION``
+#     The version of gcrypt that was found
+# ``LIBGCRYPT_INCLUDE_DIRS``
+#     The gcrypt include directories
+# ``LIBGCRYPT_LIBRARIES``
+#     The linker libraries needed to use the gcrypt library
+
+# Copyright 2014 Nicolás Alvarez <nicolas.alvarez@gmail.com>
+# Copyright 2016 Igalia S.L
+#
+# 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 copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
+
+find_program(LIBGCRYPTCONFIG_SCRIPT NAMES libgcrypt-config)
+if (LIBGCRYPTCONFIG_SCRIPT)
+    execute_process(
+        COMMAND "${LIBGCRYPTCONFIG_SCRIPT}" --prefix
+        RESULT_VARIABLE CONFIGSCRIPT_RESULT
+        OUTPUT_VARIABLE PREFIX
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    if (CONFIGSCRIPT_RESULT EQUAL 0)
+        set(LIBGCRYPT_LIB_HINT "${PREFIX}/lib")
+        set(LIBGCRYPT_INCLUDE_HINT "${PREFIX}/include")
+    endif ()
+endif ()
+
+find_library(LIBGCRYPT_LIBRARY
+    NAMES gcrypt
+    HINTS ${LIBGCRYPT_LIB_HINT}
+)
+find_path(LIBGCRYPT_INCLUDE_DIR
+    NAMES gcrypt.h
+    HINTS ${LIBGCRYPT_INCLUDE_HINT}
+)
+
+if (LIBGCRYPT_INCLUDE_DIR)
+    file(STRINGS ${LIBGCRYPT_INCLUDE_DIR}/gcrypt.h GCRYPT_H REGEX "^#define GCRYPT_VERSION ")
+    string(REGEX REPLACE "^#define GCRYPT_VERSION \"(.*)\".*$" "\\1" LIBGCRYPT_VERSION "${GCRYPT_H}")
+endif ()
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(LibGcrypt
+    FOUND_VAR LIBGCRYPT_FOUND
+    REQUIRED_VARS LIBGCRYPT_LIBRARY LIBGCRYPT_INCLUDE_DIR
+    VERSION_VAR LIBGCRYPT_VERSION
+)
+if (LIBGCRYPT_FOUND)
+    set(LIBGCRYPT_LIBRARIES ${LIBGCRYPT_LIBRARY})
+    set(LIBGCRYPT_INCLUDE_DIRS ${LIBGCRYPT_INCLUDE_DIR})
+endif ()
+
+mark_as_advanced(LIBGCRYPT_LIBRARY LIBGCRYPT_INCLUDE_DIR)
+
+include(FeatureSummary)
+set_package_properties(LibGcrypt PROPERTIES
+    DESCRIPTION "A general purpose cryptographic library based on the code from GnuPG."
+    URL "http://www.gnu.org/software/libgcrypt/"
+)
+
index c0b2fce..e240d3a 100644 (file)
@@ -270,6 +270,10 @@ if (ENABLE_MEDIA_STREAM OR ENABLE_WEB_RTC)
     SET_AND_EXPOSE_TO_BUILD(USE_OPENWEBRTC TRUE)
 endif ()
 
+if (ENABLE_LEGACY_ENCRYPTED_MEDIA)
+    find_package(LibGcrypt REQUIRED)
+endif ()
+
 SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER TRUE)
 
 if (ENABLE_OPENGL)
index 1930ecd..a4bcb20 100644 (file)
@@ -1,3 +1,16 @@
+2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
+
+        [cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
+        https://bugs.webkit.org/show_bug.cgi?id=162928
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Explicitly enable MSE and EME on WebKitGTK+ buildbots.
+
+        This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
+
+        * Scripts/webkitperl/FeatureList.pm:
+
 2016-10-25  Antoine Quint  <graouts@apple.com>
 
         [Modern Media Controls] Media Controller: skip back support
index 80debf6..b5a291f 100644 (file)
@@ -80,6 +80,7 @@ my (
     $dom4EventsConstructor,
     $domIterator,
     $downloadAttributeSupport,
+    $encryptedMediaSupport,
     $fetchAPISupport,
     $fontLoadEventsSupport,
     $ftlJITSupport,
@@ -102,6 +103,7 @@ my (
     $inputTypeWeekSupport,
     $intlSupport,
     $jitSupport,
+    $legacyEncryptedMediaSupport,
     $legacyNotificationsSupport,
     $legacyVendorPrefixSupport,
     $legacyWebAudioSupport,
@@ -251,8 +253,8 @@ my @features = (
     { option => "download-attribute", desc => "Toggle Download Attribute support",
       define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => (isEfl() || isGtk()), value => \$downloadAttributeSupport },
 
-    { option => "encrypted-media", desc => "Toggle EME support",
-      define => "ENABLE_ENCRYPTED_MEDIA", default => 0, value => \$fetchAPISupport },
+    { option => "encrypted-media", desc => "Toggle EME V3 support",
+      define => "ENABLE_ENCRYPTED_MEDIA", default => 0, value => \$encryptedMediaSupport },
 
     { option => "fetch-api", desc => "Toggle Fetch API support",
       define => "ENABLE_FETCH_API", default => 1, value => \$fetchAPISupport },
@@ -318,6 +320,9 @@ my @features = (
     { option => "jit", desc => "Enable just-in-time JavaScript support",
       define => "ENABLE_JIT", default => 1, value => \$jitSupport },
 
+    { option => "legacy-encrypted-media", desc => "Toggle Legacy EME V2 support",
+      define => "ENABLE_LEGACY_ENCRYPTED_MEDIA", default => isGtk(), value => \$legacyEncryptedMediaSupport },
+
     { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
       define => "ENABLE_LEGACY_NOTIFICATIONS", default => 0, value => \$legacyNotificationsSupport },