diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2002-06-08 14:57:15 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2002-06-08 14:57:15 +0000 |
commit | 56fb211778a9fb342eea922c901cee6d74c02cad (patch) | |
tree | f5558dd7bb737ae8a621568e89d98440f9b07c79 /examples/seeking/seek.c | |
parent | 59cf0f79563e5d85fb2e5b643c8b2694ad12d94a (diff) | |
download | gst-plugins-bad-56fb211778a9fb342eea922c901cee6d74c02cad.tar.gz gst-plugins-bad-56fb211778a9fb342eea922c901cee6d74c02cad.tar.bz2 gst-plugins-bad-56fb211778a9fb342eea922c901cee6d74c02cad.zip |
Added wav test to seek.c
Original commit message from CVS:
Added wav test to seek.c
Added an example of element query/seek using spider
Diffstat (limited to 'examples/seeking/seek.c')
-rw-r--r-- | examples/seeking/seek.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/seeking/seek.c b/examples/seeking/seek.c index ce22e845..575fac1a 100644 --- a/examples/seeking/seek.c +++ b/examples/seeking/seek.c @@ -58,6 +58,37 @@ setup_dynamic_connection (GstElement *element, const gchar *padname, GstPad *tar } static GstElement* +make_wav_pipeline (const gchar *location) +{ + GstElement *pipeline; + GstElement *src, *decoder, *audiosink; + GstPad *seekable; + + pipeline = gst_pipeline_new ("app"); + + src = gst_element_factory_make (SOURCE, "src"); + decoder = gst_element_factory_make ("wavparse", "decoder"); + audiosink = gst_element_factory_make ("osssink", "sink"); + //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); + + g_object_set (G_OBJECT (src), "location", location, NULL); + + gst_bin_add (GST_BIN (pipeline), src); + gst_bin_add (GST_BIN (pipeline), decoder); + gst_bin_add (GST_BIN (pipeline), audiosink); + + gst_element_connect (src, decoder); + gst_element_connect (decoder, audiosink); + + seekable = gst_element_get_pad (decoder, "src"); + seekable_pads = g_list_prepend (seekable_pads, seekable); + rate_pads = g_list_prepend (rate_pads, seekable); + rate_pads = g_list_prepend (rate_pads, gst_element_get_pad (decoder, "sink")); + + return pipeline; +} + +static GstElement* make_flac_pipeline (const gchar *location) { GstElement *pipeline; @@ -625,6 +656,8 @@ main (int argc, char **argv) pipeline = make_sid_pipeline (argv[2]); else if (atoi (argv[1]) == 6) pipeline = make_flac_pipeline (argv[2]); + else if (atoi (argv[1]) == 7) + pipeline = make_wav_pipeline (argv[2]); /* initialize gui elements ... */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); |