WebKit Bugzilla
Attachment 348768 Details for
Bug 189239
: [EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189239-20180903154841.patch (text/plain), 8.48 KB, created by
Yacine Bandou
on 2018-09-03 06:48:42 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yacine Bandou
Created:
2018-09-03 06:48:42 PDT
Size:
8.48 KB
patch
obsolete
>Subversion Revision: 235549 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dfdee06569e14cded91fe744c9f35e7dd34cba3e..c0c33ed2d31fbb77ee15b61876f3525ab2a5e9e1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-09-03 Yacine Bandou <yacine.bandou_ext@softathome.com> >+ >+ [EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc" >+ https://bugs.webkit.org/show_bug.cgi?id=189239 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add the support of GStreamer caps "application/x-webm-enc" in GStreamerCommon. >+ >+ The DRM system id field in the encrypted event is set to "UNDEFINED" in case of WebM, for details, >+ see https://bugzilla.gnome.org/attachment.cgi?id=365211 >+ >+ Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-eventmse.html >+ media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html >+ >+ * platform/graphics/gstreamer/GStreamerCommon.cpp: >+ (WebCore::capsMediaType): >+ (WebCore::areEncryptedCaps): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): >+ * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: >+ * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: >+ (webkitMediaCommonEncryptionDecryptTransformCaps): >+ > 2018-08-31 Enrique Ocaña González <eocanha@igalia.com> > > [GStreamer][MSE][webm] Support repetitive appending of the same webm segment >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >index 62353e4f3e6847f9f0ced35de246b051a82dd963..67f0d348b9d59fe5abfea2a07be046edc0cda6d2 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >@@ -173,7 +173,7 @@ const char* capsMediaType(const GstCaps* caps) > return nullptr; > } > #if ENABLE(ENCRYPTED_MEDIA) >- if (gst_structure_has_name(structure, "application/x-cenc")) >+ if (gst_structure_has_name(structure, "application/x-cenc") || 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); >@@ -198,7 +198,7 @@ bool areEncryptedCaps(const GstCaps* caps) > GST_WARNING("caps are empty"); > return false; > } >- return gst_structure_has_name(structure, "application/x-cenc"); >+ return (gst_structure_has_name(structure, "application/x-cenc") || gst_structure_has_name(structure, "application/x-webm-enc")); > #else > UNUSED_PARAM(caps); > return false; >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index bd6f29d0b28b45ed15dd05fecf337cbe114284f2..178bb78c9df811026e60e8a85e33a44d81069f94 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -1268,7 +1268,7 @@ void MediaPlayerPrivateGStreamerBase::initializationDataEncountered(GstEvent* ev > // 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(GStreamerEMEUtilities::keySystemToUuid(m_cdmInstance->keySystem()), eventKeySystemUUID)) { >+ if (m_cdmInstance && g_strcmp0(eventKeySystemUUID, "UNDEFINED") && 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; > } >@@ -1290,7 +1290,11 @@ void MediaPlayerPrivateGStreamerBase::initializationDataEncountered(GstEvent* ev > > 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("cenc"_s, ArrayBuffer::create(reinterpret_cast<const uint8_t*>(initData.characters8()), initData.sizeInBytes())); >+ if (eventKeySystemUUID == "UNDEFINED") >+ weakThis->m_player->initializationDataEncountered("webm"_s, ArrayBuffer::create(reinterpret_cast<const uint8_t*>(initData.characters8()), initData.sizeInBytes())); >+ else >+ weakThis->m_player->initializationDataEncountered("cenc"_s, ArrayBuffer::create(reinterpret_cast<const uint8_t*>(initData.characters8()), initData.sizeInBytes())); >+ > }); > } > >diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp >index 7665ad67ce3aec2e6a5d0e91b6c69d915c1dbd3f..8ae3a5636329f4bdb8fb26d1d988c3137cfe7fcb 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp >@@ -56,12 +56,14 @@ static GstStaticPadTemplate sinkTemplate = GST_STATIC_PAD_TEMPLATE("sink", > GST_PAD_SINK, > GST_PAD_ALWAYS, > GST_STATIC_CAPS("application/x-cenc, original-media-type=(string)video/x-h264, protection-system=(string)" WEBCORE_GSTREAMER_EME_UTILITIES_CLEARKEY_UUID "; " >- "application/x-cenc, original-media-type=(string)audio/mpeg, protection-system=(string)" WEBCORE_GSTREAMER_EME_UTILITIES_CLEARKEY_UUID)); >+ "application/x-cenc, original-media-type=(string)audio/mpeg, protection-system=(string)" WEBCORE_GSTREAMER_EME_UTILITIES_CLEARKEY_UUID";" >+ "application/x-webm-enc, original-media-type=(string)video/x-vp8;" >+ "application/x-webm-enc, original-media-type=(string)video/x-vp9;")); > > static GstStaticPadTemplate srcTemplate = GST_STATIC_PAD_TEMPLATE("src", > GST_PAD_SRC, > GST_PAD_ALWAYS, >- GST_STATIC_CAPS("video/x-h264; audio/mpeg")); >+ GST_STATIC_CAPS("video/x-h264; audio/mpeg; video/x-vp8; video/x-vp9")); > > #define webkit_media_clear_key_decrypt_parent_class parent_class > G_DEFINE_TYPE(WebKitMediaClearKeyDecrypt, webkit_media_clear_key_decrypt, WEBKIT_TYPE_MEDIA_CENC_DECRYPT); >diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >index 8d1b84e6e1b9861e4e9d385ced1d90beaa3f15a5..55ce95dbd8b8acfbd6288bcbd6836d418326f738 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >@@ -126,7 +126,10 @@ static GstCaps* webkitMediaCommonEncryptionDecryptTransformCaps(GstBaseTransform > const gchar* fieldName = gst_structure_nth_field_name(incomingStructure, j); > > if (g_str_has_prefix(fieldName, "protection-system") >- || g_str_has_prefix(fieldName, "original-media-type")) >+ || g_str_has_prefix(fieldName, "original-media-type") >+ || g_str_has_prefix(fieldName, "encryption-algorithm") >+ || g_str_has_prefix(fieldName, "encoding-scope") >+ || g_str_has_prefix(fieldName, "cipher-mode")) > gst_structure_remove_field(outgoingStructure.get(), fieldName); > } > } else { >@@ -155,7 +158,10 @@ static GstCaps* webkitMediaCommonEncryptionDecryptTransformCaps(GstBaseTransform > 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_structure_set_name(outgoingStructure.get(), "application/x-cenc"); >+ if (!g_strcmp0(klass->protectionSystemId, "UNDEFINED")) >+ gst_structure_set_name(outgoingStructure.get(), "application/x-webm-enc"); >+ else >+ gst_structure_set_name(outgoingStructure.get(), "application/x-cenc"); > } > > bool duplicate = false;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189239
:
348768
|
351539
|
351599
|
351765
|
351771