Changeset 279285 in webkit
- Timestamp:
- Jun 25, 2021, 8:39:12 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r279284 r279285 1 2021-06-25 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] TextCombiner has unlinked internal encoders 4 https://bugs.webkit.org/show_bug.cgi?id=227362 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Each combiner pad can receive multiple caps events for the same stream, so we can't really 9 rely on those to modify the internal topology of the combiner. Instead we can check the 10 sticky events from the pad chain function, this is done at most once per pad. In case a caps 11 event was sticked to the pad, the combiner now reacts properly. 12 13 This issue was detected while running 14 media/track/in-band/track-in-band-kate-ogg-cues-added-once.html with playbin3 enabled. 6 15 different encoders where added to the combiner while only 2 are needed actually. 16 17 * platform/graphics/gstreamer/TextCombinerGStreamer.cpp: 18 (webKitTextCombinerHandleCaps): 19 * platform/graphics/gstreamer/TextCombinerGStreamer.h: 20 * platform/graphics/gstreamer/TextCombinerPadGStreamer.cpp: 21 (webkitTextCombinerPadChain): 22 (webkitTextCombinerPadConstructed): 23 1 24 2021-06-17 Sergio Villar Senin <svillar@igalia.com> 2 25 -
trunk/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp
r277947 r279285 51 51 using namespace WebCore; 52 52 53 void webKitTextCombinerHandleCapsEvent(WebKitTextCombiner* combiner, GstPad* pad, GstEvent* event) 54 { 55 GstCaps* caps; 56 gst_event_parse_caps(event, &caps); 53 void webKitTextCombinerHandleCaps(WebKitTextCombiner* combiner, GstPad* pad, const GstCaps* caps) 54 { 57 55 ASSERT(caps); 58 56 GST_DEBUG_OBJECT(combiner, "Handling caps %" GST_PTR_FORMAT, caps); -
trunk/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.h
r271512 r279285 57 57 GstElement* webkitTextCombinerNew(); 58 58 59 void webKitTextCombinerHandleCaps Event(WebKitTextCombiner*, GstPad*, GstEvent*);59 void webKitTextCombinerHandleCaps(WebKitTextCombiner*, GstPad*, const GstCaps*); 60 60 61 61 #endif // ENABLE(VIDEO) && USE(GSTREAMER) -
trunk/Source/WebCore/platform/graphics/gstreamer/TextCombinerPadGStreamer.cpp
r278655 r279285 37 37 GRefPtr<GstTagList> tags; 38 38 GRefPtr<GstPad> innerCombinerPad; 39 bool shouldProcessStickyEvents { true }; 39 40 }; 40 41 … … 54 55 { 55 56 switch (GST_EVENT_TYPE(event)) { 56 case GST_EVENT_CAPS:57 webKitTextCombinerHandleCapsEvent(WEBKIT_TEXT_COMBINER(parent), pad, event);58 break;59 57 case GST_EVENT_TAG: { 60 58 auto* combinerPad = WEBKIT_TEXT_COMBINER_PAD(pad); … … 78 76 } 79 77 return gst_pad_event_default(pad, parent, event); 78 } 79 80 static GstFlowReturn webkitTextCombinerPadChain(GstPad* pad, GstObject* parent, GstBuffer* buffer) 81 { 82 auto* combinerPad = WEBKIT_TEXT_COMBINER_PAD(pad); 83 84 if (combinerPad->priv->shouldProcessStickyEvents) { 85 gst_pad_sticky_events_foreach(pad, [](GstPad* pad, GstEvent** event, gpointer) -> gboolean { 86 if (GST_EVENT_TYPE(*event) != GST_EVENT_CAPS) 87 return TRUE; 88 89 auto* combinerPad = WEBKIT_TEXT_COMBINER_PAD(pad); 90 auto parent = adoptGRef(gst_pad_get_parent(pad)); 91 GstCaps* caps; 92 gst_event_parse_caps(*event, &caps); 93 combinerPad->priv->shouldProcessStickyEvents = false; 94 webKitTextCombinerHandleCaps(WEBKIT_TEXT_COMBINER(parent.get()), pad, caps); 95 return FALSE; 96 }, nullptr); 97 } 98 99 return gst_proxy_pad_chain_default(pad, parent, buffer); 80 100 } 81 101 … … 121 141 gst_ghost_pad_construct(GST_GHOST_PAD(object)); 122 142 gst_pad_set_event_function(GST_PAD_CAST(object), webkitTextCombinerPadEvent); 143 gst_pad_set_chain_function(GST_PAD_CAST(object), webkitTextCombinerPadChain); 123 144 } 124 145
Note:
See TracChangeset
for help on using the changeset viewer.