Skip to content

Commit

Permalink
gl: hook up to build system
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tp-m committed Dec 19, 2017
1 parent 0eefcb2 commit 8227135
Show file tree
Hide file tree
Showing 39 changed files with 1,337 additions and 125 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -43,6 +43,7 @@ Makefile
*.gir
*.typelib
*.gc??
.dirstamp

/gst-libs/gst/pbutils/gstpluginsbaseversion.h
/gst-libs/gst/tag/mklangtables
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Expand Up @@ -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
Expand Down
54 changes: 52 additions & 2 deletions configure.ac
Expand Up @@ -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
Expand Down Expand Up @@ -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(
[
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions ext/Makefile.am
Expand Up @@ -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
Expand Down Expand Up @@ -57,6 +63,7 @@ endif
SUBDIRS = \
$(ALSA_DIR) \
$(CDPARANOIA_DIR) \
$(GL_DIR) \
$(LIBVISUAL_DIR) \
$(OGG_DIR) \
$(OPUS_DIR) \
Expand All @@ -67,6 +74,7 @@ SUBDIRS = \
DIST_SUBDIRS = \
alsa \
cdparanoia \
gl \
libvisual \
ogg \
opus \
Expand Down
42 changes: 20 additions & 22 deletions ext/gl/Makefile.am
@@ -1,8 +1,17 @@
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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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

Expand Down Expand Up @@ -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) \
Expand Down
23 changes: 18 additions & 5 deletions ext/gl/gstopengl.c
Expand Up @@ -43,6 +43,8 @@
#include "config.h"
#endif

#undef HAVE_VIDEO_AGGREGATOR_IN_BASE

#include "gstglimagesink.h"
#include "gstgluploadelement.h"
#include "gstgldownloadelement.h"
Expand All @@ -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"
Expand All @@ -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" */
Expand Down Expand Up @@ -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)) {
Expand All @@ -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;
Expand All @@ -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 ())) {
Expand All @@ -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)) {
Expand Down Expand Up @@ -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 ())) {
Expand Down

0 comments on commit 8227135

Please sign in to comment.