[vlc-devel] [PATCH v2 00/29] Refactor OpenGL renderers

Romain Vimont rom1v at videolabs.io
Thu Feb 6 14:17:29 CET 2020


The rendering of both video pictures and SPU was handled in vout_helper (using
some data from opengl_tex_converter_t).

In order to separate concerns, implement a main renderer and a SPU renderer as
separate "components".

As a result of this patchset:

 - there is no opengl_tex_converter_t anymore;
 - there is a vlc_gl_renderer (renderer.c) which draws the main pictures;
 - there is a vlc_gl_sub_renderer (sub_renderer.c) which draws the SPU;
 - the vout_helper just delegates _Prepare() and _Display() to the renderers.

Here are the changes from the first version of this patchset:
 - patches 1 and 2 are new, they fix a bug and a typo
 - remove a useless assert in patch 4
 - in patch 5, specify that the function pointer may be NULL
 - patch 10 is new, to be able to call GL_ASSERT_NOERROR in patch 11
 - in patch 12, vout_display_opengl_GetAlignedSize() is replaced by a new
   function vlc_align_pot() in gl_util.h
 - in patch 13, replace GenTextures and DelTextures by GenerateTextures and
   DeleteTextures
 - in patches 15 and 28, copy the copyright header from vout_helper.c to
   renderer.c and sub_renderer.c
 - patch 16 is new, to support semi-transparent SPU
 - patch 29 is new, it just reorders the initialization

Here is a branch containing these patches:

    https://code.videolan.org/rom1v/vlc/commits/glrenderer.v2

Romain Vimont (29):
  opengl: apply transform matrix on all planes
  opengl: fix typo
  opengl: move compat definition to gl_common.h
  opengl: make fragment shader local
  opengl: add interop close() callback
  opengl: fix indentation
  opengl: simplify opengl_init_program() call
  opengl: extract interop creation
  opengl: expose interop constructor and destructor
  opengl: move GL_ASSERT_NOERROR macro to header
  opengl: extract subpictures rendering
  opengl: expose GetAlignedSize()
  opengl: expose GenTextures() and DelTextures()
  opengl: move interop functions to interop.c
  opengl: implement subpictures renderer
  opengl: apply subpictures alpha
  opengl: simplify opengl_init_program()
  opengl: make supports_npot local
  opengl: rename tex converter to renderer
  opengl: rename renderer callbacks
  opengl: merge prgm into vlc_gl_renderer
  opengl: move renderer-related fields
  opengl: rename "texture" to "textures"
  opengl: use vlc_gl_renderer when possible
  opengl: refactor renderer creation and destruction
  opengl: move renderer init to CreateRenderer()
  opengl: move renderer clean up to DeleteRenderer()
  opengl: implement renderer
  opengl: reorder renderers initialization

 modules/video_output/Makefile.am              |   12 +-
 modules/video_output/opengl/converter.h       |  111 --
 .../video_output/opengl/fragment_shaders.c    |  189 +--
 modules/video_output/opengl/gl_common.h       |   40 +
 modules/video_output/opengl/gl_util.h         |   37 +
 modules/video_output/opengl/internal.h        |    4 +-
 modules/video_output/opengl/interop.c         |  137 ++
 modules/video_output/opengl/interop.h         |   35 +-
 modules/video_output/opengl/interop_android.c |    6 +-
 modules/video_output/opengl/interop_cvpx.c    |    6 +-
 modules/video_output/opengl/interop_sw.c      |   33 +-
 modules/video_output/opengl/interop_vaapi.c   |    6 +-
 modules/video_output/opengl/interop_vdpau.c   |    8 +-
 modules/video_output/opengl/renderer.c        | 1037 ++++++++++++
 modules/video_output/opengl/renderer.h        |  204 +++
 modules/video_output/opengl/sub_renderer.c    |  474 ++++++
 modules/video_output/opengl/sub_renderer.h    |   79 +
 modules/video_output/opengl/vout_helper.c     | 1445 +----------------
 modules/video_output/opengl/vout_helper.h     |    2 +-
 19 files changed, 2210 insertions(+), 1655 deletions(-)
 delete mode 100644 modules/video_output/opengl/converter.h
 create mode 100644 modules/video_output/opengl/gl_util.h
 create mode 100644 modules/video_output/opengl/renderer.c
 create mode 100644 modules/video_output/opengl/renderer.h
 create mode 100644 modules/video_output/opengl/sub_renderer.c
 create mode 100644 modules/video_output/opengl/sub_renderer.h

-- 
2.25.0



More information about the vlc-devel mailing list