WebKit Bugzilla
Attachment 339948 Details for
Bug 185245
: [EME][GStreamer] Add a handler for GStreamer protection event
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185245-20180509122139.patch (text/plain), 6.56 KB, created by
Yacine Bandou
on 2018-05-09 03:21:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yacine Bandou
Created:
2018-05-09 03:21:37 PDT
Size:
6.56 KB
patch
obsolete
>Subversion Revision: 231044 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dd0ed1c037a897dc2f6d1be88c17ea79062922d1..a7f9baa4a8e0843abc25e8402614cfbf2b336450 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2018-05-04 Yacine Bandou <yacine.bandou_ext@softathome.com> >+ >+ [EME][GStreamer] Add a handler for GStreamer protection event >+ https://bugs.webkit.org/show_bug.cgi?id=185245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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. >+ This patch doesn't yet dispatch the protection event to MediaPlayer, see Bug 185420. >+ >+ * platform/graphics/gstreamer/mse/AppendPipeline.cpp: >+ (WebCore::AppendPipeline::AppendPipeline): >+ (WebCore::AppendPipeline::~AppendPipeline): >+ (WebCore::appendPipelineAppsinkPadEventProbe): >+ * platform/graphics/gstreamer/mse/AppendPipeline.h: >+ (WebCore::AppendPipeline::playerPrivate): >+ > 2018-05-03 Yacine Bandou <yacine.bandou_ext@softathome.com> > > [EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >index 691f0c8ac593d4ee49ed8448a83129074d1e996c..83662c205138e1df61f479baefde7f852d8f0c0a 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >@@ -76,6 +76,11 @@ static GstPadProbeReturn appendPipelineAppsrcDataLeaving(GstPad*, GstPadProbeInf > #if !LOG_DISABLED > static GstPadProbeReturn appendPipelinePadProbeDebugInformation(GstPad*, GstPadProbeInfo*, struct PadProbeInformation*); > #endif >+ >+#if ENABLE(ENCRYPTED_MEDIA) >+static GstPadProbeReturn appendPipelineAppsinkPadEventProbe(GstPad*, GstPadProbeInfo*, struct PadProbeInformation*); >+#endif >+ > static GstPadProbeReturn appendPipelineDemuxerBlackHolePadProbe(GstPad*, GstPadProbeInfo*, gpointer); > static GstFlowReturn appendPipelineAppsinkNewSample(GstElement*, AppendPipeline*); > static void appendPipelineAppsinkEOS(GstElement*, AppendPipeline*); >@@ -156,6 +161,12 @@ AppendPipeline::AppendPipeline(Ref<MediaSourceClientGStreamerMSE> mediaSourceCli > m_appsinkDataEnteringPadProbeInformation.probeId = gst_pad_add_probe(appsinkPad.get(), GST_PAD_PROBE_TYPE_BUFFER, reinterpret_cast<GstPadProbeCallback>(appendPipelinePadProbeDebugInformation), &m_appsinkDataEnteringPadProbeInformation, nullptr); > #endif > >+#if ENABLE(ENCRYPTED_MEDIA) >+ m_appsinkPadEventProbeInformation.appendPipeline = this; >+ m_appsinkPadEventProbeInformation.description = "appsink event probe"; >+ m_appsinkPadEventProbeInformation.probeId = gst_pad_add_probe(appsinkPad.get(), GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, reinterpret_cast<GstPadProbeCallback>(appendPipelineAppsinkPadEventProbe), &m_appsinkPadEventProbeInformation, nullptr); >+#endif >+ > // These signals won't be connected outside of the lifetime of "this". > g_signal_connect(m_appsrc.get(), "need-data", G_CALLBACK(appendPipelineAppsrcNeedData), this); > g_signal_connect(m_demux.get(), "pad-added", G_CALLBACK(appendPipelineDemuxerPadAdded), this); >@@ -224,6 +235,9 @@ AppendPipeline::~AppendPipeline() > gst_pad_remove_probe(appsinkPad.get(), m_appsinkDataEnteringPadProbeInformation.probeId); > #endif > >+#if ENABLE(ENCRYPTED_MEDIA) >+ gst_pad_remove_probe(appsinkPad.get(), m_appsinkPadEventProbeInformation.probeId); >+#endif > m_appsink = nullptr; > } > >@@ -1071,6 +1085,26 @@ static GstPadProbeReturn appendPipelinePadProbeDebugInformation(GstPad*, GstPadP > } > #endif > >+#if ENABLE(ENCRYPTED_MEDIA) >+static GstPadProbeReturn appendPipelineAppsinkPadEventProbe(GstPad*, GstPadProbeInfo* info, struct PadProbeInformation*) >+{ >+ ASSERT(GST_PAD_PROBE_INFO_TYPE(info) & GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM); >+ GstEvent* event = gst_pad_probe_info_get_event(info); >+ GST_TRACE("Handling event %s on append pipeline appsinkPad", GST_EVENT_TYPE_NAME(event)); >+ >+ switch (GST_EVENT_TYPE(event)) { >+ case GST_EVENT_PROTECTION: >+ // FIXME: Dispatch the protection event to the MediaPlayer. See bug 185420 >+ GST_DEBUG("The protection event isn't yet dispatched to the MediaPlayer"); >+ return GST_PAD_PROBE_DROP; >+ default: >+ break; >+ } >+ >+ return GST_PAD_PROBE_OK; >+} >+#endif >+ > static GstPadProbeReturn appendPipelineDemuxerBlackHolePadProbe(GstPad*, GstPadProbeInfo* info, gpointer) > { > ASSERT(GST_PAD_PROBE_INFO_TYPE(info) & GST_PAD_PROBE_TYPE_BUFFER); >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h >index 995c12975d94ec4c007ffeb2d79cfa7a45f53894..9ff8a154d998aa9cc49ec1434115eb76d945564d 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h >@@ -32,7 +32,7 @@ > > namespace WebCore { > >-#if !LOG_DISABLED >+#if !LOG_DISABLED || ENABLE(ENCRYPTED_MEDIA) > struct PadProbeInformation { > AppendPipeline* appendPipeline; > const char* description; >@@ -75,6 +75,7 @@ public: > GstElement* appsink() { return m_appsink.get(); } > GstCaps* demuxerSrcPadCaps() { return m_demuxerSrcPadCaps.get(); } > GstCaps* appsinkCaps() { return m_appsinkCaps.get(); } >+ MediaPlayerPrivateGStreamerMSE* playerPrivate() { return m_playerPrivate; } > RefPtr<WebCore::TrackPrivateBase> track() { return m_track; } > WebCore::MediaSourceStreamTypeGStreamer streamType() { return m_streamType; } > >@@ -130,6 +131,9 @@ private: > struct PadProbeInformation m_appsinkDataEnteringPadProbeInformation; > #endif > >+#if ENABLE(ENCRYPTED_MEDIA) >+ struct PadProbeInformation m_appsinkPadEventProbeInformation; >+#endif > // Keeps track of the states of append processing, to avoid performing actions inappropriate for the current state > // (eg: processing more samples when the last one has been detected, etc.). See setAppendState() for valid > // transitions.
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 185245
:
339550
|
339713
|
339813
|
339948