How to implement OSD overlay in Wayland/Weston

Daniel Stone daniel at fooishbar.org
Tue Nov 19 12:43:53 UTC 2019


Hi,

On Tue, 19 Nov 2019 at 11:48, Guillermo Rodriguez
<guillerodriguez.dev at gmail.com> wrote:
> El mar., 19 nov. 2019 a las 11:47, Pekka Paalanen (<ppaalanen at gmail.com>) escribió:
> > If the OSD is just a piece of a bigger application and only needs to be
> > on top of that application's windows, you could probably use xdg
> > extensions or a sub-surface to realize it. This does mean that the OSD
> > component must be in-process with the main app and share the same
> > wl_display instance.
>
> The OSD is conceptually part of the fullscreen application but due to
> several reasons it is implemented as a separate process with a CLI
> that controls the OSD contents and PiP function; the main application
> communicates with the OSD process by writing commands to the OSD
> process' stdin, and reading responses from the OSD process' stdout.
>
> There are several reasons for this approach, but the main one is that
> if there are any issues in the GStreamer side this should not crash
> the whole application. With the current approach, the main application
> can just respawn the OSD process if it dies.
>
> > I think this should be possible also with GStreamer.
>
> Not in the current implementation of the waylandsink plugin -- it
> always creates its own top level window
> (https://gstreamer.freedesktop.org/documentation/waylandsink/index.html?gi-language=c),
> and does not support drawing to an existing surface. But this could be
> patched if needed.

It is completely possible, using the GstVideoOverlay API. See
gst-plugins-bad/tests/examples/waylandsink/main.c for an example of
providing your own wl_surface.

Cheers,
Daniel


More information about the wayland-devel mailing list