mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
icydemux: forward tag events
https://bugzilla.gnome.org/show_bug.cgi?id=630205
This commit is contained in:
parent
a060a65786
commit
4c2f5333bb
1 changed files with 29 additions and 15 deletions
|
@ -82,7 +82,7 @@ static GstStateChangeReturn gst_icydemux_change_state (GstElement * element,
|
||||||
GstStateChange transition);
|
GstStateChange transition);
|
||||||
static gboolean gst_icydemux_sink_setcaps (GstPad * pad, GstCaps * caps);
|
static gboolean gst_icydemux_sink_setcaps (GstPad * pad, GstCaps * caps);
|
||||||
|
|
||||||
static void gst_icydemux_send_tag_event (GstICYDemux * icydemux,
|
static gboolean gst_icydemux_send_tag_event (GstICYDemux * icydemux,
|
||||||
GstTagList * taglist);
|
GstTagList * taglist);
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
|
@ -301,6 +301,22 @@ gst_icydemux_unicodify (const gchar * str)
|
||||||
return gst_tag_freeform_string_to_utf8 (str, -1, env_vars);
|
return gst_tag_freeform_string_to_utf8 (str, -1, env_vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_icydemux_tag_found (GstICYDemux * icydemux, GstTagList * tags)
|
||||||
|
{
|
||||||
|
/* send the tag event if we have finished typefinding and have a src pad */
|
||||||
|
if (icydemux->srcpad)
|
||||||
|
return gst_icydemux_send_tag_event (icydemux, tags);
|
||||||
|
|
||||||
|
/* if we haven't a source pad yet, cache the tags */
|
||||||
|
if (!icydemux->cached_tags)
|
||||||
|
icydemux->cached_tags = gst_tag_list_new ();
|
||||||
|
|
||||||
|
gst_tag_list_insert (icydemux->cached_tags, tags, GST_TAG_MERGE_REPLACE_ALL);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
|
gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
|
||||||
{
|
{
|
||||||
|
@ -351,18 +367,8 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
|
||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
gst_adapter_clear (icydemux->meta_adapter);
|
gst_adapter_clear (icydemux->meta_adapter);
|
||||||
|
|
||||||
if (found_tag) {
|
if (found_tag)
|
||||||
if (icydemux->srcpad) {
|
gst_icydemux_tag_found (icydemux, tags);
|
||||||
gst_icydemux_send_tag_event (icydemux, tags);
|
|
||||||
} else {
|
|
||||||
if (!icydemux->cached_tags) {
|
|
||||||
icydemux->cached_tags = gst_tag_list_new ();
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_tag_list_insert (icydemux->cached_tags, tags,
|
|
||||||
GST_TAG_MERGE_REPLACE_ALL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -370,6 +376,14 @@ gst_icydemux_handle_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstICYDemux *icydemux = GST_ICYDEMUX (GST_PAD_PARENT (pad));
|
GstICYDemux *icydemux = GST_ICYDEMUX (GST_PAD_PARENT (pad));
|
||||||
|
|
||||||
|
if (GST_EVENT_TYPE (event) == GST_EVENT_TAG) {
|
||||||
|
GstTagList *tags;
|
||||||
|
|
||||||
|
gst_event_parse_tag (event, &tags);
|
||||||
|
gst_event_unref (event);
|
||||||
|
return gst_icydemux_tag_found (icydemux, tags);
|
||||||
|
}
|
||||||
|
|
||||||
if (icydemux->typefinding) {
|
if (icydemux->typefinding) {
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_FLUSH_STOP:
|
case GST_EVENT_FLUSH_STOP:
|
||||||
|
@ -603,7 +617,7 @@ gst_icydemux_change_state (GstElement * element, GstStateChange transition)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
gst_icydemux_send_tag_event (GstICYDemux * icydemux, GstTagList * tags)
|
gst_icydemux_send_tag_event (GstICYDemux * icydemux, GstTagList * tags)
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
|
@ -615,7 +629,7 @@ gst_icydemux_send_tag_event (GstICYDemux * icydemux, GstTagList * tags)
|
||||||
GST_EVENT_TIMESTAMP (event) = 0;
|
GST_EVENT_TIMESTAMP (event) = 0;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (icydemux, "Sending tag event on src pad");
|
GST_DEBUG_OBJECT (icydemux, "Sending tag event on src pad");
|
||||||
gst_pad_push_event (icydemux->srcpad, event);
|
return gst_pad_push_event (icydemux->srcpad, event);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue