Waylandsink with Qt QWidget

Nicolas Dufresne nicolas at ndufresne.ca
Mon Nov 28 16:45:28 UTC 2022

Le lundi 28 novembre 2022 à 07:14 +0000, Terry Barnaby via gstreamer-devel a
écrit :
> I am trying to output a video stream into a Qt QWidget using the waylandsink
> plugin. This is with gstreamer 1.20 and QT 5.15.2.
> In general this is working, but if the QWidget gets hidden as the result of
> being in something like a QStackedWindow and then raised the video is no
> longer shown.
> I am using the Weston compositor on an embedded platform, but I have also
> tried the KDE compositor under Fedora35 with the same effect.
> It may be related to the issue I saw in
> https://bugs.kde.org/show_bug.cgi?id=445631 where waylandsink's subsurface is
> not drawn as its parent (QWidget) surface remains in a "hidden" state.
> I'm not sure which of the Qt, waylandsink, Wayland compositor is really at
> fault here, but I assume that either waylandsink, which has access to all of
> the surfaces and subsurfaces, could "wake up" the QWidget's surface when it
> wants to draw or perhaps better the QWidget should somehow "wakeup" it's
> surface when it is raised.
> Any ideas ?

I've met that issue before. I needed to place my waylandsink behind my main
surface, but waylandsink does not yet have surface ordering support. So to avoid
having to hack the GStreamer, I create an extra subsurface, similar to your
videoWidget subsurface. But in order to make it mapped, I created 1x1 buffer and
attached it. Except on Weston, I would show/hide my video by detaching/attaching
that 1x1 buffer. I believe this Weston bug has been fixed now.

So my recommendation would be to map some content to your videoWidget


More information about the gstreamer-devel mailing list