From 352cb6fef9ba3d73a3376244498e01498be68d43 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 12 Nov 2004 17:37:49 +0000 Subject: Update libvisual to 0.1.7. Link in the debug handling to gstreamer Original commit message from CVS: * configure.ac: * ext/libvisual/visual.c: (gst_visual_get_type), (libvisual_log_handler), (gst_visual_getcaps), (gst_visual_srclink), (gst_visual_change_state), (make_valid_name), (plugin_init): Update libvisual to 0.1.7. Link in the debug handling to gstreamer * ext/smoothwave/Makefile.am: * ext/smoothwave/demo-osssrc.c: (main): * ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init), (gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink), (gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state), (plugin_init): * ext/smoothwave/gstsmoothwave.h: Make gstsmoothwave a working element in the 20th century. * gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect): Fix incorrect link function --- ext/smoothwave/demo-osssrc.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'ext/smoothwave/demo-osssrc.c') diff --git a/ext/smoothwave/demo-osssrc.c b/ext/smoothwave/demo-osssrc.c index c39bc72c..6e5d2760 100644 --- a/ext/smoothwave/demo-osssrc.c +++ b/ext/smoothwave/demo-osssrc.c @@ -11,12 +11,9 @@ int main (int argc, char *argv[]) { GstElement *bin; - GstElementFactory *srcfactory; GstElement *src; - GstElementFactory *wavefactory; GstElement *wave; - GtkWidget *wave_widget; - GtkWidget *appwindow; + GstElement *ximage; gst_init (&argc, &argv); gst_plugin_load ("libsmoothwave.so"); @@ -24,31 +21,19 @@ main (int argc, char *argv[]) bin = gst_pipeline_new ("bin"); - srcfactory = gst_element_factory_find ("sinesrc"); - g_return_val_if_fail (srcfactory != NULL, -1); - wavefactory = gst_element_factory_find ("smoothwave"); - g_return_val_if_fail (wavefactory != NULL, -1); + src = gst_element_factory_make ("sinesrc", "src"); + wave = gst_element_factory_make ("smoothwave", "wave"); + ximage = gst_element_factory_make ("ximagesink", "sink"); + g_return_val_if_fail (src != NULL, -1); + g_return_val_if_fail (wave != NULL, -1); + g_return_val_if_fail (ximage != NULL, -1); - src = gst_element_factory_create (srcfactory, "src"); - //g_object_set(G_OBJECT(src),"bytes_per_read",(gulong)2048,NULL); - wave = gst_element_factory_create (wavefactory, "wave"); - g_object_set (G_OBJECT (wave), "width", 256, "height", 100, NULL); + gst_bin_add_many (GST_BIN (bin), src, wave, ximage, NULL); + g_return_val_if_fail (gst_element_link_many (src, wave, ximage, + NULL) != FALSE, -1); - gst_bin_add (GST_BIN (bin), GST_ELEMENT (src)); - gst_bin_add (GST_BIN (bin), GST_ELEMENT (wave)); - - gst_pad_link (gst_element_get_pad (src, "src"), - gst_element_get_pad (wave, "sink")); - - appwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_object_get (G_OBJECT (wave), "widget", &wave_widget, NULL); - gtk_container_add (GTK_CONTAINER (appwindow), wave_widget); - gtk_widget_show_all (appwindow); - - gst_element_set_state (GST_ELEMENT (bin), GST_STATE_READY); gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING); - g_idle_add (idle_func, bin); gtk_main (); -- cgit v1.2.1