[vlc-devel] [PATCH 0/6] OpenGL video filters

Romain Vimont rom1v at videolabs.io
Tue Feb 23 16:06:08 UTC 2021

Last year, we merged an API to write OpenGL filters:

However, we could not run them as a video filter yet.

This patchset introduces:
 - an OpenGL offscreen API (to create an "offscreen" vlc_gl_t)
 - an implementation based on EGL pbuffer
 - a VLC video filter (opengl.c) used to run "OpenGL filters"
 - a mock filter to test

A filter may be run as follow:

    ./vlc --dec-dev=none file.mkv --video-filter='opengl{filter=mock}'
    ./vlc --dec-dev=none file.mkv --video-filter=opengl --opengl-filter=mock

Several "opengl" video filter instances may be chained:

    ./vlc --dec-dev=none file.mkv --video-filter='opengl{filter=mock{mask,speed=1}}:opengl{filter=mock{angle=180,speed=-1}}'

But a single one could also chain several OpenGL filters (with better

    ./vlc --dec-dev=none file.mkv --video-filter='opengl{filter="mock{mask,speed=1}:mock{angle=180,speed=-1}"}'

Note that the OpenGL offscreen implementation with EGL pbuffers does not offer
good performances, because it downloads the filter result to the CPU. It just
allows to test easily. Further patches will add support for GBM platform, and
we'll also submit other implementations later handling opaque formats.

If you have problems running it, you might need to set EGL_PLATFORM=x11 (if you
use X11).


Branch: https://code.videolan.org/rom1v/vlc/-/commits/video_filter_opengl

Alexandre Janniaux (3):
  opengl: add CreateOffscreen API
  video_filter: add egl_pbuffer filter plugin
  video_filter: add opengl filter executor

Romain Vimont (3):
  opengl: replace runtime check by assertion
  opengl: add vflip option to "draw" filter
  opengl: add mock filter

 include/vlc_opengl.h                      |  26 +-
 modules/video_filter/Makefile.am          |  29 ++
 modules/video_filter/egl_pbuffer.c        | 470 ++++++++++++++++++++++
 modules/video_filter/opengl.c             | 327 +++++++++++++++
 modules/video_output/opengl/Makefile.am   |  35 ++
 modules/video_output/opengl/filter_draw.c |  22 +-
 modules/video_output/opengl/filter_draw.h |  10 +-
 modules/video_output/opengl/filter_mock.c | 411 +++++++++++++++++++
 modules/video_output/opengl/gl_api.c      |   3 +
 modules/video_output/opengl/gl_common.h   |  17 +
 src/libvlccore.sym                        |   1 +
 src/video_output/opengl.c                 |  54 +++
 12 files changed, 1399 insertions(+), 6 deletions(-)
 create mode 100644 modules/video_filter/egl_pbuffer.c
 create mode 100644 modules/video_filter/opengl.c
 create mode 100644 modules/video_output/opengl/filter_mock.c


More information about the vlc-devel mailing list