Title: [237092] trunk/Source/WebCore
Revision
237092
Author
ph...@webkit.org
Date
2018-10-15 04:44:18 -0700 (Mon, 15 Oct 2018)

Log Message

[GStreamer] Fix EME build for GStreamer 1.14.x
https://bugs.webkit.org/show_bug.cgi?id=190471

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformCaps): The
GST_PROTECTION_UNSPECIFIED_SYSTEM_ID #define won't be shipped
until the GStreamer 1.16.0 release, so its use needs to be wrapped
between a version check.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (237091 => 237092)


--- trunk/Source/WebCore/ChangeLog	2018-10-12 23:54:17 UTC (rev 237091)
+++ trunk/Source/WebCore/ChangeLog	2018-10-15 11:44:18 UTC (rev 237092)
@@ -1,3 +1,18 @@
+2018-10-15  Philippe Normand  <pnorm...@igalia.com>
+
+        [GStreamer] Fix EME build for GStreamer 1.14.x
+        https://bugs.webkit.org/show_bug.cgi?id=190471
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
+        (webkitMediaCommonEncryptionDecryptTransformCaps): The
+        GST_PROTECTION_UNSPECIFIED_SYSTEM_ID #define won't be shipped
+        until the GStreamer 1.16.0 release, so its use needs to be wrapped
+        between a version check.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto.
+
 2018-10-12  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (237091 => 237092)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2018-10-12 23:54:17 UTC (rev 237091)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2018-10-15 11:44:18 UTC (rev 237092)
@@ -1274,7 +1274,11 @@
     // Check if the system key of the protection event is the same of the CDM instance.
     // For example: we can receive a new Widevine protection event but the CDM instance initialized with
     // Playready, so we ignore this event.
-    if (m_cdmInstance && g_strcmp0(eventKeySystemUUID, GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) && g_strcmp0(GStreamerEMEUtilities::keySystemToUuid(m_cdmInstance->keySystem()), eventKeySystemUUID)) {
+    if (m_cdmInstance
+#if GST_CHECK_VERSION(1, 15, 0)
+        && g_strcmp0(eventKeySystemUUID, GST_PROTECTION_UNSPECIFIED_SYSTEM_ID)
+#endif
+        && g_strcmp0(GStreamerEMEUtilities::keySystemToUuid(m_cdmInstance->keySystem()), eventKeySystemUUID)) {
         GST_DEBUG("The protection event with UUID %s is ignored because it isn't supported by the CDM %s", eventKeySystemUUID, m_cdmInstance->keySystem().utf8().data());
         return;
     }
@@ -1296,7 +1300,12 @@
 
         GST_DEBUG("scheduling initializationDataEncountered event for %s with init data size of %u", eventKeySystemUUID.utf8().data(), initData.sizeInBytes());
         GST_MEMDUMP("init datas", reinterpret_cast<const uint8_t*>(initData.characters8()), initData.sizeInBytes());
-        weakThis->m_player->initializationDataEncountered((eventKeySystemUUID == GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "webm"_s : "cenc"_s,
+        auto initDataType = "cenc"_s;
+#if GST_CHECK_VERSION(1, 15, 0)
+        if (eventKeySystemUUID == GST_PROTECTION_UNSPECIFIED_SYSTEM_ID)
+            initDataType = "webm"_s;
+#endif
+        weakThis->m_player->initializationDataEncountered(initDataType,
             ArrayBuffer::create(reinterpret_cast<const uint8_t*>(initData.characters8()), initData.sizeInBytes()));
     });
 }

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp (237091 => 237092)


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp	2018-10-12 23:54:17 UTC (rev 237091)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp	2018-10-15 11:44:18 UTC (rev 237092)
@@ -159,8 +159,13 @@
             gst_structure_set(outgoingStructure.get(), "protection-system", G_TYPE_STRING, klass->protectionSystemId,
                 "original-media-type", G_TYPE_STRING, gst_structure_get_name(incomingStructure), nullptr);
 
+            // GST_PROTECTION_UNSPECIFIED_SYSTEM_ID was added in the GStreamer
+            // developement git master which will ship as version 1.16.0.
             gst_structure_set_name(outgoingStructure.get(),
-                !g_strcmp0(klass->protectionSystemId, GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "application/x-webm-enc" : "application/x-cenc");
+#if GST_CHECK_VERSION(1, 15, 0)
+                !g_strcmp0(klass->protectionSystemId, GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "application/x-webm-enc" :
+#endif
+                "application/x-cenc");
         }
 
         bool duplicate = false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to