[vlc-devel] [PATCH 23/27] doc: prepare opengl filters samples
Romain Vimont
rom1v at videolabs.io
Thu Jun 25 14:23:10 CEST 2020
Add autotools script to build OpenGL filters samples from the doc, and
be able to run them.
---
Makefile.am | 2 +-
configure.ac | 7 +++++++
doc/Makefile.am | 2 +-
doc/opengl_filters/Makefile.am | 28 ++++++++++++++++++++++++++++
doc/opengl_filters/README.md | 22 ++++++++++++++++++++++
5 files changed, 59 insertions(+), 2 deletions(-)
create mode 100644 doc/opengl_filters/Makefile.am
create mode 100644 doc/opengl_filters/README.md
diff --git a/Makefile.am b/Makefile.am
index 8e49db33eb..5cb37544b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,7 @@
# something. DIST_SUBDIRS stores the directories where nothing is built but
# which have makefiles with distribution information.
# - src (libvlccore) is nedeed by modules
-SUBDIRS = compat doc po share src modules lib bin test
+SUBDIRS = compat po share src modules doc lib bin test
DIST_SUBDIRS = m4 $(SUBDIRS)
EXTRA_DIST = \
diff --git a/configure.ac b/configure.ac
index e6fb7da932..288385e829 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,6 +380,13 @@ AC_ARG_ENABLE([winstore_app],
AS_HELP_STRING([--enable-winstore-app],
[Build targetted for Windows Store apps (default disabled)]))
+dnl OpenGL filters samples
+AC_ARG_ENABLE([opengl_filters_samples],
+ AS_HELP_STRING([--enable-opengl-filters-samples],
+ [Build OpenGL filters samples (default disabled)]))
+AM_CONDITIONAL([WANT_OPENGL_FILTERS_SAMPLES],
+ [test "${enable_opengl_filters_samples}" = "yes"])
+
vlc_winstore_app=0
AS_IF([test "${SYS}" = "mingw32"],[
LIBCOM="-lole32"
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 44adafa7e3..1ff22fe820 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,4 +1,4 @@
-NULL =
+include opengl_filters/Makefile.am
LIBVLC_SAMPLES = \
libvlc/gtk_player.c \
diff --git a/doc/opengl_filters/Makefile.am b/doc/opengl_filters/Makefile.am
new file mode 100644
index 0000000000..b43431a2d3
--- /dev/null
+++ b/doc/opengl_filters/Makefile.am
@@ -0,0 +1,28 @@
+include ../modules/common.am
+
+LTLIBVLCGL = $(top_builddir)/modules/libvlc_opengl.la
+
+OPENGL_PATH = $(top_srcdir)/modules/video_output/opengl
+
+OPENGL_FILTERS_CFLAGS = $(VLC_PLUGIN_CFLAGS) -I$(OPENGL_PATH) $(GL_CFLAGS)
+if HAVE_ANDROID
+OPENGL_FILTERS_CFLAGS += -DUSE_OPENGL_ES2
+endif
+if HAVE_IOS
+OPENGL_FILTERS_CFLAGS += -DUSE_OPENGL_ES2
+endif
+
+OPENGL_FILTERS_LDFLAGS = \
+ -avoid-version \
+ -module \
+ -export-symbol-regex ^vlc_entry \
+ -shrext $(LIBEXT) \
+ -no-undefined
+
+OPENGL_FILTERS =
+
+if WANT_OPENGL_FILTERS_SAMPLES
+# filters enabled only when configured with --enable-opengl-filters-samples
+endif
+
+lib_LTLIBRARIES = $(OPENGL_FILTERS)
diff --git a/doc/opengl_filters/README.md b/doc/opengl_filters/README.md
new file mode 100644
index 0000000000..e44e0f9a76
--- /dev/null
+++ b/doc/opengl_filters/README.md
@@ -0,0 +1,22 @@
+# OpenGL filters samples
+
+To build the samples, configure with `--enable-opengl-filters-samples`:
+
+```bash
+./configure --enable-opengl-filters-samples
+```
+
+Then build VLC as usual.
+
+To run VLC with an OpenGL filter sample enabled:
+
+```bash
+export VLC_PLUGIN_PATH=modules:doc
+./vlc file.mkv --gl-filters=filter1:filter2:filter3
+```
+
+Or directly:
+
+```bash
+VLC_PLUGIN_PATH=modules:doc ./vlc file.mkv --gl-filters=filter1:filter2:filter3
+```
--
2.27.0
More information about the vlc-devel
mailing list