WebKit Bugzilla
Attachment 338876 Details for
Bug 181858
: [EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-181858-20180426180801.patch (text/plain), 5.83 KB, created by
Yacine Bandou
on 2018-04-26 09:08:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yacine Bandou
Created:
2018-04-26 09:08:02 PDT
Size:
5.83 KB
patch
obsolete
>Subversion Revision: 231044 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 37e4baa2af62dcee7ecff21e0628d388a3d98e24..8451398842a94597fed90463e65ec206b3444602 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-01-19 Yacine Bandou <yacine.bandou_ext@softathome.com> >+ >+ [EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application. >+ https://bugs.webkit.org/show_bug.cgi?id=181858 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key. >+ This message should be handled by the application in order to dispatch or send the key to the decryptor. >+ This patch is a preparation for the patch 181855. >+ With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can >+ get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline. >+ When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend >+ the DRM license or key by using this new message "decrypt-key-needed". >+ >+ >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::handleMessage): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: >+ * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: >+ (webkitMediaCommonEncryptionDecryptTransformInPlace): >+ > 2018-01-17 Yacine Bandou <yacine.bandou_ext@softathome.com> > > [EME] Add support of multi keys from different sessions in CDMinstanceClearKey >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 784c9617db37a8e87ce27c3d4b7bda79659c6d8c..36a95262ef4277a9acb5f6eeabb63e85c4188645 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -1245,6 +1245,9 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message) > GRefPtr<GstEvent> event; > gst_structure_get(structure, "event", GST_TYPE_EVENT, &event.outPtr(), nullptr); > handleProtectionEvent(event.get()); >+ } else if (gst_structure_has_name(structure, "decrypt-key-needed")) { >+ GST_DEBUG("decrypt-key-needed message from %s", GST_MESSAGE_SRC_NAME(message)); >+ MediaPlayerPrivateGStreamerBase::dispatchCDMInstance(); > } > #endif > else if (gst_structure_has_name(structure, "http-headers")) { >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index 8e476ff410592410dc2684aa3a5f7b62c3ed30dc..1557475e95fb6832105ba8d7938ca2486a90a4fd 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -1244,6 +1244,13 @@ void MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey(GstBuffer* buffer) > GST_TRACE("emitted decryption cipher key on pipeline, event handled %s, need to resend credentials %s", boolForPrinting(eventHandled), boolForPrinting(m_needToResendCredentials)); > } > >+void MediaPlayerPrivateGStreamerBase::dispatchCDMInstance() >+{ >+ // This function dispatches the CDMInstance in GStreamer playback pipeline. >+ if (m_cdmInstance) >+ m_player->attemptToDecryptWithInstance(const_cast<CDMInstance&>(*m_cdmInstance.get())); >+} >+ > void MediaPlayerPrivateGStreamerBase::handleProtectionEvent(GstEvent* event) > { > if (m_handledProtectionEvents.contains(GST_EVENT_SEQNUM(event))) { >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >index 8e8db7fa1ecb9d715377215e275d061a316118c0..64ffb8def3de5a1ffd1df510c33bd758f0916eaa 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >@@ -143,6 +143,7 @@ public: > void handleProtectionEvent(GstEvent*); > void attemptToDecryptWithLocalInstance(); > void attemptToDecryptWithInstance(CDMInstance&) override; >+ void dispatchCDMInstance(); > #endif > > static bool supportsKeySystem(const String& keySystem, const String& mimeType); >diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >index f420af93e0fc799635f570b61770d0bf77f2473f..33a330aaf6462c607bf5938b0f37689b9f7860be 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >@@ -197,6 +197,9 @@ static GstFlowReturn webkitMediaCommonEncryptionDecryptTransformInPlace(GstBaseT > GST_ERROR_OBJECT(self, "can't process key requests in less than PAUSED state"); > return GST_FLOW_NOT_SUPPORTED; > } >+ // Send "decrypt-key-needed" message to the application in order to resend the key if it is available in the application. >+ gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("decrypt-key-needed"))); >+ > priv->condition.waitFor(priv->mutex, Seconds(5), [priv] { > return priv->keyReceived; > });
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 181858
:
331738
|
331918
|
331919
| 338876