From 08232b470e59499b547a192098e96b369c4d5359 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 2 Mar 2011 23:21:15 +0100 Subject: [PATCH] cairooverlay: The example always requires gtk-x11 Check for gtk-x11 and only build the example if it's available. --- configure.ac | 3 +++ tests/examples/Makefile.am | 6 +++++- tests/examples/cairo/Makefile.am | 5 +++-- tests/examples/cairo/cairo_overlay.c | 10 +++------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 2c87768..dd36366 100644 --- a/configure.ac +++ b/configure.ac @@ -258,10 +258,13 @@ if test "x$BUILD_EXAMPLES" = "xyes"; then GTK_REQ=$GTK2_REQ]) AC_MSG_RESULT([$with_gtk (>= $GTK_REQ)]) PKG_CHECK_MODULES(GTK, gtk+-$with_gtk >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no) + dnl some examples need gtk+-x11 + PKG_CHECK_MODULES(GTK_X11, gtk+-x11-$with_gtk >= $GTK_REQ, HAVE_GTK_X11=yes, HAVE_GTK_X11=no) AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) fi AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes") +AM_CONDITIONAL(HAVE_GTK_X11, test "x$HAVE_GTK_X11" = "xyes") dnl should we install schemas ? translit(dnm, m, l) AM_CONDITIONAL(USE_GCONFTOOL, true) diff --git a/tests/examples/Makefile.am b/tests/examples/Makefile.am index 8faf93d..4437a80 100644 --- a/tests/examples/Makefile.am +++ b/tests/examples/Makefile.am @@ -4,11 +4,15 @@ else JACK_DIR= endif -if USE_CAIRO +if USE_CAIRO_GOBJECT +if HAVE_GTK_X11 CAIRO_DIR=cairo else CAIRO_DIR= endif +else +CAIRO_DIR= +endif SUBDIRS = audiofx equalizer $(JACK_DIR) level pulse \ rtp shapewipe spectrum v4l2 $(CAIRO_DIR) diff --git a/tests/examples/cairo/Makefile.am b/tests/examples/cairo/Makefile.am index 1585961..5fa772d 100644 --- a/tests/examples/cairo/Makefile.am +++ b/tests/examples/cairo/Makefile.am @@ -1,11 +1,12 @@ if USE_CAIRO_GOBJECT -if HAVE_GTK +if HAVE_GTK_X11 noinst_PROGRAMS = cairo_overlay endif endif cairo_overlay_SOURCES = cairo_overlay.c -cairo_overlay_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS) $(CAIRO_CFLAGS) +cairo_overlay_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \ + $(GTK_CFLAGS) $(CAIRO_CFLAGS) cairo_overlay_LDFLAGS = \ $(GST_LIBS) -lgstinterfaces-0.10 -lgstvideo-$(GST_MAJORMINOR) \ $(GTK_LIBS) $(CAIRO_LIBS) diff --git a/tests/examples/cairo/cairo_overlay.c b/tests/examples/cairo/cairo_overlay.c index f460484..52c947b 100644 --- a/tests/examples/cairo/cairo_overlay.c +++ b/tests/examples/cairo/cairo_overlay.c @@ -25,18 +25,16 @@ * roughly based on gst_x_overlay documentation. */ - #include #include #include -#include #include #include -#ifdef GDK_WINDOWING_X11 #include -#endif + +#include static gulong video_window_xid = 0; @@ -64,9 +62,7 @@ bus_sync_handler (GstBus * bus, GstMessage * message, gpointer user_data) static void video_widget_realize_cb (GtkWidget * widget, gpointer data) { -#ifdef GDK_WINDOWING_X11 video_window_xid = GDK_WINDOW_XID (widget->window); -#endif } static GtkWidget * @@ -187,7 +183,7 @@ main (int argc, char **argv) gst_init (&argc, &argv); window = setup_gtk_window (); - overlay_state = g_new (CairoOverlayState, 1); + overlay_state = g_new0 (CairoOverlayState, 1); pipeline = setup_gst_pipeline (overlay_state); gst_element_set_state (pipeline, GST_STATE_PLAYING); -- 2.7.4