From 6c627481b3a485982e33e6adbdd4c8c7f2ce0e02 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 2 Nov 2011 12:06:47 +0100 Subject: [PATCH] utils: remove _found_tags_ API remove gst_element_found_tags() and gst_element_found_tags_for_pad(), they are nothing more than a wrapper around gst_pad_push_event() --- docs/random/porting-to-0.11.txt | 4 +++ gst/gstutils.c | 58 --------------------------------- gst/gstutils.h | 7 ---- libs/gst/base/gstbaseparse.c | 3 +- tests/check/gst/gstutils.c | 6 ++-- win32/common/libgstreamer.def | 2 -- 6 files changed, 9 insertions(+), 71 deletions(-) diff --git a/docs/random/porting-to-0.11.txt b/docs/random/porting-to-0.11.txt index cb1eb05a01..442ff312ff 100644 --- a/docs/random/porting-to-0.11.txt +++ b/docs/random/porting-to-0.11.txt @@ -68,6 +68,9 @@ The 0.11 porting guide request_new_pad_full() -> request_new_pad() + gst_element_found_tags() and gst_element_found_tags_for_pad() are gone, just + push the tag event. + * GstPad: gst_pad_get_caps() does not return writable caps anymore and an explicit gst_caps_make_writable() needs to be performed. This was the functionality @@ -380,3 +383,4 @@ The 0.11 porting guide gst_tag_list_new() has been renamed to gst_tag_list_new_empty(). gst_tag_list_new_full*() have been renamed to gst_tag_list_new*(). + diff --git a/gst/gstutils.c b/gst/gstutils.c index 9f5dc6f7f7..9c9f050dc1 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -3021,64 +3021,6 @@ gst_pad_query_peer_convert (GstPad * pad, GstFormat src_format, gint64 src_val, return ret; } -/** - * gst_element_found_tags_for_pad: - * @element: element for which to post taglist to bus. - * @pad: (transfer none): pad on which to push tag-event - * @list: (transfer full): the taglist to post on the bus and create event from - * - * Posts a message to the bus that new tags were found and pushes the - * tags as event. Takes ownership of the @list. - * - * This is a utility method for elements. Applications should use the - * #GstTagSetter interface. - */ -void -gst_element_found_tags_for_pad (GstElement * element, - GstPad * pad, GstTagList * list) -{ - g_return_if_fail (element != NULL); - g_return_if_fail (pad != NULL); - g_return_if_fail (list != NULL); - - gst_pad_push_event (pad, gst_event_new_tag (gst_tag_list_copy (list))); -} - -static void -push_and_ref (const GValue * vpad, GstEvent * event) -{ - GstPad *pad = g_value_get_object (vpad); - - gst_pad_push_event (pad, gst_event_ref (event)); -} - -/** - * gst_element_found_tags: - * @element: element for which we found the tags. - * @list: (transfer full): list of tags. - * - * Posts a message to the bus that new tags were found, and pushes an event - * to all sourcepads. Takes ownership of the @list. - * - * This is a utility method for elements. Applications should use the - * #GstTagSetter interface. - */ -void -gst_element_found_tags (GstElement * element, GstTagList * list) -{ - GstIterator *iter; - GstEvent *event; - - g_return_if_fail (element != NULL); - g_return_if_fail (list != NULL); - - iter = gst_element_iterate_src_pads (element); - event = gst_event_new_tag (gst_tag_list_copy (list)); - gst_iterator_foreach (iter, (GstIteratorForeachFunction) push_and_ref, event); - gst_iterator_free (iter); - gst_event_unref (event); -} - static GstPad * element_find_unlinked_pad (GstElement * element, GstPadDirection direction) { diff --git a/gst/gstutils.h b/gst/gstutils.h index 628037b9df..52af5318ac 100644 --- a/gst/gstutils.h +++ b/gst/gstutils.h @@ -915,13 +915,6 @@ GstPad * gst_bin_find_unlinked_pad (GstBin *bin, GstPadDire GstBuffer * gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2); GstBuffer * gst_buffer_join (GstBuffer * buf1, GstBuffer * buf2); -/* tag emission utility functions */ -void gst_element_found_tags_for_pad (GstElement * element, - GstPad * pad, - GstTagList * list); -void gst_element_found_tags (GstElement * element, - GstTagList * list); - /* parse utility functions */ GstElement * gst_parse_bin_from_description (const gchar * bin_description, gboolean ghost_unlinked_pads, diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index c42d53c723..aefe5fbef0 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1344,8 +1344,7 @@ gst_base_parse_post_bitrates (GstBaseParse * parse, gboolean post_min, parse->priv->max_bitrate); if (taglist != NULL) { - gst_element_found_tags_for_pad (GST_ELEMENT_CAST (parse), parse->srcpad, - taglist); + gst_pad_push_event (parse->srcpad, gst_event_new_tag (taglist)); } } diff --git a/tests/check/gst/gstutils.c b/tests/check/gst/gstutils.c index 16a46cf178..a70321635e 100644 --- a/tests/check/gst/gstutils.c +++ b/tests/check/gst/gstutils.c @@ -490,6 +490,7 @@ GST_START_TEST (test_element_found_tags) GstTagList *list; GstBus *bus; GstMessage *message; + GstPad *srcpad; pipeline = gst_element_factory_make ("pipeline", NULL); fakesrc = gst_element_factory_make ("fakesrc", NULL); @@ -503,8 +504,9 @@ GST_START_TEST (test_element_found_tags) gst_element_set_state (pipeline, GST_STATE_PLAYING); - gst_element_found_tags (GST_ELEMENT (fakesrc), list); - gst_tag_list_free (list); + srcpad = gst_element_get_static_pad (fakesrc, "src"); + gst_pad_push_event (srcpad, gst_event_new_tag (list)); + gst_object_unref (srcpad); bus = gst_element_get_bus (pipeline); message = gst_bus_poll (bus, GST_MESSAGE_EOS, -1); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 56f95437a6..995a25f783 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -335,8 +335,6 @@ EXPORTS gst_element_factory_list_is_type gst_element_factory_make gst_element_flags_get_type - gst_element_found_tags - gst_element_found_tags_for_pad gst_element_get_base_time gst_element_get_bus gst_element_get_clock