vout: add a resize acknowledgement callback
For perfect rendering synchronisation, the change of window size must
be acknowledged after the last picture is rendered in the old size,
and before the first picture is rendered in the new size.
As of
c9d6d95f291b1e2c0e4f374f87790af091282c1e, the window resize is
processed synchronously. This provides for the "after" requirement. But
it failed to address the "before" requirement: the video output thread
can end render a picture so soon after the resize so the window
callback thread has not had time to perform acknowledgement procedures.
This adds a callback to the window resize event which is called before
the display lock (or equivalent) is released. This is guaranteed to be
invoked before the video output thread has the opportunity to render
anything.
Other options were considered:
1) Invoking a callback to the window provider from the video output
thread code code.
-> This can delay the callback unreasonably.
-> Taking the window lock on the video output thread is undesirable
if at all possible.
2) Invoking a windowing system type-specific callback to the window
provider from every display of that windowing system.
-> Same delay and locking problems as 1.
-> Requires patching several display plugins.
3) Exposing the display lock to the window plugin, via new callbacks.
-> This leaks internal implementation of the core to window
providers.
-> This gets really confusing as some callbacks would need explicit
locking and others not.
In comparison, this patch seems like the least of evils.
The callback is passed a parameter rather than as a property of the
window to distinguish it from the existing window callbacks which are
not reentrant.
Refs #25112.