From 84d0eb4f88846bc0d94ba2263c6fca085013272c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 23 Aug 2005 18:30:07 +0000 Subject: [PATCH] examples/seeking/seek.c: Small seek updates. Original commit message from CVS: * examples/seeking/seek.c: (make_vorbis_pipeline), (make_theora_pipeline), (make_vorbis_theora_pipeline), (do_seek): Small seek updates. --- ChangeLog | 6 ++++++ examples/seeking/seek.c | 31 ++++++++++++++++++------------- tests/examples/seek/seek.c | 31 ++++++++++++++++++------------- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 234e29386e..6e394323a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-23 Wim Taymans + + * examples/seeking/seek.c: (make_vorbis_pipeline), + (make_theora_pipeline), (make_vorbis_theora_pipeline), (do_seek): + Small seek updates. + 2005-08-23 Andy Wingo * gst-libs/gst/audio/gstbaseaudiosrc.c diff --git a/examples/seeking/seek.c b/examples/seeking/seek.c index 8284ecc310..8c12380c0b 100644 --- a/examples/seeking/seek.c +++ b/examples/seeking/seek.c @@ -296,7 +296,7 @@ make_vorbis_pipeline (const gchar * location) { GstElement *pipeline, *audio_bin; GstElement *src, *demux, *decoder, *convert, *audiosink; - GstPad *seekable; + GstPad *pad, *seekable; pipeline = gst_pipeline_new ("app"); @@ -322,7 +322,12 @@ make_vorbis_pipeline (const gchar * location) gst_element_link (decoder, convert); gst_element_link (convert, audiosink); - setup_dynamic_link (demux, NULL, gst_element_get_pad (decoder, "sink"), NULL); + pad = gst_element_get_pad (decoder, "sink"); + gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); + gst_object_unref (pad); + + setup_dynamic_link (demux, NULL, gst_element_get_pad (audio_bin, "sink"), + NULL); seekable = gst_element_get_pad (decoder, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -337,14 +342,12 @@ make_theora_pipeline (const gchar * location) { GstElement *pipeline, *video_bin; GstElement *src, *demux, *decoder, *convert, *videosink; - GstElement *queue; - GstPad *seekable; + GstPad *pad, *seekable; pipeline = gst_pipeline_new ("app"); src = gst_element_factory_make_or_warn (SOURCE, "src"); demux = gst_element_factory_make_or_warn ("oggdemux", "demux"); - queue = gst_element_factory_make_or_warn ("queue", "queue"); decoder = gst_element_factory_make_or_warn ("theoradec", "decoder"); convert = gst_element_factory_make_or_warn ("ffmpegcolorspace", "convert"); videosink = gst_element_factory_make_or_warn (VSINK, "sink"); @@ -355,18 +358,21 @@ make_theora_pipeline (const gchar * location) gst_bin_add (GST_BIN (pipeline), src); gst_bin_add (GST_BIN (pipeline), demux); - gst_bin_add (GST_BIN (pipeline), queue); gst_bin_add (GST_BIN (video_bin), decoder); gst_bin_add (GST_BIN (video_bin), convert); gst_bin_add (GST_BIN (video_bin), videosink); gst_bin_add (GST_BIN (pipeline), video_bin); gst_element_link (src, demux); - gst_element_link (queue, decoder); gst_element_link (decoder, convert); gst_element_link (convert, videosink); - setup_dynamic_link (demux, NULL, gst_element_get_pad (queue, "sink"), NULL); + pad = gst_element_get_pad (decoder, "sink"); + gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); + gst_object_unref (pad); + + setup_dynamic_link (demux, NULL, gst_element_get_pad (video_bin, "sink"), + NULL); seekable = gst_element_get_pad (decoder, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -416,7 +422,7 @@ make_vorbis_theora_pipeline (const gchar * location) pad = gst_element_get_pad (a_queue, "sink"); gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); setup_dynamic_link (demux, NULL, gst_element_get_pad (audio_bin, "sink"), NULL); @@ -439,7 +445,7 @@ make_vorbis_theora_pipeline (const gchar * location) pad = gst_element_get_pad (v_queue, "sink"); gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); setup_dynamic_link (demux, NULL, gst_element_get_pad (video_bin, "sink"), NULL); @@ -975,10 +981,9 @@ do_seek (GtkWidget * widget) while (walk) { GstPad *seekable = GST_PAD (walk->data); - g_print ("seek to %" GST_TIME_FORMAT " on pad %s:%s\n", + GST_DEBUG ("seek to %" GST_TIME_FORMAT " on pad %s:%s", GST_TIME_ARGS (real), GST_DEBUG_PAD_NAME (seekable)); - s_event = gst_event_new_seek (1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, real, GST_SEEK_TYPE_NONE, 0); @@ -993,7 +998,7 @@ do_seek (GtkWidget * widget) while (walk) { GstElement *seekable = GST_ELEMENT (walk->data); - g_print ("seek to %" GST_TIME_FORMAT " on element %s\n", + GST_DEBUG ("seek to %" GST_TIME_FORMAT " on element %s", GST_TIME_ARGS (real), GST_ELEMENT_NAME (seekable)); s_event = gst_event_new_seek (1.0, diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 8284ecc310..8c12380c0b 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -296,7 +296,7 @@ make_vorbis_pipeline (const gchar * location) { GstElement *pipeline, *audio_bin; GstElement *src, *demux, *decoder, *convert, *audiosink; - GstPad *seekable; + GstPad *pad, *seekable; pipeline = gst_pipeline_new ("app"); @@ -322,7 +322,12 @@ make_vorbis_pipeline (const gchar * location) gst_element_link (decoder, convert); gst_element_link (convert, audiosink); - setup_dynamic_link (demux, NULL, gst_element_get_pad (decoder, "sink"), NULL); + pad = gst_element_get_pad (decoder, "sink"); + gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); + gst_object_unref (pad); + + setup_dynamic_link (demux, NULL, gst_element_get_pad (audio_bin, "sink"), + NULL); seekable = gst_element_get_pad (decoder, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -337,14 +342,12 @@ make_theora_pipeline (const gchar * location) { GstElement *pipeline, *video_bin; GstElement *src, *demux, *decoder, *convert, *videosink; - GstElement *queue; - GstPad *seekable; + GstPad *pad, *seekable; pipeline = gst_pipeline_new ("app"); src = gst_element_factory_make_or_warn (SOURCE, "src"); demux = gst_element_factory_make_or_warn ("oggdemux", "demux"); - queue = gst_element_factory_make_or_warn ("queue", "queue"); decoder = gst_element_factory_make_or_warn ("theoradec", "decoder"); convert = gst_element_factory_make_or_warn ("ffmpegcolorspace", "convert"); videosink = gst_element_factory_make_or_warn (VSINK, "sink"); @@ -355,18 +358,21 @@ make_theora_pipeline (const gchar * location) gst_bin_add (GST_BIN (pipeline), src); gst_bin_add (GST_BIN (pipeline), demux); - gst_bin_add (GST_BIN (pipeline), queue); gst_bin_add (GST_BIN (video_bin), decoder); gst_bin_add (GST_BIN (video_bin), convert); gst_bin_add (GST_BIN (video_bin), videosink); gst_bin_add (GST_BIN (pipeline), video_bin); gst_element_link (src, demux); - gst_element_link (queue, decoder); gst_element_link (decoder, convert); gst_element_link (convert, videosink); - setup_dynamic_link (demux, NULL, gst_element_get_pad (queue, "sink"), NULL); + pad = gst_element_get_pad (decoder, "sink"); + gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); + gst_object_unref (pad); + + setup_dynamic_link (demux, NULL, gst_element_get_pad (video_bin, "sink"), + NULL); seekable = gst_element_get_pad (decoder, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -416,7 +422,7 @@ make_vorbis_theora_pipeline (const gchar * location) pad = gst_element_get_pad (a_queue, "sink"); gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); setup_dynamic_link (demux, NULL, gst_element_get_pad (audio_bin, "sink"), NULL); @@ -439,7 +445,7 @@ make_vorbis_theora_pipeline (const gchar * location) pad = gst_element_get_pad (v_queue, "sink"); gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); setup_dynamic_link (demux, NULL, gst_element_get_pad (video_bin, "sink"), NULL); @@ -975,10 +981,9 @@ do_seek (GtkWidget * widget) while (walk) { GstPad *seekable = GST_PAD (walk->data); - g_print ("seek to %" GST_TIME_FORMAT " on pad %s:%s\n", + GST_DEBUG ("seek to %" GST_TIME_FORMAT " on pad %s:%s", GST_TIME_ARGS (real), GST_DEBUG_PAD_NAME (seekable)); - s_event = gst_event_new_seek (1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, real, GST_SEEK_TYPE_NONE, 0); @@ -993,7 +998,7 @@ do_seek (GtkWidget * widget) while (walk) { GstElement *seekable = GST_ELEMENT (walk->data); - g_print ("seek to %" GST_TIME_FORMAT " on element %s\n", + GST_DEBUG ("seek to %" GST_TIME_FORMAT " on element %s", GST_TIME_ARGS (real), GST_ELEMENT_NAME (seekable)); s_event = gst_event_new_seek (1.0,