[vlc-devel] [PATCH 00/18] Merge OpenGL and Direct3D libvlc callbacks

Steve Lhomme robux4 at ycbcr.xyz
Tue Feb 4 16:25:55 CET 2020

The 2 API's are very similar. Apart from distinct namings and some extra 
features in Direct3D they work the same. First a "device" is setup, the texture
were libvlc is going to render is resized, then there's rendering and a swap 
(in between a "make current enter/leave").

The OpenGL API had a GetProcessAddress that is not used in D3D.

The Direct3D API had support for reporting host size change so that VLC can
resize the (fake) window and provide more appropriate text rendering or
reposition the rendering area. This API is now available to OpenGL hosts.

The Direct3D API allowed the host to use a different opaque after the Setup
callback is called. That allows allocating the graphics resources during the
setup, including multiple playback in the same host. This API is now available 
to OpenGL hosts.

The Direct3D11 engine has support for HDR and tone mapping between what VLC 
provides and what the host reports it is going to handle with that source.
To do that we need to tell the host what the source is like and the host needs
to tell what it will use. In OpenGL this API currently doesn't support any
tone mapping.

The Direct3D11 engine supports rendering the texture planes separately. This
API is not used by the OpenGL API. The callback is ignored, just like with D3D9.

The HDR10 metadata are also passed to the host with each frame so it could
theoretically send them over HDMI (since we're not the ones rendering to the 

This patchset can be found on this branch:

Steve Lhomme (18):
  libvlc: pass the HDR10 metadata to the OpenGL makeCurrent callback
  libvlc: merge direct3d_start_end_rendering_cb and makeCurrent_cb
  libvlc: make the OpenGL host tell the rendering colorimetry it's using
  libvlc: pass the rendering configuration update as a structure
  libvlc: merge libvlc_video_render_cfg_t and
  libvlc: let the OpenGL host refuse a source format if it can't handle
  libvlc: merge direct3d_update_output_cb update into update_output_cb
  libvlc: fix the libvlc_video_cleanup_cb comment
  libvlc: rename the OpenGL callbacks cleanup callback type
  libvlc: let the OpenGL host app change the opaque data used for the
  libvlc: merge libvlc_video_setup_cb and
  libvlc: rename libvlc_video_direct3d_device_cfg_t /
  libvlc: merge libvlc_video_direct3d_device_cleanup_cb and
  libvlc: let the OpenGL host app tell libvlc its rendering area changed
  libvlc: rename libvlc_video_direct3d_set_resize_cb to a more generic
  libvlc: pass the select_plane callback to OpenGL as well
  libvlc: rename the select_plane callback to something more generic
  libvlc: merge libvlc_video_direct3d_set_callbacks into

 doc/libvlc/QtGL/qtvlcwidget.cpp              |  36 ++-
 doc/libvlc/d3d11_player.cpp                  |  13 +-
 doc/libvlc/d3d9_player.c                     |  13 +-
 doc/libvlc/sdl_opengl_player.cpp             |  32 +-
 include/vlc/libvlc_media_player.h            | 295 +++++++------------
 lib/libvlc.sym                               |   1 -
 lib/media_player.c                           |  38 +--
 modules/hw/d3d11/d3d11_device.c              |  10 +-
 modules/hw/d3d9/d3d9_device.c                |  10 +-
 modules/video_output/vgl.c                   |  33 ++-
 modules/video_output/wextern.c               |   4 +-
 modules/video_output/win32/d3d11_swapchain.c |   8 +-
 modules/video_output/win32/d3d11_swapchain.h |   4 +-
 modules/video_output/win32/direct3d11.c      |  10 +-
 modules/video_output/win32/direct3d9.c       |   8 +-
 15 files changed, 229 insertions(+), 286 deletions(-)


More information about the vlc-devel mailing list