summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2018-02-10 13:20:43 +0000
committerTim-Philipp Müller <tim@centricular.com>2018-02-10 13:33:42 +0000
commit9c21a17a9aae78097977cd0e3797d5eb5eb6a129 (patch)
treeb70a01213891dafbdbcd91d63aa3d02e9886c558
parenta12f8df0c6933af629d7d75585a42371e59e9021 (diff)
gtk: hook up to autotools build
-rw-r--r--configure.ac78
-rw-r--r--ext/Makefile.am9
-rw-r--r--ext/gtk/Makefile.am2
-rw-r--r--tests/examples/Makefile.am10
-rw-r--r--tests/examples/gtk/.gitignore3
-rw-r--r--tests/examples/gtk/Makefile.am6
6 files changed, 100 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 6b1ecf7ff..cf19d36c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -234,6 +234,46 @@ AC_SUBST(GST_TOOLS_DIR)
AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
+AG_GST_PKG_CHECK_MODULES(GST_GL, gstreamer-gl-[$GST_API_VERSION], [$GST_REQ], no)
+
+dnl FIXME: if uninstalled setup we might not want to pick up an installed gst-gl?
+if test "x$HAVE_GST_GL" = "xyes"; then
+
+ AC_MSG_CHECKING([GStreamer OpenGL window systems ...])
+ GST_GL_WINSYS=`$PKG_CONFIG --variable=gl_winsys gstreamer-gl-1.0`
+ AC_MSG_RESULT([$GST_GL_WINSYS])
+ GST_GL_HAVE_WINDOW_X11=""
+ GST_GL_HAVE_WINDOW_WAYLAND=""
+ GST_GL_HAVE_WINDOW_ANDROID=""
+ GST_GL_HAVE_WINDOW_COCOA=""
+ GST_GL_HAVE_WINDOW_EAGL=""
+ case "$GST_GL_WINSYS" in *x11*) GST_GL_HAVE_WINDOW_X11="1" ;; esac
+ case "$GST_GL_WINSYS" in *wayland*) GST_GL_HAVE_WINDOW_WAYLAND="1" ;; esac
+ case "$GST_GL_WINSYS" in *android*) GST_GL_HAVE_WINDOW_ANDROID="1" ;; esac
+ case "$GST_GL_WINSYS" in *cocoa*) GST_GL_HAVE_WINDOW_COCOA="1" ;; esac
+ case "$GST_GL_WINSYS" in *eagl*) GST_GL_HAVE_WINDOW_EAGL="1" ;; esac
+
+ AC_MSG_CHECKING([GStreamer OpenGL platforms ...])
+ GST_GL_PLATFORMS=`$PKG_CONFIG --variable=gl_platforms gstreamer-gl-1.0`
+ AC_MSG_RESULT([$GST_GL_PLATFORMS])
+ GST_GL_HAVE_PLATFORM_GLX=""
+ GST_GL_HAVE_PLATFORM_EGL=""
+ GST_GL_HAVE_PLATFORM_CGL=""
+ GST_GL_HAVE_PLATFORM_EAGL=""
+ case "$GST_GL_PLATFORMS" in *glx*) GST_GL_HAVE_PLATFORM_GLX="1" ;; esac
+ case "$GST_GL_PLATFORMS" in *egl*) GST_GL_HAVE_PLATFORM_EGL="1" ;; esac
+ case "$GST_GL_PLATFORMS" in *cgl*) GST_GL_HAVE_PLATFORM_CGL="1" ;; esac
+ case "$GST_GL_PLATFORMS" in *eagl*) GST_GL_HAVE_PLATFORM_EAGL="1" ;; esac
+
+ AC_MSG_CHECKING([GStreamer OpenGL apis ...])
+ GST_GL_APIS=`$PKG_CONFIG --variable=gl_apis gstreamer-gl-1.0`
+ AC_MSG_RESULT([$GST_GL_APIS])
+ GST_GL_HAVE_API_GLES2=""
+ GST_GL_HAVE_API_GL=""
+ case "$GST_GL_APIS" in *gles2*) GST_GL_HAVE_API_GLES2="1" ;; esac
+ case "$GST_GL_APIS" in "gl"|"gl "*|*" gl"|*" gl "*) GST_GL_HAVE_API_GL="1" ;; esac
+fi
+
AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
dnl Check for documentation xrefs
@@ -628,6 +668,42 @@ AG_GST_CHECK_FEATURE(GDK_PIXBUF, [GDK pixbuf], gdkpixbuf, [
AG_GST_PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= 2.8.0)
])
+dnl *** gtk+ ***
+HAVE_GTK3_GL="no"
+translit(dnm, m, l) AM_CONDITIONAL(USE_GTK3, true)
+AG_GST_CHECK_FEATURE(GTK3, [Gtk+ elements], gtk, [
+ PKG_CHECK_MODULES(GTK3, gtk+-3.0, [
+ AC_DEFINE([HAVE_GTK3], 1, [Define if Gtk+ 3.0 is installed])
+ HAVE_GTK3="yes"
+ ], [
+ HAVE_GTK3="no"
+ ])
+ PKG_CHECK_MODULES(GTK3_GL, gtk+-3.0 >= 3.15.0, [
+ GDK_WINDOWING="no"
+ if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
+ PKG_CHECK_MODULES(GTK3_X11, gtk+-x11-3.0, [
+ GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_X11_CFLAGS"
+ GTK3_LIBS="$GTK3_LIBS $GTK3_X11_LIBS"
+ GDK_WINDOWING="yes"
+ ], [AC_MSG_NOTICE([Could not find Gtk X11 integration])])
+ fi
+ if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
+ PKG_CHECK_MODULES(GTK3_WAYLAND, gtk+-wayland-3.0, [
+ GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_WAYLAND_CFLAGS"
+ GTK3_LIBS="$GTK3_LIBS $GTK3_WAYLAND_LIBS"
+ GDK_WINDOWING="yes"
+ ], [AC_MSG_NOTICE([Could not find Gtk Wayland integration])])
+ fi
+ if test "x$GDK_WINDOWING" = "xyes" -a "x$HAVE_GST_GL" = "xyes"; then
+ AC_DEFINE([HAVE_GTK3_GL], 1, [Define if Gtk+ 3.0 GL is installed])
+ HAVE_GTK3_GL="yes"
+ fi
+ ], [
+ HAVE_GTK3_GL="no"
+ ])
+])
+AM_CONDITIONAL(USE_GTK3_GL, test "x$HAVE_GTK3_GL" = "xyes")
+
dnl *** Jack ***
translit(dnm, m, l) AM_CONDITIONAL(USE_JACK, true)
AG_GST_CHECK_FEATURE(JACK, Jack, jack, [
@@ -1073,6 +1149,7 @@ ext/cairo/Makefile
ext/dv/Makefile
ext/flac/Makefile
ext/gdk_pixbuf/Makefile
+ext/gtk/Makefile
ext/jack/Makefile
ext/jpeg/Makefile
ext/lame/Makefile
@@ -1104,6 +1181,7 @@ tests/examples/Makefile
tests/examples/audiofx/Makefile
tests/examples/cairo/Makefile
tests/examples/equalizer/Makefile
+tests/examples/gtk/Makefile
tests/examples/jack/Makefile
tests/examples/level/Makefile
tests/examples/rtp/Makefile
diff --git a/ext/Makefile.am b/ext/Makefile.am
index 7d3490205..cb1293b78 100644
--- a/ext/Makefile.am
+++ b/ext/Makefile.am
@@ -22,6 +22,13 @@ else
GDK_PIXBUF_DIR =
endif
+
+if USE_GTK3
+GTK_DIR=gtk
+else
+GTK_DIR=
+endif
+
if USE_JACK
JACK_DIR=jack
else
@@ -125,6 +132,7 @@ SUBDIRS = \
$(DV1394_DIR) \
$(FLAC_DIR) \
$(GDK_PIXBUF_DIR) \
+ $(GTK_DIR) \
$(JACK_DIR) \
$(JPEG_DIR) \
$(LAME_DIR) \
@@ -148,6 +156,7 @@ DIST_SUBDIRS = \
dv \
flac \
gdk_pixbuf \
+ gtk \
jack \
jpeg \
lame \
diff --git a/ext/gtk/Makefile.am b/ext/gtk/Makefile.am
index 057ff3f18..a1eec2627 100644
--- a/ext/gtk/Makefile.am
+++ b/ext/gtk/Makefile.am
@@ -37,10 +37,8 @@ libgstgtk_la_SOURCES = $(sources)
libgstgtk_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
if USE_GTK3_GL
-if USE_GL
libgstgtk_la_SOURCES += gstgtkglsink.c gstgtkglsink.h gtkgstglwidget.c gtkgstglwidget.h
libgstgtk_la_LIBADD += $(GST_GL_LIBS)
endif
-endif
plugin_LTLIBRARIES = libgstgtk.la
diff --git a/tests/examples/Makefile.am b/tests/examples/Makefile.am
index 7c10d02a0..3f9cee64e 100644
--- a/tests/examples/Makefile.am
+++ b/tests/examples/Makefile.am
@@ -1,3 +1,9 @@
+if USE_GTK3
+GTK_DIR=gtk
+else
+GTK_DIR=
+endif
+
if USE_JACK
JACK_DIR=jack
else
@@ -10,10 +16,10 @@ else
CAIRO_DIR=
endif
-SUBDIRS = audiofx equalizer $(JACK_DIR) level \
+SUBDIRS = audiofx equalizer $(GTK_DIR) $(JACK_DIR) level \
rtp shapewipe spectrum v4l2 $(CAIRO_DIR)
-DIST_SUBDIRS = audiofx equalizer jack level \
+DIST_SUBDIRS = audiofx equalizer gtk jack level \
rtp shapewipe spectrum v4l2 cairo
include $(top_srcdir)/common/parallel-subdirs.mak
diff --git a/tests/examples/gtk/.gitignore b/tests/examples/gtk/.gitignore
new file mode 100644
index 000000000..4c84a1f57
--- /dev/null
+++ b/tests/examples/gtk/.gitignore
@@ -0,0 +1,3 @@
+glliveshader
+gtkglsink
+gtksink
diff --git a/tests/examples/gtk/Makefile.am b/tests/examples/gtk/Makefile.am
index cd7962d52..9aed73742 100644
--- a/tests/examples/gtk/Makefile.am
+++ b/tests/examples/gtk/Makefile.am
@@ -8,7 +8,6 @@ gtksink_LDADD = $(GTK3_LIBS) \
$(GST_LIBS)
if USE_GTK3_GL
-if USE_GL
noinst_PROGRAMS += gtkglsink glliveshader
gtkglsink_SOURCES = gtkglsink.c
@@ -23,7 +22,7 @@ gtkglsink_LDADD = \
$(GST_GL_LIBS) \
$(GST_LIBS) \
$(GTK3_LIBS) \
- $(X11_LIBS)
+ $(X_LIBS)
glliveshader_SOURCES = glliveshader.c
glliveshader_CFLAGS = \
@@ -36,6 +35,5 @@ glliveshader_LDADD = \
$(GST_GL_LIBS) \
$(GST_LIBS) \
$(GTK3_LIBS) \
- $(X11_LIBS)
-endif
+ $(X_LIBS)
endif