[vlc-devel] [PATCH] opengl: prevent opengl calls from different threads

Rémi Denis-Courmont remi at remlab.net
Thu Sep 26 20:31:52 CEST 2019

Le torstaina 26. syyskuuta 2019, 3.31.08 EEST Alexandre Janniaux a écrit :
> vlc_gl_Resize is the correct way to do the sizing. But if you try
> to resize the gl display in a wayland window currently, you'll see
> that it's not synchronized at all. It's because there is a lot
> missing in the "update the size and position synchronously" sentence.
> Wayland requires nothing specially, but if you want to achieve
> perfect frame resizing, you have to do the following:
> + the parent layer in the hierarchy has to use wl_surface_set_sync()
>   on the surface, and potentially modify its state (attachment,
>   viewporter, scale, position).

You are hereby assuming that there is a parent window, which should eventually 
become true. But currently, the only sane way to do video output on Wayland is 
the standalone XDG shell window provider - which, by definition, does not rely 
on a parent window.

In that later case, as far as I understand, the vout display "merely" needs to 
guarantee that all surfaces committed before acknowledging the change of size 
use the old size, and all surfaces committed after acknowledging the change of 
size use the new size.

Committing an updated surface is not necessary before the acknowledgement. In 
fact, I think it's even forbidden. As such, I think it is not only acceptable, 
but necessary that swapping OpenGL buffers happens some unspecified time after 
the acknowledgement. However, any swap before the VOUT_DISPLAY_CHANGE_* must 
use the old size, and any swap after the VOUT_DISPLAY_CHANGE_* must use the 
new size - because the window provider will send the acknowlegdement right 
after vout_window_ReportSize() returns.

Rémi Denis-Courmont

More information about the vlc-devel mailing list