Changeset 231636 in webkit
- Timestamp:
- May 10, 2018 12:41:36 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r231633 r231636 1 2018-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 1 26 2018-05-10 Yacine Bandou <yacine.bandou_ext@softathome.com> 2 27 -
trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
r231633 r231636 77 77 static GstPadProbeReturn appendPipelinePadProbeDebugInformation(GstPad*, GstPadProbeInfo*, struct PadProbeInformation*); 78 78 #endif 79 80 #if ENABLE(ENCRYPTED_MEDIA) 81 static GstPadProbeReturn appendPipelineAppsinkPadEventProbe(GstPad*, GstPadProbeInfo*, struct PadProbeInformation*); 82 #endif 83 79 84 static GstPadProbeReturn appendPipelineDemuxerBlackHolePadProbe(GstPad*, GstPadProbeInfo*, gpointer); 80 85 static GstFlowReturn appendPipelineAppsinkNewSample(GstElement*, AppendPipeline*); … … 157 162 #endif 158 163 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 159 170 // These signals won't be connected outside of the lifetime of "this". 160 171 g_signal_connect(m_appsrc.get(), "need-data", G_CALLBACK(appendPipelineAppsrcNeedData), this); … … 225 236 #endif 226 237 238 #if ENABLE(ENCRYPTED_MEDIA) 239 gst_pad_remove_probe(appsinkPad.get(), m_appsinkPadEventProbeInformation.probeId); 240 #endif 227 241 m_appsink = nullptr; 228 242 } … … 1072 1086 #endif 1073 1087 1088 #if ENABLE(ENCRYPTED_MEDIA) 1089 static 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 1074 1109 static GstPadProbeReturn appendPipelineDemuxerBlackHolePadProbe(GstPad*, GstPadProbeInfo* info, gpointer) 1075 1110 { -
trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h
r231633 r231636 33 33 namespace WebCore { 34 34 35 #if !LOG_DISABLED 35 #if !LOG_DISABLED || ENABLE(ENCRYPTED_MEDIA) 36 36 struct PadProbeInformation { 37 37 AppendPipeline* appendPipeline; … … 76 76 GstCaps* demuxerSrcPadCaps() { return m_demuxerSrcPadCaps.get(); } 77 77 GstCaps* appsinkCaps() { return m_appsinkCaps.get(); } 78 MediaPlayerPrivateGStreamerMSE* playerPrivate() { return m_playerPrivate; } 78 79 RefPtr<WebCore::TrackPrivateBase> track() { return m_track; } 79 80 WebCore::MediaSourceStreamTypeGStreamer streamType() { return m_streamType; } … … 131 132 #endif 132 133 134 #if ENABLE(ENCRYPTED_MEDIA) 135 struct PadProbeInformation m_appsinkPadEventProbeInformation; 136 #endif 133 137 // Keeps track of the states of append processing, to avoid performing actions inappropriate for the current state 134 138 // (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.