Changeset 236104 in webkit


Ignore:
Timestamp:
Sep 18, 2018 2:14:31 AM (6 years ago)
Author:
calvaris@igalia.com
Message:

[EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
https://bugs.webkit.org/show_bug.cgi?id=185590

Reviewed by Philippe Normand.

Source/WebCore:

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):

LayoutTests:

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:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r236096 r236104  
     12018-09-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
     4        https://bugs.webkit.org/show_bug.cgi?id=185590
     5
     6        Reviewed by Philippe Normand.
     7
     8        Updated status of
     9        imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https
     10        and expectations.
     11
     12        * platform/wpe/TestExpectations:
     13        * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt:
     14
    1152018-09-17  Ryan Haddad  <ryanhaddad@apple.com>
    216
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r236064 r236104  
    12121212
    12131213#"waitingforkey" event is not supported yet
    1214 webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html [ Failure ]
    1215 webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.https.html [ Failure ]
    1216 webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html [ Failure ]
    1217 webkit.org/b/185590 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.https.html [ Failure ]
     1214webkit.org/b/189618 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html [ Failure ]
     1215webkit.org/b/189618 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.https.html [ Failure ]
     1216webkit.org/b/189619 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.https.html [ Failure ]
    12181217
    12191218webkit.org/b/185594 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted.https.html [ Failure ]
  • trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt

    r232345 r236104  
    11
    2 Pass    org.w3.clearkey, successful playback, temporary, mp4, waitingforkey event, 1 key
     2PASS org.w3.clearkey, successful playback, temporary, mp4, waitingforkey event, 1 key
    33
  • trunk/Source/WebCore/ChangeLog

    r236103 r236104  
     12018-09-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
     4        https://bugs.webkit.org/show_bug.cgi?id=185590
     5
     6        Reviewed by Philippe Normand.
     7
     8        When decryptors are blocked waiting for the key, instruct the
     9        player to run the Wait for key algorithm. As per spec, if we run
     10        out of blocks pending to decrypt because we don't have the key, we
     11        request running the algorithm again.
     12
     13        Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html.
     14
     15        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     16        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
     17        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     18        (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
     19        (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
     20        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
     21        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
     22        (webkitMediaCommonEncryptionDecryptTransformInPlace):
     23        (webkitMediaCommonEncryptionDecryptSinkEventHandler):
     24
    1252018-09-12  Ryosuke Niwa  <rniwa@webkit.org>
    226
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r235971 r236104  
    13091309            gst_structure_get(structure, "event", GST_TYPE_EVENT, &event.outPtr(), nullptr);
    13101310            handleProtectionEvent(event.get());
     1311        } else if (gst_structure_has_name(structure, "drm-waiting-for-key")) {
     1312            GST_DEBUG("drm-waiting-for-key message from %s", GST_MESSAGE_SRC_NAME(message));
     1313            reportWaitingForKey();
    13111314        } else if (gst_structure_has_name(structure, "drm-cdm-instance-needed")) {
    13121315            GST_DEBUG("drm-cdm-instance-needed message from %s", GST_MESSAGE_SRC_NAME(message));
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r235598 r236104  
    12611261void MediaPlayerPrivateGStreamerBase::initializationDataEncountered(GstEvent* event)
    12621262{
    1263     // FIXME: Inform that we are waiting for a key.
    12641263    const char* eventKeySystemUUID = nullptr;
    12651264    GstBuffer* data = nullptr;
     
    13511350    initializationDataEncountered(event);
    13521351}
     1352
     1353void MediaPlayerPrivateGStreamerBase::reportWaitingForKey()
     1354{
     1355    GST_TRACE("waiting for key");
     1356    m_player->waitingForKey();
     1357}
    13531358#endif
    13541359
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h

    r234688 r236104  
    153153    void dispatchCDMInstance();
    154154    void initializationDataEncountered(GstEvent*);
     155    void reportWaitingForKey();
    155156#endif
    156157
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp

    r235971 r236104  
    3535
    3636    bool keyReceived;
     37    bool waitingForKey { false };
    3738    Lock mutex;
    3839    Condition condition;
     
    198199            return GST_FLOW_NOT_SUPPORTED;
    199200        }
    200         // Send "drm-cdm-instance-needed" message to the player to resend the CDMInstance if available.
     201        // Send "drm-cdm-instance-needed" message to the player to resend the CDMInstance if available and inform we are waiting for key.
    201202        gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("drm-cdm-instance-needed")));
     203        priv->waitingForKey = true;
     204        gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("drm-waiting-for-key")));
    202205
    203206        priv->condition.waitFor(priv->mutex, Seconds(5), [priv] {
     
    304307            GST_DEBUG_OBJECT(self, "key received");
    305308            priv->keyReceived = true;
     309            priv->waitingForKey = false;
    306310            priv->condition.notifyOne();
     311        } else if (priv->waitingForKey) {
     312            GST_DEBUG_OBJECT(self, "still waiting for key, reposting");
     313            gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("drm-waiting-for-key")));
    307314        }
    308315
Note: See TracChangeset for help on using the changeset viewer.