[vlc-devel] [PATCH 0/6] WIP libvlc surface rendering size update

Steve Lhomme robux4 at ycbcr.xyz
Mon Jan 28 12:00:36 CET 2019

On 25/01/2019 17:26, Rémi Denis-Courmont wrote:
> This is either incorrect or misleading. VLC always renders both SPU 
> and video in window resolution, whether that's with software or 
> hardware scaling.


> LibVLC apps should be able to select their surface size (as they are 
> able to select their embedded window size). But there are no reasons 
> why that would be SPU-specific.

It's not specific to SPU. But the video scaling doesn't change the 
quality a lot. The decoding is still done at source resolution, whereas 
SPU is rendered at "window" resolution.

So a host app would want to be able to change that based on its target 
rendering, which currently is not handle for OpenGL rendering. It's easy 
to set it on startup (write the "width"/"height" variables). But it gets 
tricky to change it during playback from libvlc.

On way I did it was to hack the vout_ControlChangeDisplaySize() (now 
known as vout_ChangeDisplaySize()) because it's common in libvlc to set 
things on vout thread. It might be cleaner to do it via a "window" 
module (like wdummy) but then that means getting the window module from 
the vout thread structure. That's an extra layer of hack just to get 
this information back to the vout thread anyway.

Alternatively the "width"/"height" variables could be coupled to a 
callback so that the vout thread gets notified when it changes. But it 
should be one variable with both values.

Another option would be to have the values in a structure stored in a 
special variable ("window-config") that a window module would listen to 
and that libvlc would trigger when it changes. A bit like the viewpoint 
is stored as a pointer and notified. I'll probably go with that.

> Le 25 janvier 2019 17:46:59 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> 
> a écrit :
>     When rendering in VLC the window size affects the rendering as SPU may need to
>     be rendered bigger than the video. A host app should get the same quality. If
>     it's playing a small video the SPU should still have a correct size when displayed
>     large.
>     So we need an API to tell libvlc the rendering area size. These patches add this
>     feature by setting the value in the vout (or in a variable if it's not created
>     yet).
>     It may be possible to add callbacks to "wdummy" to do the same in a more regular
>     way.
>     There's also a Qt sample app that renders into OpenGL.
>     Steve Lhomme (6):
>        libvlc: rename libvlc_video_set_output_callbacks
>        doc: add a Qt app to showcase the OpenGL surface callbacks
>        libvlc: add structures to describe the display configuration
>        WIP video_output: make vout_ControlChangeDisplaySize() public
>        libvlc: add an API to set the display configuration
>        WIP qtqlvlc: update the rendering size when changing the window size
>       doc/libvlc/QtGL/main.cpp          |  40 ++++
>       doc/libvlc/QtGL/qtvlcwidget.cpp   | 332 ++++++++++++++++++++++++++++++
>       doc/libvlc/QtGL/qtvlcwidget.h     |  47 +++++
>       doc/libvlc/sdl_opengl_player.cpp  |   4 +-
>       include/vlc/libvlc_media_player.h |  89 +++++++-
>       include/vlc_vout.h                |   4 +
>       lib/libvlc.sym                    |   3 +-
>       lib/media_player.c                |   5 +-
>       lib/video.c                       |  17 ++
>       src/libvlccore.sym                |   1 +
>       src/video_output/vout_internal.h  |   2 -
>       11 files changed, 530 insertions(+), 14 deletions(-)
>       create mode 100644 doc/libvlc/QtGL/main.cpp
>       create mode 100644 doc/libvlc/QtGL/qtvlcwidget.cpp
>       create mode 100644 doc/libvlc/QtGL/qtvlcwidget.h
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez 
> excuser ma brièveté.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list