mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
tagdemux: Add support for group-id in the stream-start event
This commit is contained in:
parent
fc79a688f5
commit
b4365551d0
1 changed files with 22 additions and 2 deletions
|
@ -346,6 +346,9 @@ gst_tag_demux_set_src_caps (GstTagDemux * tagdemux, GstCaps * new_caps)
|
|||
GstCaps *old_caps = tagdemux->priv->src_caps;
|
||||
|
||||
if (old_caps == NULL || !gst_caps_is_equal (new_caps, old_caps)) {
|
||||
GstEvent *event;
|
||||
guint group_id;
|
||||
gboolean have_group_id;
|
||||
gchar *stream_id = gst_pad_create_stream_id (tagdemux->priv->srcpad,
|
||||
GST_ELEMENT_CAST (tagdemux), NULL);
|
||||
|
||||
|
@ -354,8 +357,25 @@ gst_tag_demux_set_src_caps (GstTagDemux * tagdemux, GstCaps * new_caps)
|
|||
GST_DEBUG_OBJECT (tagdemux, "Changing src pad caps to %" GST_PTR_FORMAT,
|
||||
tagdemux->priv->src_caps);
|
||||
|
||||
gst_pad_push_event (tagdemux->priv->srcpad,
|
||||
gst_event_new_stream_start (stream_id));
|
||||
event =
|
||||
gst_pad_get_sticky_event (tagdemux->priv->sinkpad,
|
||||
GST_EVENT_STREAM_START, 0);
|
||||
if (event) {
|
||||
if (gst_event_parse_group_id (event, &group_id))
|
||||
have_group_id = TRUE;
|
||||
else
|
||||
have_group_id = FALSE;
|
||||
gst_event_unref (event);
|
||||
} else {
|
||||
have_group_id = TRUE;
|
||||
group_id = gst_util_group_id_next ();
|
||||
}
|
||||
|
||||
event = gst_event_new_stream_start (stream_id);
|
||||
if (have_group_id)
|
||||
gst_event_set_group_id (event, group_id);
|
||||
|
||||
gst_pad_push_event (tagdemux->priv->srcpad, event);
|
||||
g_free (stream_id);
|
||||
gst_pad_set_caps (tagdemux->priv->srcpad, tagdemux->priv->src_caps);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue