Title: [272129] trunk/Source/WebCore
Revision
272129
Author
[email protected]
Date
2021-01-31 23:17:41 -0800 (Sun, 31 Jan 2021)

Log Message

[GStreamer][EME] Add basic cbcs support
https://bugs.webkit.org/show_bug.cgi?id=221133

Reviewed by Philippe Normand.

Add cbcs as supported encryption scheme.

* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::capsMediaType):
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMPrivateThunder::supportedInitDataTypes const):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformInPlace):
* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272128 => 272129)


--- trunk/Source/WebCore/ChangeLog	2021-02-01 00:45:56 UTC (rev 272128)
+++ trunk/Source/WebCore/ChangeLog	2021-02-01 07:17:41 UTC (rev 272129)
@@ -1,3 +1,20 @@
+2021-01-31  Xabier Rodriguez Calvar  <[email protected]>
+
+        [GStreamer][EME] Add basic cbcs support
+        https://bugs.webkit.org/show_bug.cgi?id=221133
+
+        Reviewed by Philippe Normand.
+
+        Add cbcs as supported encryption scheme.
+
+        * platform/graphics/gstreamer/GStreamerCommon.cpp:
+        (WebCore::capsMediaType):
+        * platform/graphics/gstreamer/eme/CDMThunder.cpp:
+        (WebCore::CDMPrivateThunder::supportedInitDataTypes const):
+        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
+        (transformInPlace):
+        * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:
+
 2021-01-31  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] InlineContentBreaker::processOverflowingTextContent should find breaking positions even after the overflowing run

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp (272128 => 272129)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp	2021-02-01 00:45:56 UTC (rev 272128)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp	2021-02-01 07:17:41 UTC (rev 272129)
@@ -183,7 +183,7 @@
         return nullptr;
     }
 #if ENABLE(ENCRYPTED_MEDIA)
-    if (gst_structure_has_name(structure, "application/x-cenc") || gst_structure_has_name(structure, "application/x-webm-enc"))
+    if (gst_structure_has_name(structure, "application/x-cenc") || gst_structure_has_name(structure, "application/x-cbcs") || gst_structure_has_name(structure, "application/x-webm-enc"))
         return gst_structure_get_string(structure, "original-media-type");
 #endif
     return gst_structure_get_name(structure);

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp (272128 => 272129)


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp	2021-02-01 00:45:56 UTC (rev 272128)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp	2021-02-01 07:17:41 UTC (rev 272129)
@@ -138,10 +138,11 @@
     static std::once_flag onceFlag;
     static Vector<AtomString> supportedInitDataTypes;
     std::call_once(onceFlag, [] {
-        supportedInitDataTypes.reserveInitialCapacity(3);
+        supportedInitDataTypes.reserveInitialCapacity(4);
         supportedInitDataTypes.uncheckedAppend(AtomString("keyids"));
         supportedInitDataTypes.uncheckedAppend(AtomString("cenc"));
         supportedInitDataTypes.uncheckedAppend(AtomString("webm"));
+        supportedInitDataTypes.uncheckedAppend(AtomString("cbcs"));
     });
     return supportedInitDataTypes;
 }

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp	2021-02-01 00:45:56 UTC (rev 272128)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp	2021-02-01 07:17:41 UTC (rev 272129)
@@ -238,6 +238,9 @@
         return GST_FLOW_NOT_SUPPORTED;
     }
 
+    if (gst_structure_has_field(protectionMeta->info, "crypt_byte_block") || gst_structure_has_field(protectionMeta->info, "skip_byte_block"))
+        GST_FIXME_OBJECT(self, "cbcs crypt/skip pattern is still unsupported");
+
     GstBuffer* ivBuffer = gst_value_get_buffer(value);
     WebKitMediaCommonEncryptionDecryptClass* klass = WEBKIT_MEDIA_CENC_DECRYPT_GET_CLASS(self);
 

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2021-02-01 00:45:56 UTC (rev 272128)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp	2021-02-01 07:17:41 UTC (rev 272129)
@@ -47,6 +47,7 @@
 #define GST_CAT_DEFAULT webkitMediaThunderDecryptDebugCategory
 
 static const char* cencEncryptionMediaTypes[] = { "video/mp4", "audio/mp4", "video/x-h264", "audio/mpeg", nullptr };
+static const char** cbcsEncryptionMediaTypes = cencEncryptionMediaTypes;
 static const char* webmEncryptionMediaTypes[] = { "video/webm", "audio/webm", "video/x-vp9", "audio/x-opus", nullptr };
 
 static GstStaticPadTemplate srcTemplate = GST_STATIC_PAD_TEMPLATE("src",
@@ -85,6 +86,11 @@
         }
     }
 
+    for (int i = 0; cbcsEncryptionMediaTypes[i]; ++i) {
+        gst_caps_append_structure(caps.get(), gst_structure_new("application/x-cbcs", "original-media-type", G_TYPE_STRING,
+            cbcsEncryptionMediaTypes[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) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to