[vlc-devel] [PATCH 0/8 v1] Direct3D callbacks resizing

Steve Lhomme robux4 at ycbcr.xyz
Mon May 13 13:54:45 CEST 2019

The D3D callbacks currently don't know the size of the host texture/window.
That results in stretching as we assume it has the visible size of the video
being played. The text is also rendered for that size, which can give bad
results when stretching/zooming.

This patchset proposes a solution to solve that. When the "device" is created
(a callback of the host called by the display module) we provide a callback
that can be called by the host to init/update the size to render to. This way
the callback is always tied to the display it belongs to, even if there are
many used at once. If the display module is recreated there's a cleanup/setup
callback sequence that will update this callback.

On the core side, it works by reporting the size of the window directly from
the display module. We already report many changes that are usually assumed to
come from the window module. In this case the wdummy cannot handle the window
size by itself.

There was a bug in the core where the initial size (visible source) was used
even after the window size was reported to be different. It turns out that the
core is using the display_cfg to compute sizes when variables are triggered on
init, even after the display module has been created and the size may have
changed. I cleaned that by making sure we know when we're using the initial
display config because we don't have a "mutable" one yet.

Steve Lhomme (8):
  video output: misc cleaning
  video output: remove unused variable
  vout display: use a helper function to set the window title
  video_output: use the vout_display_cfg_t in use by the display when
  video_output: rename display_cfg to init_cfg
  libvlc: provide a callback to the host that it can call when its size
  doc: D3D11 callbacks: set the rendering size when the window size
  doc: D3D9 callbacks: set the rendering size when the window size

 doc/libvlc/d3d11_player.cpp             | 38 +++++++++++++++++++-
 doc/libvlc/d3d9_player.c                | 37 +++++++++++++++++++-
 include/vlc/libvlc_media_player.h       |  8 +++++
 include/vlc_vout_display.h              | 10 +++++-
 modules/video_output/splitter.c         |  4 +--
 modules/video_output/win32/direct3d11.c | 12 +++++--
 modules/video_output/win32/direct3d9.c  | 12 +++++--
 modules/video_output/win32/glwin32.c    |  2 +-
 modules/video_output/win32/wingdi.c     |  2 +-
 src/video_output/display.c              |  6 ++--
 src/video_output/video_output.c         | 46 ++++++++++++-------------
 src/video_output/vout_internal.h        |  3 +-
 src/video_output/vout_wrapper.c         |  6 ++--
 13 files changed, 144 insertions(+), 42 deletions(-)


More information about the vlc-devel mailing list