}
}
+typedef struct
+{
+ GstPad *target_pad;
+ gboolean rewrite_stream_start;
+} CopyEventData;
+
static gboolean
copy_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
{
- GstPad *gpad = GST_PAD_CAST (user_data);
+ CopyEventData *data = user_data;
+ GstPad *gpad = data->target_pad;
+ if (data->rewrite_stream_start &&
+ GST_EVENT_TYPE (*event) == GST_EVENT_STREAM_START) {
+ GstStructure *s;
+ /* This is a temporary hack to notify downstream decodebin3 to *not*
+ * plug in an extra parsebin */
+ *event = gst_event_make_writable (*event);
+ s = (GstStructure *) gst_event_get_structure (*event);
+ gst_structure_set (s, "urisourcebin-parsed-data", G_TYPE_BOOLEAN, TRUE,
+ NULL);
+ }
GST_DEBUG_OBJECT (gpad,
"store sticky event from %" GST_PTR_FORMAT " %" GST_PTR_FORMAT, pad,
*event);
gst_element_sync_state_with_parent (info->multiqueue);
}
-static gboolean
-mark_stream_start_parsed (GstPad * pad, GstEvent ** event, gpointer user_data)
-{
- if (GST_EVENT_TYPE (*event) == GST_EVENT_STREAM_START) {
- GstStructure *s;
- *event = gst_event_make_writable (*event);
- s = (GstStructure *) gst_event_get_structure (*event);
- gst_structure_set (s, "urisourcebin-parsed-data", G_TYPE_BOOLEAN, TRUE,
- NULL);
- }
- return TRUE;
-}
-
/* Called with lock held */
static OutputSlotInfo *
new_output_slot (ChildSrcPadInfo * info, GstPad * originating_pad)
GstElement *queue = NULL;
const gchar *elem_name;
gboolean use_downloadbuffer;
+ CopyEventData copy_data = { 0, };
GST_DEBUG_OBJECT (urisrc,
"use_queue2:%d use_downloadbuffer:%d, demuxer:%d, originating_pad:%"
slot->queue_sinkpad =
gst_element_request_pad_simple (info->multiqueue, "sink_%u");
srcpad = gst_pad_get_single_internal_link (slot->queue_sinkpad);
- if (urisrc->is_adaptive || (slot->linked_info
- && slot->linked_info->demuxer_is_parsebin)) {
- /* This is a temporary hack to notify downstream decodebin3 to *not*
- * plug in an extra parsebin */
- gst_pad_sticky_events_foreach (originating_pad, mark_stream_start_parsed,
- NULL);
+ if (urisrc->is_adaptive || (info->demuxer_is_parsebin)) {
+ copy_data.rewrite_stream_start = TRUE;
}
- gst_pad_sticky_events_foreach (originating_pad, copy_sticky_events, srcpad);
+ copy_data.target_pad = slot->queue_sinkpad;
+ gst_pad_sticky_events_foreach (originating_pad, copy_sticky_events,
+ ©_data);
+ copy_data.target_pad = srcpad;
+ gst_pad_sticky_events_foreach (originating_pad, copy_sticky_events,
+ ©_data);
+
+ }
+
slot->output_pad = create_output_pad (slot, srcpad);
gst_object_unref (srcpad);
gst_pad_link (originating_pad, slot->queue_sinkpad);
expose_output_pad (GstURISourceBin * urisrc, GstPad * pad)
{
GstPad *target;
+ CopyEventData copy_data = { 0, };
if (gst_object_has_as_parent (GST_OBJECT (pad), GST_OBJECT (urisrc)))
return; /* Pad is already exposed */
target = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
gst_pad_set_active (pad, TRUE);
- gst_pad_sticky_events_foreach (target, copy_sticky_events, pad);
+ copy_data.target_pad = pad;
+ gst_pad_sticky_events_foreach (target, copy_sticky_events, ©_data);
gst_object_unref (target);
GST_URI_SOURCE_BIN_LOCK (urisrc);