Title: [282439] trunk/Source/WebCore
Revision
282439
Author
[email protected]
Date
2021-09-14 23:01:56 -0700 (Tue, 14 Sep 2021)

Log Message

[GStreamer][EME] Accomodate cbcs as cipher-mode instead of mime
https://bugs.webkit.org/show_bug.cgi?id=230265

Reviewed by Philippe Normand.

In https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1013
it was decided that there should not be x-cbcs as mime type but
rather x-cenc with cbcs as cipher-mode.

Fly-by change, we will return GST_FLOW_NOT_SUPPORTED when we get
skip and crypt cbcs encryption scheme.

* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformInPlace):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (282438 => 282439)


--- trunk/Source/WebCore/ChangeLog	2021-09-15 05:38:27 UTC (rev 282438)
+++ trunk/Source/WebCore/ChangeLog	2021-09-15 06:01:56 UTC (rev 282439)
@@ -1,3 +1,20 @@
+2021-09-14  Xabier Rodriguez Calvar  <[email protected]>
+
+        [GStreamer][EME] Accomodate cbcs as cipher-mode instead of mime
+        https://bugs.webkit.org/show_bug.cgi?id=230265
+
+        Reviewed by Philippe Normand.
+
+        In https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1013
+        it was decided that there should not be x-cbcs as mime type but
+        rather x-cenc with cbcs as cipher-mode.
+
+        Fly-by change, we will return GST_FLOW_NOT_SUPPORTED when we get
+        skip and crypt cbcs encryption scheme.
+
+        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
+        (transformInPlace):
+
 2021-09-14  Rob Buis  <[email protected]>
 
         imported/w3c/web-platform-tests/css/css-sizing/image-min-max-content-intrinsic-size-change* tests fail

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp	2021-09-15 05:38:27 UTC (rev 282438)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp	2021-09-15 06:01:56 UTC (rev 282439)
@@ -220,6 +220,8 @@
         gst_buffer_remove_meta(buffer, reinterpret_cast<GstMeta*>(protectionMeta));
     });
 
+    bool isCbcs = !g_strcmp0(gst_structure_get_string(protectionMeta->info, "cipher-mode"), "cbcs");
+
     unsigned ivSize;
     if (!gst_structure_get_uint(protectionMeta->info, "iv_size", &ivSize)) {
         GST_ERROR_OBJECT(self, "Failed to get iv_size");
@@ -227,6 +229,7 @@
     }
     if (!ivSize && !gst_structure_get_uint(protectionMeta->info, "constant_iv_size", &ivSize)) {
         GST_ERROR_OBJECT(self, "No iv_size and failed to get constant_iv_size");
+        ASSERT(isCbcs);
         return GST_FLOW_NOT_SUPPORTED;
     }
 
@@ -245,8 +248,7 @@
 
     unsigned subSampleCount = 0;
     // cbcs could not include the subsample_count.
-    if (!gst_structure_get_uint(protectionMeta->info, "subsample_count", &subSampleCount)
-        && !gst_structure_has_name(protectionMeta->info, "application/x-cbcs")) {
+    if (!gst_structure_get_uint(protectionMeta->info, "subsample_count", &subSampleCount) && !isCbcs) {
         GST_ERROR_OBJECT(self, "Failed to get subsample_count");
         return GST_FLOW_NOT_SUPPORTED;
     }
@@ -280,8 +282,10 @@
         return GST_FLOW_NOT_SUPPORTED;
     }
 
-    if (gst_structure_has_field(protectionMeta->info, "crypt_byte_block") || gst_structure_has_field(protectionMeta->info, "skip_byte_block"))
+    if (isCbcs && (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");
+        return GST_FLOW_NOT_SUPPORTED;
+    }
 
     GstBuffer* ivBuffer = gst_value_get_buffer(value);
     WebKitMediaCommonEncryptionDecryptClass* klass = WEBKIT_MEDIA_CENC_DECRYPT_GET_CLASS(self);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to