examples/snapshot: Does not need GTK but only gdk-pixbuf
authorSebastian Dröge <sebastian@centricular.com>
Wed, 9 Aug 2017 09:26:43 +0000 (12:26 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 9 Aug 2017 09:27:05 +0000 (12:27 +0300)
configure.ac
tests/examples/meson.build
tests/examples/snapshot/Makefile.am
tests/examples/snapshot/meson.build
tests/examples/snapshot/snapshot.c

index a45311e..abdb3e0 100644 (file)
@@ -298,6 +298,7 @@ AC_SUBST(GST_PREFIX)
 dnl GTK is optional and only used in examples
 HAVE_GTK=no
 HAVE_GTK_X11=no
+HAVE_GDK_PIXBUF=no
 GTK_REQ=3.10
 if test "x$BUILD_EXAMPLES" = "xyes"; then
   PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
@@ -306,10 +307,15 @@ if test "x$BUILD_EXAMPLES" = "xyes"; then
   PKG_CHECK_MODULES(GTK_QUARTZ, gtk+-quartz-3.0 >= $GTK_REQ, HAVE_GTK_QUARTZ=yes, HAVE_GTK_QUARTZ=no)
   AC_SUBST(GTK_LIBS)
   AC_SUBST(GTK_CFLAGS)
+
+  PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0, HAVE_GDK_PIXBUF=yes, HAVE_GDK_PIXBUF=no)
+  AC_SUBST(GDK_PIXBUF_LIBS)
+  AC_SUBST(GDK_PIXBUF_CFLAGS)
 fi
 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
 AM_CONDITIONAL(HAVE_GTK_X11, test "x$HAVE_GTK_X11" = "xyes")
 AM_CONDITIONAL(HAVE_GTK_QUARTZ, test "x$HAVE_GTK_QUARTZ" = "xyes")
+AM_CONDITIONAL(HAVE_GDK_PIXBUF, test "x$HAVE_GDK_PIXBUF" = "xyes")
 
 HAVE_QT=no
 HAVE_QT_MOC=no
index 04e07d9..58a512d 100644 (file)
@@ -2,6 +2,7 @@
 gtk_dep = dependency('gtk+-3.0', version : '>= 3.10', required : false)
 gtk_x11_dep = dependency('gtk+-x11-3.0', version : '>= 3.10', required : false)
 gtk_quartz_dep = dependency('gtk+-quartz-3.0', version : '>= 3.10', required : false)
+gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', required : false)
 
 subdir('app')
 subdir('audio')
index 16830ee..2e2e5cd 100644 (file)
@@ -1,10 +1,10 @@
-if HAVE_GTK
-GTK_EXAMPLES=snapshot
+if HAVE_GDK_PIXBUF
+GDK_PIXBUF_EXAMPLES=snapshot
 endif
 
-examples = $(GTK_EXAMPLES)
+examples = $(GDK_PIXBUF_EXAMPLES)
 
 noinst_PROGRAMS = $(examples)
 
-LIBS = $(GST_LIBS) $(GTK_LIBS)
-AM_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS)
+LIBS = $(GST_LIBS) $(GDK_PIXBUF_LIBS)
+AM_CFLAGS = $(GST_CFLAGS) $(GDK_PIXBUF_CFLAGS)
index 296ca8f..61adb9f 100644 (file)
@@ -1,7 +1,7 @@
-if gtk_dep.found()
+if gdk_pixbuf_dep.found()
   executable('snapshot', 'snapshot.c',
     c_args : gst_plugins_base_args,
     include_directories: [configinc, libsinc],
-    dependencies : [libm, glib_deps, gst_dep, video_dep, gtk_dep],
+    dependencies : [libm, glib_deps, gst_dep, video_dep, gdk_pixbuf_dep],
     install: false)
 endif
index 3ebdc15..e15c740 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #include <gst/gst.h>
-#include <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
 
 #include <stdlib.h>