summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2005-10-27 09:09:35 +0000
committerTim-Philipp Müller <tim@centricular.net>2005-10-27 09:09:35 +0000
commitb1f329655628288e1a62b14f5181e47bd8271a16 (patch)
treeed085244580e83a81293501fd666ed72cf310e7a
parent9ef03a8c03a61163255ac52b670556a393e2741d (diff)
downloadgstreamer-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--ChangeLog5
-rw-r--r--examples/retag/retag.c12
-rw-r--r--tests/old/examples/retag/retag.c12
3 files changed, 25 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b031430d77..718bc54a95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);