Commit 8227135f authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

gl: hook up to build system

Tests and documentation will follow separately.

The mixer elements in the opengl plugin need to stay
in -bad for now since they use GstVideoAggregator.

https://bugzilla.gnome.org/show_bug.cgi?id=754094
parent 0eefcb23
......@@ -43,6 +43,7 @@ Makefile
*.gir
*.typelib
*.gc??
.dirstamp
/gst-libs/gst/pbutils/gstpluginsbaseversion.h
/gst-libs/gst/tag/mklangtables
......
......@@ -40,6 +40,7 @@ EXTRA_DIST = \
gst-libs/gst/rtsp/rtsp_mkenum.py \
gst-libs/gst/tag/tag_mkenum.py \
gst-libs/gst/video/video_mkenum.py \
gst-libs/gst/gl/gstglconfig.h.meson \
meson_options.txt
DISTCLEANFILES = _stdint.h
......
......@@ -295,6 +295,8 @@ GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
AC_SUBST(GLIB_PREFIX)
AC_SUBST(GST_PREFIX)
AG_GST_GL_CHECKS
dnl GTK is optional and only used in examples
HAVE_GTK=no
HAVE_GTK_X11=no
......@@ -359,6 +361,9 @@ fi
AM_CONDITIONAL(HAVE_QT, test "x$HAVE_QT" = "xyes")
AM_CONDITIONAL(HAVE_QT_MOC, test "x$HAVE_QT_MOC" != "xno")
dnl Check for OpenGL example dependencies (clutter, sdl, etc.)
AG_GST_GL_EXAMPLES_CHECKS
dnl chck for linux headers needed by the joystick seek example
AC_COMPILE_IFELSE(
[
......@@ -420,10 +425,12 @@ AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
dnl define an ERROR_CFLAGS Makefile variable
dnl -Wformat-nonliteral - see ext/pango/gstclockoverlay.c and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39438
dnl -Waggregate-return - xcb_intern_atom() returns an aggregate value
dnl FIXME: -Wformat-nonliteral triggers in gst-libs/gst/gl/gstglcolorconvert.c (should be fixable)
AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef
-Wwrite-strings -Wformat-nonliteral -Wformat-security
-Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
-Wwrite-strings -Wformat-security
-Winit-self -Wmissing-include-dirs -Waddress
-Wno-multichar -Wnested-externs $NO_WARNINGS])
dnl define an ERROR_CXXFLAGS Makefile variable
......@@ -657,6 +664,18 @@ dnl FIXME : add second check somehow if that is necessary
dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
dnl *** gl ***
translit(dnm, m, l) AM_CONDITIONAL(USE_GL, true)
AG_GST_CHECK_FEATURE(GL, [gl elements], gl, [
HAVE_GL="no"
if test x"$USE_OPENGL" = x"yes" -o x"$USE_GLES2" = x"yes"; then
HAVE_GL="yes"
AG_GST_GL_PLUGIN_CHECKS
fi
])
dnl *** ivorbis ***
dnl AM_PATH_IVORBIS only takes two options
translit(dnm, m, l) AM_CONDITIONAL(USE_IVORBIS, true)
......@@ -759,6 +778,7 @@ dnl not building plugins with external dependencies,
dnl but we still need to set the conditionals
AM_CONDITIONAL(USE_ALSA, false)
AM_CONDITIONAL(USE_CDPARANOIA, false)
AM_CONDITIONAL(USE_GL, false)
AM_CONDITIONAL(USE_IVORBIS, false)
AM_CONDITIONAL(USE_LIBVISUAL, false)
AM_CONDITIONAL(USE_OGG, false)
......@@ -890,6 +910,7 @@ sys/xvimage/Makefile
ext/Makefile
ext/alsa/Makefile
ext/cdparanoia/Makefile
ext/gl/Makefile
ext/libvisual/Makefile
ext/ogg/Makefile
ext/opus/Makefile
......@@ -902,6 +923,17 @@ gst-libs/gst/allocators/Makefile
gst-libs/gst/audio/Makefile
gst-libs/gst/app/Makefile
gst-libs/gst/fft/Makefile
gst-libs/gst/gl/Makefile
gst-libs/gst/gl/android/Makefile
gst-libs/gst/gl/cocoa/Makefile
gst-libs/gst/gl/dispmanx/Makefile
gst-libs/gst/gl/glprototypes/Makefile
gst-libs/gst/gl/eagl/Makefile
gst-libs/gst/gl/egl/Makefile
gst-libs/gst/gl/wayland/Makefile
gst-libs/gst/gl/win32/Makefile
gst-libs/gst/gl/x11/Makefile
gst-libs/gst/gl/viv-fb/Makefile
gst-libs/gst/riff/Makefile
gst-libs/gst/rtp/Makefile
gst-libs/gst/rtsp/Makefile
......@@ -934,6 +966,8 @@ pkgconfig/gstreamer-tag.pc
pkgconfig/gstreamer-tag-uninstalled.pc
pkgconfig/gstreamer-video.pc
pkgconfig/gstreamer-video-uninstalled.pc
pkgconfig/gstreamer-gl.pc
pkgconfig/gstreamer-gl-uninstalled.pc
pkgconfig/gstreamer-plugins-base.pc
pkgconfig/gstreamer-plugins-base-uninstalled.pc
tests/Makefile
......@@ -946,6 +980,22 @@ tests/examples/dynamic/Makefile
tests/examples/encoding/Makefile
tests/examples/fft/Makefile
tests/examples/gio/Makefile
tests/examples/gl/Makefile
tests/examples/gl/generic/Makefile
tests/examples/gl/generic/cube/Makefile
tests/examples/gl/generic/doublecube/Makefile
tests/examples/gl/generic/recordgraphic/Makefile
tests/examples/gl/generic/cubeyuv/Makefile
tests/examples/gl/qt/Makefile
tests/examples/gl/gtk/Makefile
tests/examples/gl/gtk/fxtest/Makefile
tests/examples/gl/gtk/3dvideo/Makefile
tests/examples/gl/gtk/switchvideooverlay/Makefile
tests/examples/gl/gtk/filternovideooverlay/Makefile
tests/examples/gl/gtk/filtervideooverlay/Makefile
tests/examples/gl/cocoa/Makefile
tests/examples/gl/sdl/Makefile
tests/examples/gl/clutter/Makefile
tests/examples/overlay/Makefile
tests/examples/seek/Makefile
tests/examples/snapshot/Makefile
......
......@@ -10,6 +10,12 @@ else
CDPARANOIA_DIR=
endif
if USE_GL
GL_DIR=gl
else
GL_DIR=
endif
if USE_LIBVISUAL
LIBVISUAL_DIR=libvisual
else
......@@ -57,6 +63,7 @@ endif
SUBDIRS = \
$(ALSA_DIR) \
$(CDPARANOIA_DIR) \
$(GL_DIR) \
$(LIBVISUAL_DIR) \
$(OGG_DIR) \
$(OPUS_DIR) \
......@@ -67,6 +74,7 @@ SUBDIRS = \
DIST_SUBDIRS = \
alsa \
cdparanoia \
gl \
libvisual \
ogg \
opus \
......
plugin_LTLIBRARIES = libgstopengl.la
# These have to stay in -bad until we can move GstVideoAggregator to -base
# gstglbasemixer.c
# gstglbasemixer.h
# gstglmixer.c
# gstglmixer.h
# gstglstereomix.c
# gstglstereomix.h
# gstglvideomixer.c
# gstglvideomixer.h
libgstopengl_la_SOURCES = \
gstopengl.c \
gstglbasemixer.c \
gstgluploadelement.c \
gstgldownloadelement.c \
gstglcolorconvertelement.c \
......@@ -34,20 +43,16 @@ libgstopengl_la_SOURCES = \
effects/gstgleffectlaplacian.c \
gstglcolorscale.c \
gstglcolorbalance.c \
gstglmixer.c \
gstglvideomixer.c \
gstglfiltershader.c \
gstglfilterapp.c \
gstglviewconvert.c \
gstglstereosplit.c \
gstgldeinterlace.c \
gstglstereomix.c \
gltestsrc.c \
gstgltestsrc.c \
gstglutils.c
noinst_HEADERS = \
gstglbasemixer.h \
gstgluploadelement.h \
gstgldownloadelement.h \
gstglcolorconvertelement.h \
......@@ -61,12 +66,9 @@ noinst_HEADERS = \
effects/gstgleffectssources.h \
gstglcolorscale.h \
gstglcolorbalance.h \
gstglmixer.h \
gstglvideomixer.h \
gstglfiltershader.h \
gstglfilterapp.h \
gstglstereosplit.h \
gstglstereomix.h \
gstgldeinterlace.h \
gstglviewconvert.h \
gltestsrc.h \
......@@ -75,13 +77,13 @@ noinst_HEADERS = \
# full opengl required
if USE_OPENGL
# gstglmosaic.c
libgstopengl_la_SOURCES += \
gstglfilterglass.c \
gstglmosaic.c
gstglfilterglass.c
# gstglmosaic.h
noinst_HEADERS += \
gstglfilterglass.h \
gstglmosaic.h \
effects/gstgleffectscurves.h \
effects/gstgleffectlumatocurve.h
......@@ -123,35 +125,31 @@ noinst_HEADERS += \
endif
libgstopengl_la_OBJCFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) \
-fobjc-arc \
$(GST_OBJCFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_CONTROLLER_CFLAGS) \
$(GL_OBJCFLAGS)
# check order of CFLAGS and LIBS, shouldn't the order be the other way around
# (like in AM_CFLAGS)?
libgstopengl_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CONTROLLER_CFLAGS) \
$(GST_CFLAGS) \
$(GL_CFLAGS) \
$(LIBPNG_CFLAGS) \
$(GRAPHENE_CFLAGS)
libgstopengl_la_LIBADD = \
$(top_builddir)/gst-libs/gst/gl/libgstgl-$(GST_API_VERSION).la \
$(top_builddir)/gst-libs/gst/video/libgstbadvideo-$(GST_API_VERSION).la \
$(top_builddir)/gst-libs/gst/video/libgstvideo-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/pbutils/libgstpbutils-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \
$(GST_BASE_LIBS) \
$(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) \
-lgstpbutils-$(GST_API_VERSION) \
$(GST_CONTROLLER_LIBS) \
$(GST_LIBS) \
$(GL_LIBS) \
$(LIBPNG_LIBS) \
$(JPEG_LIBS) \
......
......@@ -43,6 +43,8 @@
#include "config.h"
#endif
#undef HAVE_VIDEO_AGGREGATOR_IN_BASE
#include "gstglimagesink.h"
#include "gstgluploadelement.h"
#include "gstgldownloadelement.h"
......@@ -51,16 +53,20 @@
#include "gstglfilterbin.h"
#include "gstglsinkbin.h"
#include "gstglsrcbin.h"
#include "gstglmixerbin.h"
#include "gstglfiltercube.h"
#include "gstgleffects.h"
#include "gstglcolorscale.h"
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
#include "gstglmixerbin.h"
#include "gstglvideomixer.h"
#include "gstglstereomix.h"
#endif
#include "gstglfiltershader.h"
#include "gstglfilterapp.h"
#include "gstglstereosplit.h"
#include "gstglstereomix.h"
#include "gstglviewconvert.h"
#include "gstgltestsrc.h"
#include "gstgldeinterlace.h"
......@@ -76,7 +82,9 @@
#if GST_GL_HAVE_OPENGL
#include "gstglfilterglass.h"
/* #include "gstglfilterreflectedscreen.h" */
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
#include "gstglmosaic.h"
#endif
#if HAVE_PNG
#include "gstgldifferencematte.h"
/* #include "gstglbumper.h" */
......@@ -159,11 +167,12 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_SRC_BIN)) {
return FALSE;
}
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
if (!gst_element_register (plugin, "glmixerbin",
GST_RANK_NONE, GST_TYPE_GL_MIXER_BIN)) {
return FALSE;
}
#endif
if (!gst_element_register (plugin, "glfiltercube",
GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) {
......@@ -189,7 +198,7 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) {
return FALSE;
}
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
if (!gst_element_register (plugin, "glvideomixer",
GST_RANK_NONE, gst_gl_video_mixer_bin_get_type ())) {
return FALSE;
......@@ -199,6 +208,7 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, gst_gl_video_mixer_get_type ())) {
return FALSE;
}
#endif
if (!gst_element_register (plugin, "glshader",
GST_RANK_NONE, gst_gl_filtershader_get_type ())) {
......@@ -219,11 +229,12 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_STEREOSPLIT)) {
return FALSE;
}
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
if (!gst_element_register (plugin, "glstereomix",
GST_RANK_NONE, GST_TYPE_GL_STEREO_MIX)) {
return FALSE;
}
#endif
if (!gst_element_register (plugin, "gltestsrc",
GST_RANK_NONE, GST_TYPE_GL_TEST_SRC)) {
......@@ -251,10 +262,12 @@ plugin_init (GstPlugin * plugin)
return FALSE;
}
#endif
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
if (!gst_element_register (plugin, "glmosaic",
GST_RANK_NONE, GST_TYPE_GL_MOSAIC)) {
return FALSE;
}
#endif
#if HAVE_PNG
if (!gst_element_register (plugin, "gldifferencematte",
GST_RANK_NONE, gst_gl_differencematte_get_type ())) {
......
# These have to stay in -bad until we can move GstVideoAggregator to -base
# 'gstglbasemixer.c',
# 'gstglmixerbin.c',
# 'gstglmixer.c',
# 'gstglvideomixer.c',
# 'gstglstereomix.c',
opengl_sources = [
'gstopengl.c',
'gstglbasemixer.c',
'gstgluploadelement.c',
'gstgldownloadelement.c',
'gstglcolorconvertelement.c',
'gstglfilterbin.c',
'gstglmixerbin.c',
'gstglsinkbin.c',
'gstglsrcbin.c',
'gstglimagesink.c',
......@@ -32,14 +36,11 @@ opengl_sources = [
'effects/gstgleffectlaplacian.c',
'gstglcolorscale.c',
'gstglcolorbalance.c',
'gstglmixer.c',
'gstglvideomixer.c',
'gstglfiltershader.c',
'gstglfilterapp.c',
'gstglviewconvert.c',
'gstglstereosplit.c',
'gstgldeinterlace.c',
'gstglstereomix.c',
'gltestsrc.c',
'gstgltestsrc.c',
'gstglutils.c'
......@@ -50,9 +51,10 @@ if build_gstgl and gstgl_dep.found()
opengl_defines = []
if gl_dep.found() # have desktop GL
# These have to stay in -bad until we can move GstVideoAggregator to -base
# 'gstglmosaic.c',
opengl_sources += [
'gstglfilterglass.c',
'gstglmosaic.c',
]
endif
......@@ -103,16 +105,16 @@ if build_gstgl and gstgl_dep.found()
endif
if egl_dep.found() and cc.has_header('libdrm/drm_fourcc.h', required : false)
optional_deps += gstallocators_dep
optional_deps += allocators_dep
endif
gstopengl = library('gstopengl',
opengl_sources,
c_args : gst_plugins_bad_args + opengl_defines,
c_args : gst_plugins_base_args + opengl_defines,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstgl_dep, gstbadvideo_dep, gstvideo_dep,
gstbase_dep, gstcontroller_dep, libm] + optional_deps,
dependencies : [gstgl_dep, video_dep,
gst_base_dep, gst_controller_dep, libm] + optional_deps,
install : true,
install_dir : plugins_install_dir,
)
......
subdir('alsa')
subdir('cdparanoia')
subdir('gl')
if cc.get_id() != 'msvc'
# libvisual has MinGW-specific headers which are not compatible with MSVC
# If we want to build this with MSVC, we must build libvisual with it too
......
if USE_OPENGL
GL_DIR = gl
endif
if USE_GLES2
GL_DIR = gl
endif
SUBDIRS = \
tag \
fft \
......@@ -9,7 +16,22 @@ SUBDIRS = \
pbutils \
riff \
app \
allocators
allocators \
$(GL_DIR)
DIST_SUBDIRS = \
tag \
fft \
audio \
rtp \
sdp \
rtsp \
video \
pbutils \
riff \
app \
allocators \
gl
noinst_HEADERS = gettext.h gst-i18n-app.h gst-i18n-plugin.h glib-compat-private.h
......@@ -26,6 +48,8 @@ rtp: audio
sdp: rtp
gl: video allocators
INDEPENDENT_SUBDIRS = \
tag audio fft video app
......
......@@ -80,13 +80,12 @@ noinst_HEADERS = \
libgstgl_@GST_API_VERSION@_la_LIBADD = \
$(top_builddir)/gst-libs/gst/video/libgstvideo-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/allocators/libgstallocators-@GST_API_VERSION@.la \
$(GMODULE_NO_EXPORT_LIBS) \
$(GST_PLUGINS_BASE_LIBS) \
-lgstvideo-$(GST_API_VERSION) \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(GL_LIBS) \
$(top_builddir)/gst-libs/gst/allocators/libgstbadallocators-@GST_API_VERSION@.la
$(GL_LIBS)
if HAVE_WINDOW_WIN32
SUBDIRS += win32
......@@ -139,8 +138,6 @@ nodist_configexecinclude_HEADERS = $(built_sys_header_configure)
libgstgl_@GST_API_VERSION@_la_CFLAGS = \
-DGST_EXPORTS \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
......
......@@ -433,7 +433,7 @@ if need_platform_egl != 'no'
glconf.set10('GST_GL_HAVE_PLATFORM_EGL', 1)
if cc.has_header('libdrm/drm_fourcc.h', required : false)
gl_misc_deps += gstallocators_dep
gl_misc_deps += allocators_dep
glconf.set10('GST_GL_HAVE_DMABUF', 1)
endif
......@@ -669,12 +669,12 @@ if build_gstgl
gstgl = library('gstgl-' + api_version,
gl_sources,
c_args : gst_plugins_bad_args + gl_cpp_args,
c_args : gst_plugins_base_args + gl_cpp_args,
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,
install : true,
dependencies : [gstbase_dep, gstvideo_dep, gstbadallocators_dep, gmodule_dep,
dependencies : [gst_base_dep, video_dep, allocators_dep, gmodule_dep,
gl_lib_deps, gl_platform_deps, gl_winsys_deps, gl_misc_deps])
gen_sources = []
if build_gir
......@@ -688,7 +688,7 @@ if build_gstgl
includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
install : true,
extra_args : gir_init_section + ['--c-include=gst/gl/gl.h'],
dependencies : [gst_dep, gstbase_dep, gstvideo_dep]
dependencies : [video_dep, gst_dep, gst_base_dep]
)
gen_sources += gl_gir
endif
......@@ -697,5 +697,5 @@ if build_gstgl
gstgl_dep = declare_dependency(link_with : gstgl,
include_directories : [libsinc],
sources: gen_sources,
dependencies : [gstbase_dep, gstvideo_dep] + gl_winsys_deps)
dependencies : [video_dep, gst_base_dep] + gl_winsys_deps)
endif
......@@ -9,3 +9,4 @@ subdir('pbutils')
subdir('riff')
subdir('app')
subdir('allocators')
subdir('gl')
dnl --------------------------------------------------------------------------
dnl GStreamer OpenGL library checks (gst-libs/gst/gl)
dnl --------------------------------------------------------------------------
AC_DEFUN([AG_GST_GL_CHECKS],
[
dnl define an ERROR_OBJCFLAGS Makefile variable
dnl FIXME: make check conditional on Apple OS?
AG_GST_SET_ERROR_OBJCFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wredundant-decls
-Wwrite-strings -Wformat-nonliteral -Wformat-security
-Winit-self -Wmissing-include-dirs -Wno-multichar $NO_WARNINGS])
AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])
AM_CONDITIONAL(HAVE_IOS, test "x$HAVE_IOS" = "xyes")
if test "x$HAVE_IOS" = "xyes"; then
AC_DEFINE(HAVE_IOS, 1, [Define if building for Apple iOS])
fi
dnl *** opengl ***
AC_ARG_ENABLE([opengl],
[ --enable-opengl Enable Desktop OpenGL support @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_GL=yes ;;
no) NEED_GL=no ;;
auto) NEED_GL=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-opengl]) ;;
esac],[NEED_GL=auto])
AC_ARG_WITH([opengl-module-name],
AS_HELP_STRING([--with-opengl-module-name],[library module name for OpenGL (default: libGL)]))
if test x$with_opengl_module_name != x; then
AC_DEFINE_UNQUOTED(GST_GL_LIBGL_MODULE_NAME, "$with_opengl_module_name", [OpenGL module name])
fi
AC_ARG_ENABLE([gles2],
[ --enable-gles2 Enable OpenGL|ES 2.0 support @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_GLES2=yes ;;
no) NEED_GLES2=no ;;
auto) NEED_GLES2=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-gles2]) ;;
esac],[NEED_GLES2=auto])
AC_ARG_WITH([gles2-module-name],
AS_HELP_STRING([--with-gles2-module-name],[library module name for GLES2 (default: libGLESv2)]))
if test x$with_gles2_module_name != x; then
AC_DEFINE_UNQUOTED(GST_GL_LIBGLESV2_MODULE_NAME, "$with_gles2_module_name", [GLES2 module name])
fi
AC_ARG_ENABLE([egl],
[ --enable-egl Enable EGL support @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_EGL=yes ;;
no) NEED_EGL=no ;;
auto) NEED_EGL=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-egl]) ;;
esac],[NEED_EGL=auto])
AC_ARG_WITH([egl-module-name],
AS_HELP_STRING([--with-egl-module-name],[library module name for EGL (default: libEGL)]))
if test x$with_egl_module_name != x; then
AC_DEFINE_UNQUOTED(GST_GL_LIBEGL_MODULE_NAME, "$with_egl_module_name", [EGL module name])
fi
AC_ARG_ENABLE([wgl],
[ --enable-wgl Enable WGL support @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_WGL=yes ;;
no) NEED_WGL=no ;;
auto) NEED_WGL=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-wgl]) ;;
esac],[NEED_WGL=auto])
AC_ARG_ENABLE([glx],
[ --enable-glx Enable GLX support @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_GLX=yes ;;
no) NEED_GLX=no ;;
auto) NEED_GLX=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-glx]) ;;
esac],[NEED_GLX=auto])
AC_ARG_ENABLE([cocoa],
[ --enable-cocoa Enable Cocoa support @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_COCOA=yes ;;
no) NEED_COCOA=no ;;
auto) NEED_COCOA=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-cocoa]) ;;
esac],[NEED_COCOA=auto])
AC_ARG_ENABLE([x11],
[ --enable-x11 Enable x11 support @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_X11=yes ;;
no) NEED_X11=no ;;
auto) NEED_X11=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-x11]) ;;
esac],[NEED_X11=auto])
AC_ARG_ENABLE([wayland],
[ --enable-wayland Enable Wayland support (requires EGL) @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_WAYLAND_EGL=yes ;;
no) NEED_WAYLAND_EGL=no ;;
auto) NEED_WAYLAND_EGL=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-wayland]) ;;
esac],[NEED_WAYLAND_EGL=auto])
AC_ARG_ENABLE([dispmanx],
[ --enable-dispmanx Enable Dispmanx support (requires EGL) @<:@default=auto@:>@],
[case "${enableval}" in
yes) NEED_DISPMANX=yes ;;
no) NEED_DISPMANX=no ;;
auto) NEED_DISPMANX=auto ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-dispmanx]) ;;
esac],[NEED_DISPMANX=auto])
AG_GST_PKG_CHECK_MODULES(X11_XCB, x11-xcb)
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
HAVE_GL=no
HAVE_GLES2=no
HAVE_GLES3_H=no
HAVE_WAYLAND_EGL=no
HAVE_VIV_FB_EGL=no
HAVE_EGL_RPI=no
case $host in
*-mingw32* )
LIBS="$LIBS -lgdi32"
AG_GST_CHECK_LIBHEADER(GL, opengl32, glTexImage2D,, GL/gl.h)
AC_CHECK_HEADER(GL/wglext.h, HAVE_WGLEXT="yes", HAVE_WGLEXT="no", [#include <GL/gl.h>])
if test "x$HAVE_WGLEXT" = "xyes"; then
HAVE_WGL=yes
HAVE_GL=yes
fi
;;
*)
if test "x$NEED_GL" != "xno"; then
AG_GST_PKG_CHECK_MODULES(GL, gl)
if test "x$HAVE_GL" != "xyes"; then
AG_GST_CHECK_LIBHEADER(GL, GL, glTexImage2D,, GL/gl.h)
fi
fi
if test "x$NEED_GLES2" != "xno"; then
AG_GST_PKG_CHECK_MODULES(GLES2, glesv2)
if test "x$HAVE_GLES2" != "xyes"; then
AG_GST_CHECK_LIBHEADER(GLES2, GLESv2, glTexImage2D,, GLES2/gl2.h)
fi
AC_CHECK_HEADER([GLES3/gl3.h], [HAVE_GLES3_H=yes])
AS_IF([test "x$HAVE_GLES3_H" == "xyes"],
[
AC_CHECK_HEADER([GLES3/gl3ext.h], [HAVE_GLES3EXT3_H=yes], [HAVE_GLES3EXT3_H=no], [#include <GLES3/gl3.h>])
])
fi
if test "x$NEED_EGL" != "xno"; then
AG_GST_PKG_CHECK_MODULES(EGL, egl)
if test "x$HAVE_EGL" != "xyes"; then
AG_GST_CHECK_LIBHEADER(EGL, EGL, eglGetError,, EGL/egl.h)
fi
fi
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
dnl imx6 / Vivante specifics
if test "x$HAVE_EGL" = "xyes"; then
AC_CHECK_LIB([EGL], [fbGetDisplay], [HAVE_VIV_FB_EGL=yes])
fi
dnl FIXME: Mali EGL depends on GLESv1 or GLESv2
AC_CHECK_HEADER([EGL/fbdev_window.h],
[
LIBS="$LIBS -lUMP"
AC_CHECK_LIB([Mali], [mali_image_create],
[
LIBS="$LIBS -lMali"
AC_CHECK_LIB([GLESv2], [glEnable],
[
AC_CHECK_HEADER([GLES2/gl2.h],
[
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
AC_CHECK_HEADER([EGL/egl.h],
[
HAVE_EGL=yes
HAVE_GLES2=yes
EGL_LIBS="-lMali -lUMP"
EGL_CFLAGS=""
AC_DEFINE(USE_EGL_MALI_FB, [1], [Use Mali FB EGL platform])
])
])
])
])
])
])
dnl FIXME: EGL of RPi depends on GLESv1 or GLESv2
dnl FIXME: GLESv2 of RPi depends on EGL... WTF!
LIBS="$LIBS -lvcos -lvchiq_arm"
AC_CHECK_LIB([bcm_host], [bcm_host_init],
[
LIBS="$LIBS -lbcm_host"
AC_CHECK_HEADER(bcm_host.h,
[
LIBS="$LIBS -lGLESv2"
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
LIBS="$LIBS -lEGL"
AC_CHECK_HEADER([EGL/egl.h],
[
AC_CHECK_LIB([GLESv2], [glEnable],
[
AC_CHECK_HEADER([GLES2/gl2.h],
[
HAVE_EGL=yes
HAVE_GLES2=yes
HAVE_EGL_RPI=yes
EGL_LIBS="-lbcm_host -lvcos -lvchiq_arm"
EGL_CFLAGS=""
AC_DEFINE(USE_EGL_RPI, [1], [Use RPi platform])
])
])
])
])