QT5.15.2 with Wayland/Weston and GStreamer video sink losing surface
-
We are trying to output a GStreamer video into a QWidget using the GStreamwer waylandsink GStreamer module.
In general we have this working setting teh QWidget with the Qt::WA_NativeWindow, Qt::WA_DontCreateNativeAncestors and Qt::WA_TransparentForMouseEvents attributes and passing the Wayland surface to the waylandsink module with:struct wl_surface* surface = static_cast<struct wl_surface*>(native->nativeResourceForWindow("surface", owVideo1->windowHandle())); gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(ogstVideoSink), (guintptr)surface);
However, we need the video windows to be within a QStackedWidget so that separate "pages" of information, settings and the video can be shown. Unfortunately it appears that the QStackedWidget effectively uses setVisible(0) in the QWidget tree when hiding the widget and if you then show the video "page" the gstreamer video output is no longer shown probably as Qt has deleted the underlying Wayland surface or something like that.
I have tried using a QStackedLayout with mode QStackedLayout::StackAll, and this works sort of (uses raise()/lower()), however the video window remains above others even with the lower(). A move of the QWidget (move(4096, 0)) does make it disappear so this can work just. But this messes up the QT keyboard tabbing in all of the other widgets in the QStackedLayout.We have also tried parenting the QWidget used for video from a higher level widget so the QStackedLayout can work properly with tabbing and then move the QWidget over the stacked area when the video page is shown. This works but then messes up operation with QScrolledAreas within the stacked widgets for some reason.
Any ideas on how we can properly output gstreamer to a QWidget in a Wayland/Weston environment (With X11 it works fine) ?
Is there a way to stop Qt using the hide()/show() on a particular QWidget within a QStackedLayout ?
Is there a way to get GStreamers waylandsink to use a, I presume, new surface when a new one is created when the QStackedLayout shows the QWidget ?Terry