Commit 08232b47 authored by Sebastian Dröge's avatar Sebastian Dröge

cairooverlay: The example always requires gtk-x11

Check for gtk-x11 and only build the example if it's available.
parent fdbdbfef
......@@ -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)
......
......@@ -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)
......
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)
......@@ -25,18 +25,16 @@
* roughly based on gst_x_overlay documentation.
*/
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/interfaces/xoverlay.h>
#include <gtk/gtk.h>
#include <cairo.h>
#include <cairo-gobject.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include <gtk/gtk.h>
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment