Title: [271289] trunk/Source/WebCore
Revision
271289
Author
[email protected]
Date
2021-01-08 02:28:50 -0800 (Fri, 08 Jan 2021)

Log Message

[GStreamer][EME][Thunder] Accept no protection system specific caps for CENC
https://bugs.webkit.org/show_bug.cgi?id=220088

Reviewed by Philippe Normand.

For example in CMAF it could happen that you don't have protection
events and hence no protection system in the caps. We need to
allow those cases.

* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (271288 => 271289)


--- trunk/Source/WebCore/ChangeLog	2021-01-08 09:59:25 UTC (rev 271288)
+++ trunk/Source/WebCore/ChangeLog	2021-01-08 10:28:50 UTC (rev 271289)
@@ -1,3 +1,16 @@
+2021-01-08  Xabier Rodriguez Calvar  <[email protected]>
+
+        [GStreamer][EME][Thunder] Accept no protection system specific caps for CENC
+        https://bugs.webkit.org/show_bug.cgi?id=220088
+
+        Reviewed by Philippe Normand.
+
+        For example in CMAF it could happen that you don't have protection
+        events and hence no protection system in the caps. We need to
+        allow those cases.
+
+        * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:
+
 2020-09-24  Sergio Villar Senin  <[email protected]>
 
         [WebXR] Initial implemention of device initialization/shutdown with OpenXR

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp (271288 => 271289)


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2021-01-08 09:59:25 UTC (rev 271288)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2021-01-08 10:28:50 UTC (rev 271289)
@@ -69,17 +69,27 @@
 {
     GRefPtr<GstCaps> caps = adoptGRef(gst_caps_new_empty());
 
+    if (CDMFactoryThunder::singleton().supportedKeySystems().isEmpty()) {
+        GST_WARNING("no supported key systems in Thunder, we won't be able to decrypt anything with the its decryptor");
+        return caps;
+    }
+
+    for (int i = 0; cencEncryptionMediaTypes[i]; ++i) {
+        gst_caps_append_structure(caps.get(), gst_structure_new("application/x-cenc", "original-media-type", G_TYPE_STRING,
+            cencEncryptionMediaTypes[i], nullptr));
+    }
     for (const auto& keySystem : CDMFactoryThunder::singleton().supportedKeySystems()) {
         for (int i = 0; cencEncryptionMediaTypes[i]; ++i) {
             gst_caps_append_structure(caps.get(), gst_structure_new("application/x-cenc", "original-media-type", G_TYPE_STRING,
                 cencEncryptionMediaTypes[i], "protection-system", G_TYPE_STRING, GStreamerEMEUtilities::keySystemToUuid(keySystem), nullptr));
         }
-        if (GStreamerEMEUtilities::isWidevineKeySystem(keySystem)) {
-            // No key system UUID for webm. It's not set in caps for it and it's just Widevine.
-            for (int i = 0; webmEncryptionMediaTypes[i]; ++i) {
-                gst_caps_append_structure(caps.get(), gst_structure_new("application/x-webm-enc", "original-media-type", G_TYPE_STRING,
-                    webmEncryptionMediaTypes[i], nullptr));
-            }
+    }
+
+    if (CDMFactoryThunder::singleton().supportsKeySystem(GStreamerEMEUtilities::s_WidevineKeySystem)) {
+        // WebM is Widevine only so no Widevine, no WebM decryption.
+        for (int i = 0; webmEncryptionMediaTypes[i]; ++i) {
+            gst_caps_append_structure(caps.get(), gst_structure_new("application/x-webm-enc", "original-media-type", G_TYPE_STRING,
+                webmEncryptionMediaTypes[i], nullptr));
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to