From 4dced785fef3f8c08b690b87a9264e5265954c6e Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 9 Jan 2005 14:53:59 +0000 Subject: [PATCH] Remove all references to xvideosink, fix examples (#140845). Original commit message from CVS: * configure.ac: * examples/capsfilter/capsfilter1.c: (main): * examples/seeking/spider_seek.c: (make_spider_pipeline): * ext/dvdread/Makefile.am: * ext/dvdread/demo-play: * ext/dvdread/demo-play.c: * gconf/gstreamer.schemas.in: * gst-libs/gst/gconf/gconf.c: * sys/v4l/TODO: * testsuite/Makefile.am: * testsuite/embed/Makefile.am: * testsuite/embed/embed.c: (cb_expose), (main): Remove all references to xvideosink, fix examples (#140845). * gst/playback/gstplaybasebin.c: (group_destroy): Apparently, disposal does not unlink - so do explicitely. * ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event): Add debug. --- ChangeLog | 20 +++++ configure.ac | 1 + examples/capsfilter/capsfilter1.c | 28 +++--- examples/seeking/spider_seek.c | 2 +- ext/alsa/gstalsasink.c | 6 +- gst-libs/gst/gconf/gconf.c | 2 +- gst/playback/gstplaybasebin.c | 3 + sys/v4l/TODO | 4 - tests/examples/seek/spider_seek.c | 2 +- tests/old/Makefile.am | 12 ++- tests/old/examples/capsfilter/capsfilter1.c | 28 +++--- tests/old/examples/seek/spider_seek.c | 2 +- tests/old/testsuite/embed/Makefile.am | 3 +- tests/old/testsuite/embed/embed.c | 95 ++++++--------------- testsuite/Makefile.am | 12 ++- testsuite/embed/Makefile.am | 3 +- testsuite/embed/embed.c | 95 ++++++--------------- 17 files changed, 131 insertions(+), 187 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6aa1226382..c19c8779cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2005-01-09 Ronald S. Bultje + + * configure.ac: + * examples/capsfilter/capsfilter1.c: (main): + * examples/seeking/spider_seek.c: (make_spider_pipeline): + * ext/dvdread/Makefile.am: + * ext/dvdread/demo-play: + * ext/dvdread/demo-play.c: + * gconf/gstreamer.schemas.in: + * gst-libs/gst/gconf/gconf.c: + * sys/v4l/TODO: + * testsuite/Makefile.am: + * testsuite/embed/Makefile.am: + * testsuite/embed/embed.c: (cb_expose), (main): + Remove all references to xvideosink, fix examples (#140845). + * gst/playback/gstplaybasebin.c: (group_destroy): + Apparently, disposal does not unlink - so do explicitely. + * ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event): + Add debug. + 2005-01-09 Maciej Katafiasz * README: fix PKG_CONFIG_PATH instructions, what was there diff --git a/configure.ac b/configure.ac index f7124165cd..73333ffe24 100644 --- a/configure.ac +++ b/configure.ac @@ -2104,6 +2104,7 @@ examples/indexing/Makefile examples/gstplay/Makefile examples/switch/Makefile examples/Makefile +testsuite/embed/Makefile testsuite/spider/Makefile testsuite/alsa/Makefile testsuite/multifilesink/Makefile diff --git a/examples/capsfilter/capsfilter1.c b/examples/capsfilter/capsfilter1.c index 5948d60161..617b89dd0e 100644 --- a/examples/capsfilter/capsfilter1.c +++ b/examples/capsfilter/capsfilter1.c @@ -1,3 +1,4 @@ +#include #include /* This app uses a filter to connect colorspace and videosink @@ -28,7 +29,7 @@ main (gint argc, gchar * argv[]) GstElement *queue; GstElement *mpeg2dec; GstElement *colorspace; - GstElement *xvideosink; + GstElement *videosink; gboolean res; gst_init (&argc, &argv); @@ -51,11 +52,10 @@ main (gint argc, gchar * argv[]) queue = gst_element_factory_make ("queue", "queue"); mpeg2dec = gst_element_factory_make ("mpeg2dec", "mpeg2dec"); g_return_val_if_fail (mpeg2dec, -1); - colorspace = gst_element_factory_make ("colorspace", "colorspace"); + colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace"); g_return_val_if_fail (colorspace, -1); - xvideosink = gst_element_factory_make ("xvideosink", "xvideosink"); - g_return_val_if_fail (xvideosink, -1); - g_object_set (G_OBJECT (xvideosink), "toplevel", TRUE, NULL); + videosink = gst_element_factory_make ("ximagesink", "videosink"); + g_return_val_if_fail (videosink, -1); gst_bin_add (GST_BIN (pipeline), filesrc); gst_bin_add (GST_BIN (pipeline), demux); @@ -63,19 +63,17 @@ main (gint argc, gchar * argv[]) gst_bin_add (GST_BIN (thread), queue); gst_bin_add (GST_BIN (thread), mpeg2dec); gst_bin_add (GST_BIN (thread), colorspace); - gst_bin_add (GST_BIN (thread), xvideosink); + gst_bin_add (GST_BIN (thread), videosink); gst_bin_add (GST_BIN (pipeline), thread); - gst_element_link (filesrc, "src", demux, "sink"); - gst_element_link (queue, "src", mpeg2dec, "sink"); - gst_element_link (mpeg2dec, "src", colorspace, "sink"); - /* force RGB data passing between colorspace and xvideosink */ - res = gst_element_link_filtered (colorspace, "src", xvideosink, "sink", - GST_CAPS_NEW ("filtercaps", - "video/raw", "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")) - )); + gst_element_link_pads (filesrc, "src", demux, "sink"); + gst_element_link_pads (queue, "src", mpeg2dec, "sink"); + gst_element_link_pads (mpeg2dec, "src", colorspace, "sink"); + /* force RGB data passing between colorspace and videosink */ + res = gst_element_link_pads_filtered (colorspace, "src", videosink, "sink", + gst_caps_new_simple ("video/x-raw-rgb", NULL)); if (!res) { - g_print ("could not connect colorspace and xvideosink\n"); + g_print ("could not connect colorspace and videosink\n"); return -1; } diff --git a/examples/seeking/spider_seek.c b/examples/seeking/spider_seek.c index 54c108974c..46197c016f 100644 --- a/examples/seeking/spider_seek.c +++ b/examples/seeking/spider_seek.c @@ -42,7 +42,7 @@ make_spider_pipeline (const gchar * location, gboolean thread) v_thread = gst_thread_new ("v_thread"); v_queue = gst_element_factory_make ("queue", "v_queue"); - videosink = gst_element_factory_make ("xvideosink", "v_sink"); + videosink = gst_element_factory_make ("xvimagesink", "v_sink"); //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); g_object_set (G_OBJECT (src), "location", location, NULL); diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index a8d4e4c59e..01154b6293 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -218,7 +218,7 @@ gst_alsa_sink_check_event (GstAlsaSink * sink, gint pad_nr) break; case GST_EVENT_DISCONTINUOUS: { - GstClockTime value, delay; + GstClockTime value = GST_CLOCK_TIME_NONE, delay; /* only the first pad may seek */ if (pad_nr != 0) { @@ -246,6 +246,10 @@ gst_alsa_sink_check_event (GstAlsaSink * sink, gint pad_nr) "couldn't extract time from discont event. Bad things might happen!"); } + if (GST_CLOCK_TIME_IS_VALID (value)) { + GST_DEBUG ("Set discont to %" GST_TIME_FORMAT, GST_TIME_ARGS (value)); + } + break; } default: diff --git a/gst-libs/gst/gconf/gconf.c b/gst-libs/gst/gconf/gconf.c index 00b35a22b6..e89dc3a151 100644 --- a/gst-libs/gst/gconf/gconf.c +++ b/gst-libs/gst/gconf/gconf.c @@ -217,7 +217,7 @@ gst_gconf_get_default_audio_sink (void) * gst_gconf_get_default_video_sink: * * Render video output bin from GStreamer GConf key : "default/videosink". - * If key is invalid xvideosink is used as default output plugin. + * If key is invalid ximagesink is used as default output plugin. * * Returns: a #GstElement containing the video output bin, or NULL if * everything failed. diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index bbd97100b9..8b784d6d57 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -328,6 +328,8 @@ group_destroy (GstPlayBaseGroup * group) gst_pad_get_name (pad), GST_ELEMENT_NAME (gst_pad_get_parent (pad))); gst_bin_remove (GST_BIN (play_base_bin->thread), fakesrc); + } else if (GST_PAD_PEER (pad)) { + gst_pad_unlink (GST_PAD_PEER (pad), pad); } } @@ -344,6 +346,7 @@ group_destroy (GstPlayBaseGroup * group) } group->type[n].preroll = NULL; + group->type[n].selector = NULL; } /* free the streaminfo too */ diff --git a/sys/v4l/TODO b/sys/v4l/TODO index f3aebd805a..96616c087e 100644 --- a/sys/v4l/TODO +++ b/sys/v4l/TODO @@ -1,16 +1,12 @@ TODO list (short term): ======================= * v4lsrc/v4lmjpegsrc/v4l2src: fix interlacing (not handled at all...) -* fix v4l*src ! spider ! colorspace ! xvideosink - - first sets to PLAYING, then (re-)triggers capsnego - that breaks TODO list (long term): ====================== * v4lmpegsrc (*hint* MPEG card needed *hint*) * v4l2sink * BSD-videosrc (bktr) -* color correction (brightness, hue, etc.) -* gamma correction Useful Documentation: ===================== diff --git a/tests/examples/seek/spider_seek.c b/tests/examples/seek/spider_seek.c index 54c108974c..46197c016f 100644 --- a/tests/examples/seek/spider_seek.c +++ b/tests/examples/seek/spider_seek.c @@ -42,7 +42,7 @@ make_spider_pipeline (const gchar * location, gboolean thread) v_thread = gst_thread_new ("v_thread"); v_queue = gst_element_factory_make ("queue", "v_queue"); - videosink = gst_element_factory_make ("xvideosink", "v_sink"); + videosink = gst_element_factory_make ("xvimagesink", "v_sink"); //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); g_object_set (G_OBJECT (src), "location", location, NULL); diff --git a/tests/old/Makefile.am b/tests/old/Makefile.am index 44b4aaa447..9fe8d1c7bf 100644 --- a/tests/old/Makefile.am +++ b/tests/old/Makefile.am @@ -4,8 +4,16 @@ else ALSA_DIR= endif -SUBDIRS=spider multifilesink $(ALSA_DIR) #seeking -DIST_SUBDIRS=spider alsa multifilesink +SUBDIRS = \ + embed \ + spider \ + multifilesink \ + $(ALSA_DIR) #seeking +DIST_SUBDIRS = \ + embed \ + spider \ + alsa \ + multifilesink GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) diff --git a/tests/old/examples/capsfilter/capsfilter1.c b/tests/old/examples/capsfilter/capsfilter1.c index 5948d60161..617b89dd0e 100644 --- a/tests/old/examples/capsfilter/capsfilter1.c +++ b/tests/old/examples/capsfilter/capsfilter1.c @@ -1,3 +1,4 @@ +#include #include /* This app uses a filter to connect colorspace and videosink @@ -28,7 +29,7 @@ main (gint argc, gchar * argv[]) GstElement *queue; GstElement *mpeg2dec; GstElement *colorspace; - GstElement *xvideosink; + GstElement *videosink; gboolean res; gst_init (&argc, &argv); @@ -51,11 +52,10 @@ main (gint argc, gchar * argv[]) queue = gst_element_factory_make ("queue", "queue"); mpeg2dec = gst_element_factory_make ("mpeg2dec", "mpeg2dec"); g_return_val_if_fail (mpeg2dec, -1); - colorspace = gst_element_factory_make ("colorspace", "colorspace"); + colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace"); g_return_val_if_fail (colorspace, -1); - xvideosink = gst_element_factory_make ("xvideosink", "xvideosink"); - g_return_val_if_fail (xvideosink, -1); - g_object_set (G_OBJECT (xvideosink), "toplevel", TRUE, NULL); + videosink = gst_element_factory_make ("ximagesink", "videosink"); + g_return_val_if_fail (videosink, -1); gst_bin_add (GST_BIN (pipeline), filesrc); gst_bin_add (GST_BIN (pipeline), demux); @@ -63,19 +63,17 @@ main (gint argc, gchar * argv[]) gst_bin_add (GST_BIN (thread), queue); gst_bin_add (GST_BIN (thread), mpeg2dec); gst_bin_add (GST_BIN (thread), colorspace); - gst_bin_add (GST_BIN (thread), xvideosink); + gst_bin_add (GST_BIN (thread), videosink); gst_bin_add (GST_BIN (pipeline), thread); - gst_element_link (filesrc, "src", demux, "sink"); - gst_element_link (queue, "src", mpeg2dec, "sink"); - gst_element_link (mpeg2dec, "src", colorspace, "sink"); - /* force RGB data passing between colorspace and xvideosink */ - res = gst_element_link_filtered (colorspace, "src", xvideosink, "sink", - GST_CAPS_NEW ("filtercaps", - "video/raw", "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")) - )); + gst_element_link_pads (filesrc, "src", demux, "sink"); + gst_element_link_pads (queue, "src", mpeg2dec, "sink"); + gst_element_link_pads (mpeg2dec, "src", colorspace, "sink"); + /* force RGB data passing between colorspace and videosink */ + res = gst_element_link_pads_filtered (colorspace, "src", videosink, "sink", + gst_caps_new_simple ("video/x-raw-rgb", NULL)); if (!res) { - g_print ("could not connect colorspace and xvideosink\n"); + g_print ("could not connect colorspace and videosink\n"); return -1; } diff --git a/tests/old/examples/seek/spider_seek.c b/tests/old/examples/seek/spider_seek.c index 54c108974c..46197c016f 100644 --- a/tests/old/examples/seek/spider_seek.c +++ b/tests/old/examples/seek/spider_seek.c @@ -42,7 +42,7 @@ make_spider_pipeline (const gchar * location, gboolean thread) v_thread = gst_thread_new ("v_thread"); v_queue = gst_element_factory_make ("queue", "v_queue"); - videosink = gst_element_factory_make ("xvideosink", "v_sink"); + videosink = gst_element_factory_make ("xvimagesink", "v_sink"); //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); g_object_set (G_OBJECT (src), "location", location, NULL); diff --git a/tests/old/testsuite/embed/Makefile.am b/tests/old/testsuite/embed/Makefile.am index 94910254aa..3044b90b66 100644 --- a/tests/old/testsuite/embed/Makefile.am +++ b/tests/old/testsuite/embed/Makefile.am @@ -4,5 +4,6 @@ TESTS = embed check_PROGRAMS = embed # we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) $(GTK_LIBS) +LIBS = $(GST_LIBS) $(GTK_LIBS) \ + $(top_srcdir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la AM_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS) diff --git a/tests/old/testsuite/embed/embed.c b/tests/old/testsuite/embed/embed.c index f4df8dd0c3..1678a8b130 100644 --- a/tests/old/testsuite/embed/embed.c +++ b/tests/old/testsuite/embed/embed.c @@ -1,95 +1,48 @@ +/* + * Sample app for element embedding. + */ + #include +#include #include #include -#include -GtkWidget *window; -GstElement *testsrc; -GstElement *xvideosink; -GstElement *filter; -GdkWindow *wind; -GstElement *pipeline; - -#if 0 -static int -configure (GtkWidget * widget, GdkEventConfigure * evt, gpointer data) +static void +cb_expose (GtkWidget * w, GdkEventExpose * ev, GstElement * e) { - printf ("configure\n"); - if (wind) { - gdk_window_resize (wind, evt->width, evt->height); - gdk_window_reparent (wind, window->window, 0, 0); + if (GST_IS_X_OVERLAY (e) && + !GTK_WIDGET_NO_WINDOW (w) && GTK_WIDGET_REALIZED (w)) { + gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (e), + GDK_WINDOW_XWINDOW (w->window)); } - - return FALSE; -} - -static int -map_event (GtkWidget * widget, GdkEventConfigure * evt, gpointer data) -{ - printf ("map\n"); - return FALSE; -} -#endif - -static int -have_xid (GstElement * xv, gint xid, gpointer data) -{ - printf ("have_xid\n"); - - wind = gdk_window_foreign_new (xid); - printf ("gdk_window_reparent() wind=%p window=%p xid=%d\n", wind, - window->window, xid); - gdk_window_reparent (wind, window->window, 0, 0); - gdk_window_show (wind); - - return FALSE; } int main (int argc, char *argv[]) { - //GValue value = { 0 }; + GtkWidget *window, *content; + GstElement *testsrc, *csp, *videosink, *pipeline; gtk_init (&argc, &argv); gst_init (&argc, &argv); + pipeline = gst_element_factory_make ("pipeline", NULL); + testsrc = gst_element_factory_make ("videotestsrc", NULL); + csp = gst_element_factory_make ("ffmpegcolorspace", NULL); + videosink = gst_element_factory_make ("xvimagesink", NULL); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 480); -#if 0 - gtk_signal_connect (GTK_OBJECT (window), "configure_event", - GTK_SIGNAL_FUNC (configure), NULL); - gtk_signal_connect (GTK_OBJECT (window), "map", - GTK_SIGNAL_FUNC (map_event), NULL); -#endif + gtk_window_set_title (GTK_WINDOW (window), "My application"); + content = gtk_event_box_new (); + gtk_container_add (GTK_CONTAINER (window), content); + g_signal_connect (content, "expose-event", G_CALLBACK (cb_expose), videosink); gtk_widget_show_all (window); - pipeline = gst_element_factory_make ("pipeline", NULL); - - testsrc = gst_element_factory_make ("videotestsrc", NULL); -#if 0 - g_value_init (&value, G_TYPE_INT); - g_value_set_int (&value, 640); - g_object_set_property (G_OBJECT (testsrc), "width", &value); - g_value_set_int (&value, 480); - g_object_set_property (G_OBJECT (testsrc), "height", &value); -#endif - - xvideosink = gst_element_factory_make ("xvideosink", NULL); - g_object_set (xvideosink, "toplevel", FALSE, NULL); - g_signal_connect (xvideosink, "have_xid", (GCallback) (have_xid), NULL); - - gst_bin_add (GST_BIN (pipeline), testsrc); - gst_bin_add (GST_BIN (pipeline), xvideosink); - - gst_element_connect (testsrc, xvideosink); - - if (pipeline == NULL) { - g_warning ("Could not generate usable pipeline\n"); - return 1; - } + gst_bin_add_many (GST_BIN (pipeline), testsrc, csp, videosink, NULL); + gst_element_link_many (testsrc, csp, videosink, NULL); g_idle_add ((GSourceFunc) gst_bin_iterate, pipeline); - gst_element_set_state (pipeline, GST_STATE_PLAYING); gtk_main (); diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 44b4aaa447..9fe8d1c7bf 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -4,8 +4,16 @@ else ALSA_DIR= endif -SUBDIRS=spider multifilesink $(ALSA_DIR) #seeking -DIST_SUBDIRS=spider alsa multifilesink +SUBDIRS = \ + embed \ + spider \ + multifilesink \ + $(ALSA_DIR) #seeking +DIST_SUBDIRS = \ + embed \ + spider \ + alsa \ + multifilesink GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) diff --git a/testsuite/embed/Makefile.am b/testsuite/embed/Makefile.am index 94910254aa..3044b90b66 100644 --- a/testsuite/embed/Makefile.am +++ b/testsuite/embed/Makefile.am @@ -4,5 +4,6 @@ TESTS = embed check_PROGRAMS = embed # we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) $(GTK_LIBS) +LIBS = $(GST_LIBS) $(GTK_LIBS) \ + $(top_srcdir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la AM_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS) diff --git a/testsuite/embed/embed.c b/testsuite/embed/embed.c index f4df8dd0c3..1678a8b130 100644 --- a/testsuite/embed/embed.c +++ b/testsuite/embed/embed.c @@ -1,95 +1,48 @@ +/* + * Sample app for element embedding. + */ + #include +#include #include #include -#include -GtkWidget *window; -GstElement *testsrc; -GstElement *xvideosink; -GstElement *filter; -GdkWindow *wind; -GstElement *pipeline; - -#if 0 -static int -configure (GtkWidget * widget, GdkEventConfigure * evt, gpointer data) +static void +cb_expose (GtkWidget * w, GdkEventExpose * ev, GstElement * e) { - printf ("configure\n"); - if (wind) { - gdk_window_resize (wind, evt->width, evt->height); - gdk_window_reparent (wind, window->window, 0, 0); + if (GST_IS_X_OVERLAY (e) && + !GTK_WIDGET_NO_WINDOW (w) && GTK_WIDGET_REALIZED (w)) { + gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (e), + GDK_WINDOW_XWINDOW (w->window)); } - - return FALSE; -} - -static int -map_event (GtkWidget * widget, GdkEventConfigure * evt, gpointer data) -{ - printf ("map\n"); - return FALSE; -} -#endif - -static int -have_xid (GstElement * xv, gint xid, gpointer data) -{ - printf ("have_xid\n"); - - wind = gdk_window_foreign_new (xid); - printf ("gdk_window_reparent() wind=%p window=%p xid=%d\n", wind, - window->window, xid); - gdk_window_reparent (wind, window->window, 0, 0); - gdk_window_show (wind); - - return FALSE; } int main (int argc, char *argv[]) { - //GValue value = { 0 }; + GtkWidget *window, *content; + GstElement *testsrc, *csp, *videosink, *pipeline; gtk_init (&argc, &argv); gst_init (&argc, &argv); + pipeline = gst_element_factory_make ("pipeline", NULL); + testsrc = gst_element_factory_make ("videotestsrc", NULL); + csp = gst_element_factory_make ("ffmpegcolorspace", NULL); + videosink = gst_element_factory_make ("xvimagesink", NULL); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 480); -#if 0 - gtk_signal_connect (GTK_OBJECT (window), "configure_event", - GTK_SIGNAL_FUNC (configure), NULL); - gtk_signal_connect (GTK_OBJECT (window), "map", - GTK_SIGNAL_FUNC (map_event), NULL); -#endif + gtk_window_set_title (GTK_WINDOW (window), "My application"); + content = gtk_event_box_new (); + gtk_container_add (GTK_CONTAINER (window), content); + g_signal_connect (content, "expose-event", G_CALLBACK (cb_expose), videosink); gtk_widget_show_all (window); - pipeline = gst_element_factory_make ("pipeline", NULL); - - testsrc = gst_element_factory_make ("videotestsrc", NULL); -#if 0 - g_value_init (&value, G_TYPE_INT); - g_value_set_int (&value, 640); - g_object_set_property (G_OBJECT (testsrc), "width", &value); - g_value_set_int (&value, 480); - g_object_set_property (G_OBJECT (testsrc), "height", &value); -#endif - - xvideosink = gst_element_factory_make ("xvideosink", NULL); - g_object_set (xvideosink, "toplevel", FALSE, NULL); - g_signal_connect (xvideosink, "have_xid", (GCallback) (have_xid), NULL); - - gst_bin_add (GST_BIN (pipeline), testsrc); - gst_bin_add (GST_BIN (pipeline), xvideosink); - - gst_element_connect (testsrc, xvideosink); - - if (pipeline == NULL) { - g_warning ("Could not generate usable pipeline\n"); - return 1; - } + gst_bin_add_many (GST_BIN (pipeline), testsrc, csp, videosink, NULL); + gst_element_link_many (testsrc, csp, videosink, NULL); g_idle_add ((GSourceFunc) gst_bin_iterate, pipeline); - gst_element_set_state (pipeline, GST_STATE_PLAYING); gtk_main ();