[vlc-devel] [PATCH 0/4 v1] libvlc surface resizing

Steve Lhomme robux4 at ycbcr.xyz
Fri May 24 16:31:42 CEST 2019


A solution was always proposed to solve this problems but there were some
issues to resolve.

Here is what's new:
- wdummy is not used, rather wextern which doesn't propagate the resize
  requests from the core.
- a callback is provided to the surface callback host, it ends up calling
  vout_window_ReportSize() on the window of its corresponding display module.
- the documentation says it can be called from any thread but care should be
  taken not to call it if the clean_up callback has been called (the locks are
  not implemented in the sample apps for now)

The window_t is always valid when the display module is loaded, and even after
so it's safer to pass that as the opaque of the callback. If the lock is not
respected it's less likely to crash.

wdummy cannot be used because it would propagate sizes requested by the core
even though the size is fixed, externally.
Calling ReportSize is just what a window would do when its size changes. And
it's supposed to be thread safe.

Steve Lhomme (4):
  video_output: add a wextern window which doesn't let the core resize
    it
  libvlc: provide a callback to the host that it can call when its size
    changes
  doc: D3D11 callbacks: set the rendering size when the window size
    changes
  doc: D3D9 callbacks: set the rendering size when the window size
    changes

 doc/libvlc/d3d11_player.cpp             | 38 +++++++++++++++-
 doc/libvlc/d3d9_player.c                | 37 ++++++++++++++-
 include/vlc/libvlc_media_player.h       |  8 ++++
 lib/media_player.c                      |  2 +-
 modules/video_output/Makefile.am        |  2 +
 modules/video_output/wextern.c          | 60 +++++++++++++++++++++++++
 modules/video_output/win32/direct3d11.c |  5 ++-
 modules/video_output/win32/direct3d9.c  |  5 ++-
 8 files changed, 152 insertions(+), 5 deletions(-)
 create mode 100644 modules/video_output/wextern.c

-- 
2.17.1



More information about the vlc-devel mailing list