Commit 9c21a17a authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

gtk: hook up to autotools build

parent a12f8df0
......@@ -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
......
......@@ -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 \
......
......@@ -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
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
glliveshader
gtkglsink
gtksink
......@@ -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
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