Changeset 231088 in webkit


Ignore:
Timestamp:
Apr 27, 2018 12:27:45 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[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

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-04-27
Reviewed by Xabier Rodriguez-Calvar.

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

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r231084 r231088  
     12018-04-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
     2
     3        [EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
     4        https://bugs.webkit.org/show_bug.cgi?id=181858
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key.
     9        This message should be handled by the application in order to dispatch or send the key to the decryptor.
     10        This patch is a preparation for the patch 181855.
     11        With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can
     12        get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline.
     13        When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend
     14        the DRM license or key by using this new message "decrypt-key-needed".
     15
     16
     17        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     18        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
     19        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     20        (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance):
     21        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
     22        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
     23        (webkitMediaCommonEncryptionDecryptTransformInPlace):
     24
    1252018-04-26  Justin Fan  <justin_fan@apple.com>
    226
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r230625 r231088  
    12461246            gst_structure_get(structure, "event", GST_TYPE_EVENT, &event.outPtr(), nullptr);
    12471247            handleProtectionEvent(event.get());
     1248        } else if (gst_structure_has_name(structure, "decrypt-key-needed")) {
     1249            GST_DEBUG("decrypt-key-needed message from %s", GST_MESSAGE_SRC_NAME(message));
     1250            MediaPlayerPrivateGStreamerBase::dispatchCDMInstance();
    12481251        }
    12491252#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r230629 r231088  
    12451245}
    12461246
     1247void MediaPlayerPrivateGStreamerBase::dispatchCDMInstance()
     1248{
     1249    // This function dispatches the CDMInstance in GStreamer playback pipeline.
     1250    if (m_cdmInstance)
     1251        m_player->attemptToDecryptWithInstance(const_cast<CDMInstance&>(*m_cdmInstance.get()));
     1252}
     1253
    12471254void MediaPlayerPrivateGStreamerBase::handleProtectionEvent(GstEvent* event)
    12481255{
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h

    r230629 r231088  
    144144    void attemptToDecryptWithLocalInstance();
    145145    void attemptToDecryptWithInstance(CDMInstance&) override;
     146    void dispatchCDMInstance();
    146147#endif
    147148
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp

    r230625 r231088  
    198198            return GST_FLOW_NOT_SUPPORTED;
    199199        }
     200        // Send "decrypt-key-needed" message to the application in order to resend the key if it is available in the application.
     201        gst_element_post_message(GST_ELEMENT(self), gst_message_new_element(GST_OBJECT(self), gst_structure_new_empty("decrypt-key-needed")));
     202
    200203        priv->condition.waitFor(priv->mutex, Seconds(5), [priv] {
    201204            return priv->keyReceived;
Note: See TracChangeset for help on using the changeset viewer.