Changeset 231636 in webkit


Ignore:
Timestamp:
May 10, 2018 12:41:36 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[EME][GStreamer] Add a handler for GStreamer protection event
https://bugs.webkit.org/show_bug.cgi?id=185245

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

Qtdemux sends the protection event when encountered a new PSSH box (encrypted content).

The Decryptor is moved from AppendPipeline to PlaybackPipeline (see https://bugs.webkit.org/show_bug.cgi?id=181855),
thus the protection event is no longer handled because the Decryptor is not in the same pipeline as qtdemux.

AppendPipeline: httpsrc-->qtdemux-->appsink
PlaybackPipeline: appsrc-->parser--> decryptor-->decoder-->sink

This patch attaches a probe to the sink pad of the appsink in the appendPipeline in order to
catch and manage the protection event.

  • platform/graphics/gstreamer/mse/AppendPipeline.cpp:

(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::appendPipelineAppsinkPadEventProbe):

  • platform/graphics/gstreamer/mse/AppendPipeline.h:

(WebCore::AppendPipeline::playerPrivate):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r231633 r231636  
     12018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
     2
     3        [EME][GStreamer] Add a handler for GStreamer protection event
     4        https://bugs.webkit.org/show_bug.cgi?id=185245
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Qtdemux sends the protection event when encountered a new PSSH box (encrypted content).
     9
     10        The Decryptor is moved from AppendPipeline to PlaybackPipeline (see https://bugs.webkit.org/show_bug.cgi?id=181855),
     11        thus the protection event is no longer handled because the Decryptor is not in the same pipeline as qtdemux.
     12
     13        AppendPipeline: httpsrc-->qtdemux-->appsink
     14        PlaybackPipeline: appsrc-->parser--> decryptor-->decoder-->sink
     15
     16        This patch attaches a probe to the sink pad of the appsink in the appendPipeline in order to
     17        catch and manage the protection event.
     18
     19        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
     20        (WebCore::AppendPipeline::AppendPipeline):
     21        (WebCore::AppendPipeline::~AppendPipeline):
     22        (WebCore::appendPipelineAppsinkPadEventProbe):
     23        * platform/graphics/gstreamer/mse/AppendPipeline.h:
     24        (WebCore::AppendPipeline::playerPrivate):
     25
    1262018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
    227
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp

    r231633 r231636  
    7777static GstPadProbeReturn appendPipelinePadProbeDebugInformation(GstPad*, GstPadProbeInfo*, struct PadProbeInformation*);
    7878#endif
     79
     80#if ENABLE(ENCRYPTED_MEDIA)
     81static GstPadProbeReturn appendPipelineAppsinkPadEventProbe(GstPad*, GstPadProbeInfo*, struct PadProbeInformation*);
     82#endif
     83
    7984static GstPadProbeReturn appendPipelineDemuxerBlackHolePadProbe(GstPad*, GstPadProbeInfo*, gpointer);
    8085static GstFlowReturn appendPipelineAppsinkNewSample(GstElement*, AppendPipeline*);
     
    157162#endif
    158163
     164#if ENABLE(ENCRYPTED_MEDIA)
     165    m_appsinkPadEventProbeInformation.appendPipeline = this;
     166    m_appsinkPadEventProbeInformation.description = "appsink event probe";
     167    m_appsinkPadEventProbeInformation.probeId = gst_pad_add_probe(appsinkPad.get(), GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, reinterpret_cast<GstPadProbeCallback>(appendPipelineAppsinkPadEventProbe), &m_appsinkPadEventProbeInformation, nullptr);
     168#endif
     169
    159170    // These signals won't be connected outside of the lifetime of "this".
    160171    g_signal_connect(m_appsrc.get(), "need-data", G_CALLBACK(appendPipelineAppsrcNeedData), this);
     
    225236#endif
    226237
     238#if ENABLE(ENCRYPTED_MEDIA)
     239        gst_pad_remove_probe(appsinkPad.get(), m_appsinkPadEventProbeInformation.probeId);
     240#endif
    227241        m_appsink = nullptr;
    228242    }
     
    10721086#endif
    10731087
     1088#if ENABLE(ENCRYPTED_MEDIA)
     1089static GstPadProbeReturn appendPipelineAppsinkPadEventProbe(GstPad*, GstPadProbeInfo* info, struct PadProbeInformation *padProbeInformation)
     1090{
     1091    ASSERT(GST_PAD_PROBE_INFO_TYPE(info) & GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM);
     1092    GstEvent* event = gst_pad_probe_info_get_event(info);
     1093    GST_DEBUG("Handling event %s on append pipeline appsinkPad", GST_EVENT_TYPE_NAME(event));
     1094    WebCore::AppendPipeline* appendPipeline = padProbeInformation->appendPipeline;
     1095
     1096    switch (GST_EVENT_TYPE(event)) {
     1097    case GST_EVENT_PROTECTION:
     1098        if (appendPipeline && appendPipeline->playerPrivate())
     1099            appendPipeline->playerPrivate()->handleProtectionEvent(event);
     1100        return GST_PAD_PROBE_DROP;
     1101    default:
     1102        break;
     1103    }
     1104
     1105    return GST_PAD_PROBE_OK;
     1106}
     1107#endif
     1108
    10741109static GstPadProbeReturn appendPipelineDemuxerBlackHolePadProbe(GstPad*, GstPadProbeInfo* info, gpointer)
    10751110{
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h

    r231633 r231636  
    3333namespace WebCore {
    3434
    35 #if !LOG_DISABLED
     35#if !LOG_DISABLED || ENABLE(ENCRYPTED_MEDIA)
    3636struct PadProbeInformation {
    3737    AppendPipeline* appendPipeline;
     
    7676    GstCaps* demuxerSrcPadCaps() { return m_demuxerSrcPadCaps.get(); }
    7777    GstCaps* appsinkCaps() { return m_appsinkCaps.get(); }
     78    MediaPlayerPrivateGStreamerMSE* playerPrivate() { return m_playerPrivate; }
    7879    RefPtr<WebCore::TrackPrivateBase> track() { return m_track; }
    7980    WebCore::MediaSourceStreamTypeGStreamer streamType() { return m_streamType; }
     
    131132#endif
    132133
     134#if ENABLE(ENCRYPTED_MEDIA)
     135    struct PadProbeInformation m_appsinkPadEventProbeInformation;
     136#endif
    133137    // Keeps track of the states of append processing, to avoid performing actions inappropriate for the current state
    134138    // (eg: processing more samples when the last one has been detected, etc.). See setAppendState() for valid
Note: See TracChangeset for help on using the changeset viewer.