From: Mathieu Duponchelle Date: Tue, 16 Jul 2013 16:27:07 +0000 (+0200) Subject: [769/906] tests/examples: fix and port some of the examples. X-Git-Tag: 1.19.3~507^2~11763 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=782a9c5355e9c88c6e31324e991fb17aebdc9719;p=platform%2Fupstream%2Fgstreamer.git [769/906] tests/examples: fix and port some of the examples. Realize widgets, remove glupload element. --- diff --git a/tests/examples/gtk/fxtest/fxtest.c b/tests/examples/gtk/fxtest/fxtest.c index c4a8e0b..8152cb8 100644 --- a/tests/examples/gtk/fxtest/fxtest.c +++ b/tests/examples/gtk/fxtest/fxtest.c @@ -114,7 +114,7 @@ main (gint argc, gchar * argv[]) { GstStateChangeReturn ret; GstElement *pipeline; - GstElement *uload, *filter, *sink; + GstElement *filter, *sink; GstElement *sourcebin; GError *error = NULL; @@ -171,13 +171,12 @@ main (gint argc, gchar * argv[]) pipeline = gst_pipeline_new ("pipeline"); - uload = gst_element_factory_make ("glupload", "glu"); filter = gst_element_factory_make ("gleffects", "flt"); sink = gst_element_factory_make ("glimagesink", "glsink"); - gst_bin_add_many (GST_BIN (pipeline), sourcebin, uload, filter, sink, NULL); + gst_bin_add_many (GST_BIN (pipeline), sourcebin, filter, sink, NULL); - if (!gst_element_link_many (sourcebin, uload, filter, sink, NULL)) { + if (!gst_element_link_many (sourcebin, filter, sink, NULL)) { g_print ("Failed to link one or more elements!\n"); return -1; } diff --git a/tests/examples/gtk/fxtest/pixbufdrop.c b/tests/examples/gtk/fxtest/pixbufdrop.c index d9f363b..5f10b01 100644 --- a/tests/examples/gtk/fxtest/pixbufdrop.c +++ b/tests/examples/gtk/fxtest/pixbufdrop.c @@ -71,17 +71,6 @@ message_cb (GstBus * bus, GstMessage * message, GstElement * pipeline) gtk_main_quit (); } -static void -realize_cb (GtkWidget * widget, GstElement * pipeline) -{ -#if GTK_CHECK_VERSION(2,18,0) - if (!gdk_window_ensure_native (widget->window)) - g_error ("Failed to create native window!"); -#endif - - gst_element_set_state (pipeline, GST_STATE_PLAYING); -} - static gboolean expose_cb (GtkWidget * widget, GdkEventExpose * event, GstElement * videosink) { @@ -187,7 +176,7 @@ gint main (gint argc, gchar * argv[]) { GstElement *pipeline; - GstElement *uload, *filter, *sink; + GstElement *filter, *sink; GstElement *sourcebin; GstBus *bus; GError *error = NULL; @@ -252,7 +241,6 @@ main (gint argc, gchar * argv[]) pipeline = gst_pipeline_new ("pipeline"); - uload = gst_element_factory_make ("glupload", "glu"); if (method == 2) { filter = gst_element_factory_make ("gloverlay", "flt"); } else { @@ -260,9 +248,9 @@ main (gint argc, gchar * argv[]) } sink = gst_element_factory_make ("glimagesink", "glsink"); - gst_bin_add_many (GST_BIN (pipeline), sourcebin, uload, filter, sink, NULL); + gst_bin_add_many (GST_BIN (pipeline), sourcebin, filter, sink, NULL); - if (!gst_element_link_many (sourcebin, uload, filter, sink, NULL)) { + if (!gst_element_link_many (sourcebin, filter, sink, NULL)) { g_print ("Failed to link one or more elements!\n"); return -1; } @@ -309,6 +297,8 @@ main (gint argc, gchar * argv[]) gtk_container_add (GTK_CONTAINER (window), vbox); + gtk_widget_realize (screen); + bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, screen, NULL); @@ -318,7 +308,6 @@ main (gint argc, gchar * argv[]) g_signal_connect (bus, "message::eos", G_CALLBACK (message_cb), pipeline); gst_object_unref (bus); g_signal_connect (screen, "expose-event", G_CALLBACK (expose_cb), sink); - g_signal_connect (screen, "realize", G_CALLBACK (realize_cb), pipeline); gtk_drag_dest_set (screen, GTK_DEST_DEFAULT_ALL, NULL, 0, GDK_ACTION_COPY); gtk_drag_dest_add_uri_targets (screen); @@ -328,6 +317,8 @@ main (gint argc, gchar * argv[]) gtk_widget_show_all (GTK_WIDGET (window)); + gst_element_set_state (pipeline, GST_STATE_PLAYING); + gtk_main (); return 0; diff --git a/tests/examples/sdl/sdlshare.c b/tests/examples/sdl/sdlshare.c index 8665544..871a90b 100644 --- a/tests/examples/sdl/sdlshare.c +++ b/tests/examples/sdl/sdlshare.c @@ -297,7 +297,7 @@ main (int argc, char **argv) pipeline = GST_PIPELINE (gst_parse_launch ("videotestsrc ! video/x-raw, width=320, height=240, framerate=(fraction)30/1 ! " - "glupload ! gleffects effect=5 ! fakesink sync=1", NULL)); + "gleffects effect=5 ! fakesink sync=1", NULL)); bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); gst_bus_add_signal_watch (bus);