WebKit Bugzilla
Attachment 349889 Details for
Bug 185590
: [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185590-20180917180429.patch (text/plain), 10.26 KB, created by
Xabier RodrÃguez Calvar
on 2018-09-17 09:04:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Xabier RodrÃguez Calvar
Created:
2018-09-17 09:04:31 PDT
Size:
10.26 KB
patch
obsolete
>Subversion Revision: 236037 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 82ada9d39001111836889c5c258e47d82a20a87b..8c4da2c41eac4731b6f34bb1e7c8fb0e0cf643d2 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-09-17 Xabier Rodriguez Calvar <calvaris@igalia.com> >+ >+ [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event >+ https://bugs.webkit.org/show_bug.cgi?id=185590 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When decryptors are blocked waiting for the key, instruct the >+ player to run the Wait for key algorithm. As per spec, if we run >+ out of blocks pending to decrypt because we don't have the key, we >+ request running the algorithm again. >+ >+ Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html. >+ >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::handleMessage): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): >+ (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: >+ * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: >+ (webkitMediaCommonEncryptionDecryptTransformInPlace): >+ (webkitMediaCommonEncryptionDecryptSinkEventHandler): >+ > 2018-09-08 Darin Adler <darin@apple.com> > > Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 330941aa199916ce922ed1ee001cd24541122132..cd2d026bce16b9d1304057b4afd5cd44bd9e0f70 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -1308,6 +1308,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, "drm-waiting-for-key")) { >+ GST_DEBUG("drm-waiting-for-key message from %s", GST_MESSAGE_SRC_NAME(message)); >+ reportWaitingForKey(); > } else if (gst_structure_has_name(structure, "drm-cdm-instance-needed")) { > GST_DEBUG("drm-cdm-instance-needed message from %s", GST_MESSAGE_SRC_NAME(message)); > dispatchCDMInstance(); >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index 6fa43fc5996903acd8de8e973908f8fc6f08fd38..26e6282731394929ed890d224306f025e5266caa 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -1260,7 +1260,6 @@ unsigned MediaPlayerPrivateGStreamerBase::videoDecodedByteCount() const > #if ENABLE(ENCRYPTED_MEDIA) > void MediaPlayerPrivateGStreamerBase::initializationDataEncountered(GstEvent* event) > { >- // FIXME: Inform that we are waiting for a key. > const char* eventKeySystemUUID = nullptr; > GstBuffer* data = nullptr; > gst_event_parse_protection(event, &eventKeySystemUUID, &data, nullptr); >@@ -1350,6 +1349,12 @@ void MediaPlayerPrivateGStreamerBase::handleProtectionEvent(GstEvent* event) > } > initializationDataEncountered(event); > } >+ >+void MediaPlayerPrivateGStreamerBase::reportWaitingForKey() >+{ >+ GST_TRACE("waiting for key"); >+ m_player->waitingForKey(); >+} > #endif > > bool MediaPlayerPrivateGStreamerBase::supportsKeySystem(const String& keySystem, const String& mimeType) >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >index a4f024cd13af0c7f103809a0d63b155e16a3261e..9021a0924c57d14a0703c3e18b264ff85fc6ca7e 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >@@ -152,6 +152,7 @@ public: > void attemptToDecryptWithInstance(CDMInstance&) override; > void dispatchCDMInstance(); > void initializationDataEncountered(GstEvent*); >+ void reportWaitingForKey(); > #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 ca32872bfcd4685846f6d45caea046b95b899cd7..4e35272eddab271d52180c844420b91cfb8a0883 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp >@@ -34,6 +34,7 @@ struct _WebKitMediaCommonEncryptionDecryptPrivate { > GRefPtr<GstEvent> protectionEvent; > > bool keyReceived; >+ bool waitingForKey { false }; > Lock mutex; > Condition condition; > }; >@@ -197,8 +198,10 @@ static GstFlowReturn webkitMediaCommonEncryptionDecryptTransformInPlace(GstBaseT > GST_ERROR_OBJECT(self, "can't process key requests in less than PAUSED state"); > return GST_FLOW_NOT_SUPPORTED; > } >- // Send "drm-cdm-instance-needed" message to the player to resend the CDMInstance if available. >+ // Send "drm-cdm-instance-needed" message to the player to resend the CDMInstance if available and inform we are waiting for key. > gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("drm-cdm-instance-needed"))); >+ priv->waitingForKey = true; >+ gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("drm-waiting-for-key"))); > > priv->condition.waitFor(priv->mutex, Seconds(5), [priv] { > return priv->keyReceived; >@@ -303,7 +306,11 @@ static gboolean webkitMediaCommonEncryptionDecryptSinkEventHandler(GstBaseTransf > if (klass->handleKeyResponse(self, event)) { > GST_DEBUG_OBJECT(self, "key received"); > priv->keyReceived = true; >+ priv->waitingForKey = false; > priv->condition.notifyOne(); >+ } else if (priv->waitingForKey) { >+ GST_DEBUG_OBJECT(self, "still waiting for key, reposting"); >+ gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("drm-waiting-for-key"))); > } > > gst_event_unref(event); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 3fc07f78fe42597a91bb3660a627f51ab4a6a650..d5dfb7cc4fa19efa7710efe23ef6e7008604bbb5 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2018-09-17 Xabier Rodriguez Calvar <calvaris@igalia.com> >+ >+ [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event >+ https://bugs.webkit.org/show_bug.cgi?id=185590 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Updated status of >+ imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https >+ and expectations. >+ >+ * platform/wpe/TestExpectations: >+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt: >+ > 2018-09-17 Sihui Liu <sihui_liu@apple.com> > > Move IndexedDB to Network Process >diff --git a/LayoutTests/platform/wpe/TestExpectations b/LayoutTests/platform/wpe/TestExpectations >index a99c16c8d7047ac11dc4fe603e9a354f9b186f3f..a496b2c942025155878413c530f30ac7952c08c3 100644 >--- a/LayoutTests/platform/wpe/TestExpectations >+++ b/LayoutTests/platform/wpe/TestExpectations >@@ -1211,10 +1211,9 @@ media/encrypted-media/encrypted-media-v2-events.html [ Skip ] > media/encrypted-media/encrypted-media-v2-syntax.html [ Skip ] > > #"waitingforkey" event is not supported yet >-webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html [ Failure ] >-webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.https.html [ Failure ] >-webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html [ Failure ] >-webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.https.html [ Failure ] >+webkit.org/b/189618 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html [ Failure ] >+webkit.org/b/189618 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.https.html [ Failure ] >+webkit.org/b/189619 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.https.html [ Failure ] > > webkit.org/b/185594 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted.https.html [ Failure ] > >diff --git a/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt b/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt >index 08739a679514521d6672778f638a427ab356039d..abdd8510401aab72335dccedd4e924fc66ba3f3f 100644 >--- a/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt >+++ b/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt >@@ -1,3 +1,3 @@ > >-Pass org.w3.clearkey, successful playback, temporary, mp4, waitingforkey event, 1 key >+PASS org.w3.clearkey, successful playback, temporary, mp4, waitingforkey event, 1 key >
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 185590
: 349889