mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
splitmuxsrc: make sure to push sticky events before adding pad
It allows the caps to be set on the pad before being added for dynamic autoplugging to work. https://bugzilla.gnome.org/show_bug.cgi?id=751240
This commit is contained in:
parent
f560a3d223
commit
af6a09ae4c
1 changed files with 31 additions and 0 deletions
|
@ -769,6 +769,30 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
GstSplitMuxSrc *splitmux;
|
||||||
|
SplitMuxSrcPad *splitpad;
|
||||||
|
} SplitMuxAndPad;
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
handle_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
|
||||||
|
{
|
||||||
|
SplitMuxAndPad *splitmux_and_pad;
|
||||||
|
GstSplitMuxSrc *splitmux;
|
||||||
|
SplitMuxSrcPad *splitpad;
|
||||||
|
|
||||||
|
splitmux_and_pad = user_data;
|
||||||
|
splitmux = splitmux_and_pad->splitmux;
|
||||||
|
splitpad = splitmux_and_pad->splitpad;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (splitpad, "handle sticky event %" GST_PTR_FORMAT, *event);
|
||||||
|
gst_event_ref (*event);
|
||||||
|
gst_splitmux_handle_event (splitmux, splitpad, pad, *event);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static GstPad *
|
static GstPad *
|
||||||
gst_splitmux_find_output_pad (GstSplitMuxPartReader * part, GstPad * pad,
|
gst_splitmux_find_output_pad (GstSplitMuxPartReader * part, GstPad * pad,
|
||||||
GstSplitMuxSrc * splitmux)
|
GstSplitMuxSrc * splitmux)
|
||||||
|
@ -790,12 +814,19 @@ gst_splitmux_find_output_pad (GstSplitMuxPartReader * part, GstPad * pad,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target == NULL && !splitmux->pads_complete) {
|
if (target == NULL && !splitmux->pads_complete) {
|
||||||
|
SplitMuxAndPad splitmux_and_pad;
|
||||||
|
|
||||||
/* No pad found, create one */
|
/* No pad found, create one */
|
||||||
target = g_object_new (SPLITMUX_TYPE_SRC_PAD,
|
target = g_object_new (SPLITMUX_TYPE_SRC_PAD,
|
||||||
"name", pad_name, "direction", GST_PAD_SRC, NULL);
|
"name", pad_name, "direction", GST_PAD_SRC, NULL);
|
||||||
splitmux->pads = g_list_prepend (splitmux->pads, target);
|
splitmux->pads = g_list_prepend (splitmux->pads, target);
|
||||||
|
|
||||||
gst_pad_set_active (target, TRUE);
|
gst_pad_set_active (target, TRUE);
|
||||||
|
|
||||||
|
splitmux_and_pad.splitmux = splitmux;
|
||||||
|
splitmux_and_pad.splitpad = (SplitMuxSrcPad *) target;
|
||||||
|
gst_pad_sticky_events_foreach (pad, handle_sticky_events,
|
||||||
|
&splitmux_and_pad);
|
||||||
is_new_pad = TRUE;
|
is_new_pad = TRUE;
|
||||||
}
|
}
|
||||||
SPLITMUX_SRC_PADS_UNLOCK (splitmux);
|
SPLITMUX_SRC_PADS_UNLOCK (splitmux);
|
||||||
|
|
Loading…
Reference in a new issue