⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 272129 in webkit


Ignore:
Timestamp:
Jan 31, 2021, 11:17:41 PM (6 years ago)
Author:
calvaris@igalia.com
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:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r272128 r272129  
     12021-01-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [GStreamer][EME] Add basic cbcs support
     4        https://bugs.webkit.org/show_bug.cgi?id=221133
     5
     6        Reviewed by Philippe Normand.
     7
     8        Add cbcs as supported encryption scheme.
     9
     10        * platform/graphics/gstreamer/GStreamerCommon.cpp:
     11        (WebCore::capsMediaType):
     12        * platform/graphics/gstreamer/eme/CDMThunder.cpp:
     13        (WebCore::CDMPrivateThunder::supportedInitDataTypes const):
     14        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
     15        (transformInPlace):
     16        * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:
     17
    1182021-01-31  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp

    r271513 r272129  
    184184    }
    185185#if ENABLE(ENCRYPTED_MEDIA)
    186     if (gst_structure_has_name(structure, "application/x-cenc") || gst_structure_has_name(structure, "application/x-webm-enc"))
     186    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"))
    187187        return gst_structure_get_string(structure, "original-media-type");
    188188#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp

    r271437 r272129  
    139139    static Vector<AtomString> supportedInitDataTypes;
    140140    std::call_once(onceFlag, [] {
    141         supportedInitDataTypes.reserveInitialCapacity(3);
     141        supportedInitDataTypes.reserveInitialCapacity(4);
    142142        supportedInitDataTypes.uncheckedAppend(AtomString("keyids"));
    143143        supportedInitDataTypes.uncheckedAppend(AtomString("cenc"));
    144144        supportedInitDataTypes.uncheckedAppend(AtomString("webm"));
     145        supportedInitDataTypes.uncheckedAppend(AtomString("cbcs"));
    145146    });
    146147    return supportedInitDataTypes;
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp

    r271399 r272129  
    239239    }
    240240
     241    if (gst_structure_has_field(protectionMeta->info, "crypt_byte_block") || gst_structure_has_field(protectionMeta->info, "skip_byte_block"))
     242        GST_FIXME_OBJECT(self, "cbcs crypt/skip pattern is still unsupported");
     243
    241244    GstBuffer* ivBuffer = gst_value_get_buffer(value);
    242245    WebKitMediaCommonEncryptionDecryptClass* klass = WEBKIT_MEDIA_CENC_DECRYPT_GET_CLASS(self);
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp

    r271289 r272129  
    4848
    4949static const char* cencEncryptionMediaTypes[] = { "video/mp4", "audio/mp4", "video/x-h264", "audio/mpeg", nullptr };
     50static const char** cbcsEncryptionMediaTypes = cencEncryptionMediaTypes;
    5051static const char* webmEncryptionMediaTypes[] = { "video/webm", "audio/webm", "video/x-vp9", "audio/x-opus", nullptr };
    5152
    … …  
    8485                cencEncryptionMediaTypes[i], "protection-system", G_TYPE_STRING, GStreamerEMEUtilities::keySystemToUuid(keySystem), nullptr));
    8586        }
     87    }
     88
     89    for (int i = 0; cbcsEncryptionMediaTypes[i]; ++i) {
     90        gst_caps_append_structure(caps.get(), gst_structure_new("application/x-cbcs", "original-media-type", G_TYPE_STRING,
     91            cbcsEncryptionMediaTypes[i], nullptr));
    8692    }
    8793
Note: See TracChangeset for help on using the changeset viewer.