waylandsink: Finish implementation and related library
I've spend a day looking into the state of waylandsink, trying to get the right feature set of GstVideoOverlay and could not. The problem biggest issue is that to implement VideoOverlay properly we would need to know the surface size. Unlike other protocol, the surface size cannot be queried. In fact, the surface size entirely depends on the content, and there is no way to know if there is any content in the provided window.
This information is crucial, because there is no implicit clipping of the video subsurface within the same application. That basically means that as of today's implementation, it is rather easy to get the video to fall outside of your window. And worst. In other implementation, the clipping is left to the windowing system, basically if we want to do right clipping, we pass a render rectangle that is bigger then the window.
That basically means, we want want to turn waylandsink in something more serious, we need a mechanism to set the window size. This information is often known by the application or when a toplevel surface is used (through the configure event). When this work started, a wayland library was added. It currently exist and support context sharing and atomic resize. But as this is not exported, it is completely useless.
- Shall we expose this unstable API starting form 1.17 ?
I looked at the interface, despite that it is missing a window size, the suggested API is quite coherent with how Wayland works.
- Or, shall we simply implement it through properties and action signals ?
We can pretty much do everything though action signal, except that that some simple things (like the context name) in the normal API we endup with complicated things (like a read-only property, or a action signal getter).