diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2005-10-27 09:09:35 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2005-10-27 09:09:35 +0000 |
commit | b1f329655628288e1a62b14f5181e47bd8271a16 (patch) | |
tree | ed085244580e83a81293501fd666ed72cf310e7a | |
parent | 9ef03a8c03a61163255ac52b670556a393e2741d (diff) | |
download | gstreamer-b1f329655628288e1a62b14f5181e47bd8271a16.tar.gz |
examples/retag/retag.c: Update retag example so that it actually works (#319316).
Original commit message from CVS:
* examples/retag/retag.c: (main):
Update retag example so that it actually works (#319316).
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | examples/retag/retag.c | 12 | ||||
-rw-r--r-- | tests/old/examples/retag/retag.c | 12 |
3 files changed, 25 insertions, 4 deletions
@@ -1,3 +1,8 @@ +2005-10-27 Tim-Philipp Müller <tim at centricular dot net> + + * examples/retag/retag.c: (main): + Update retag example so that it actually works (#319316). + 2005-10-20 Tim-Philipp Müller <tim at centricular dot net> * tools/gst-inspect.c: (print_interfaces), diff --git a/examples/retag/retag.c b/examples/retag/retag.c index 72361d52de..871cc21c77 100644 --- a/examples/retag/retag.c +++ b/examples/retag/retag.c @@ -19,6 +19,7 @@ int main (int argc, char *argv[]) { GstElement *bin, *filesrc, *tag_changer, *filesink; + GstCaps *filtercaps; gchar *artist, *title, *ext, *filename; /* initialize GStreamer */ @@ -74,7 +75,8 @@ main (int argc, char *argv[]) /* make sure the tag setter uses our stuff (though that should already be default) */ gst_tag_setter_set_merge_mode (GST_TAG_SETTER (tag_changer), - GST_TAG_MERGE_KEEP); + GST_TAG_MERGE_REPLACE); + /* set the tagging information */ gst_tag_setter_add (GST_TAG_SETTER (tag_changer), GST_TAG_MERGE_REPLACE, GST_TAG_ARTIST, artist, GST_TAG_TITLE, title, NULL); @@ -83,8 +85,14 @@ main (int argc, char *argv[]) gst_bin_add_many (GST_BIN (bin), filesrc, tag_changer, filesink, NULL); /* link the elements */ - if (!gst_element_link_many (filesrc, tag_changer, filesink, NULL)) + if (!gst_element_link (filesrc, tag_changer)) + g_assert_not_reached (); + + /* id3tag determines its mode of operation from its source caps */ + filtercaps = gst_caps_new_simple ("application/x-id3", NULL); + if (!gst_element_link_filtered (tag_changer, filesink, filtercaps)) g_assert_not_reached (); + gst_caps_free (filtercaps); /* start playing */ gst_element_set_state (bin, GST_STATE_PLAYING); diff --git a/tests/old/examples/retag/retag.c b/tests/old/examples/retag/retag.c index 72361d52de..871cc21c77 100644 --- a/tests/old/examples/retag/retag.c +++ b/tests/old/examples/retag/retag.c @@ -19,6 +19,7 @@ int main (int argc, char *argv[]) { GstElement *bin, *filesrc, *tag_changer, *filesink; + GstCaps *filtercaps; gchar *artist, *title, *ext, *filename; /* initialize GStreamer */ @@ -74,7 +75,8 @@ main (int argc, char *argv[]) /* make sure the tag setter uses our stuff (though that should already be default) */ gst_tag_setter_set_merge_mode (GST_TAG_SETTER (tag_changer), - GST_TAG_MERGE_KEEP); + GST_TAG_MERGE_REPLACE); + /* set the tagging information */ gst_tag_setter_add (GST_TAG_SETTER (tag_changer), GST_TAG_MERGE_REPLACE, GST_TAG_ARTIST, artist, GST_TAG_TITLE, title, NULL); @@ -83,8 +85,14 @@ main (int argc, char *argv[]) gst_bin_add_many (GST_BIN (bin), filesrc, tag_changer, filesink, NULL); /* link the elements */ - if (!gst_element_link_many (filesrc, tag_changer, filesink, NULL)) + if (!gst_element_link (filesrc, tag_changer)) + g_assert_not_reached (); + + /* id3tag determines its mode of operation from its source caps */ + filtercaps = gst_caps_new_simple ("application/x-id3", NULL); + if (!gst_element_link_filtered (tag_changer, filesink, filtercaps)) g_assert_not_reached (); + gst_caps_free (filtercaps); /* start playing */ gst_element_set_state (bin, GST_STATE_PLAYING); |