summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Isorce <julien.isorce@gmail.com>2008-06-24 21:50:47 +0000
committerDavid Schleef <ds@schleef.org>2008-07-15 14:21:38 -0700
commit8d9ccea5eba5c7ee851f630cfbf2e8ed97fcacb7 (patch)
tree94deaa44ae6e2d660b82aaba84a8aa0816ee2870
parenta8ad658c6630127dd92e6cd140e9aba2932b54e4 (diff)
up from kubuntu
git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@546 93df14bb-0f41-7a43-8087-d3e2a2f0e464
-rw-r--r--tests/examples/filterxoverlay/Makefile9
-rw-r--r--tests/examples/filterxoverlay/main.cpp21
2 files changed, 20 insertions, 10 deletions
diff --git a/tests/examples/filterxoverlay/Makefile b/tests/examples/filterxoverlay/Makefile
index 0bb2291..20f2e53 100644
--- a/tests/examples/filterxoverlay/Makefile
+++ b/tests/examples/filterxoverlay/Makefile
@@ -32,8 +32,13 @@ REXE=$(EXE)
CPPFLAGS+=-I/usr/include/gstreamer-0.10 \
-I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include \
- -I/usr/include/libxml2
-LIBS+=-lgstreamer-0.10 -lglib-2.0 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0
+ -I/usr/include/libxml2 \
+ -I/usr/include/gtk-2.0 \
+ -I/usr/lib/gtk-2.0/include \
+ -I/usr/include/cairo \
+ -I/usr/include/pango-1.0 \
+ -I/usr/include/atk-1.0
+LIBS+=-lgstinterfaces-0.10 -lglib-2.0 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0
endif
diff --git a/tests/examples/filterxoverlay/main.cpp b/tests/examples/filterxoverlay/main.cpp
index 575a19b..20006ce 100644
--- a/tests/examples/filterxoverlay/main.cpp
+++ b/tests/examples/filterxoverlay/main.cpp
@@ -19,9 +19,14 @@ static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidge
return GST_BUS_PASS;
g_print ("setting xwindow id\n");
-
- gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
- reinterpret_cast<gulong>GDK_WINDOW_HWND(widget->window));
+
+#ifdef WIN32
+ gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
+ reinterpret_cast<gulong>GDK_WINDOW_HWND(widget->window));
+#else
+ gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
+ GDK_WINDOW_XWINDOW(widget->window));
+#endif
gst_message_unref (message);
@@ -35,7 +40,7 @@ static gboolean expose_cb(GtkWidget* widget, GdkEventExpose* event, GstElement*
return FALSE;
}
-static void destroy_cb(GstElement* pipeline)
+static void destroy_cb(GstElement* pipeline)
{
gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref(pipeline);
@@ -52,7 +57,7 @@ gint main (gint argc, gchar *argv[])
gtk_widget_set_size_request (window, 320, 240);
GstElement* pipeline = gst_pipeline_new ("pipeline");
-
+
g_signal_connect(G_OBJECT(window), "delete-event", G_CALLBACK(destroy_cb), pipeline);
g_signal_connect(G_OBJECT(window), "destroy-event", G_CALLBACK(destroy_cb), pipeline);
@@ -63,7 +68,7 @@ gint main (gint argc, gchar *argv[])
gst_bin_add_many (GST_BIN (pipeline), videosrc, glupload, glfilter, videosink, NULL);
- if (!gst_element_link_many (videosrc, glupload, glfilter, videosink, NULL))
+ if (!gst_element_link_many (videosrc, glupload, glfilter, videosink, NULL))
{
g_print ("Failed to link one or more elements!\n");
return -1;
@@ -80,11 +85,11 @@ gint main (gint argc, gchar *argv[])
g_signal_connect(screen, "expose-event", G_CALLBACK(expose_cb), videosink);
GstStateChangeReturn ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
- if (ret == GST_STATE_CHANGE_FAILURE)
+ if (ret == GST_STATE_CHANGE_FAILURE)
{
g_print ("Failed to start up pipeline!\n");
return -1;
- }
+ }
//From GTK+ doc: "The application is then entirely responsible for drawing the widget background"
//It seems to be not working, the background is still drawn when resizing the window ...