GStreamer video display into a Qt6 QWidget
Terry Barnaby
terry1 at beam.ltd.uk
Sun Feb 18 09:24:08 UTC 2024
Hi,
Does anyone have any pointers on how I can display a gstreamer video
pipelines output into a Qt6 QWidget these days ?
We are programming a system on a NXP iMX8mp Yocto embedded platform.
This has Wayland/Weston with Qt6 and uses low level iMX8mp 2D/3D
hardware engines.
In the past we were using Qt5 and managed to use waylandsink setting the
surface to draw into from a QWidget's native Wayland surface and
resizing the waylandsink overlay to match the QWidget size. Basically
use was made of gst_video_overlay_set_window_handle() and
gst_video_overlay_set_render_rectangle() and used the Qt5
QPlatformNativeInterface API to get the QWidget's Wayland surface. This
worked reasonably well (a bit dodgy with Qt5 Wayland support,
Weston/Wayland issues, and IMO messy) but it worked and was efficient.
However with the latest NXP Yocto including Qt6 this does not work
correctly. Although the code (and a simple test case) runs and the video
appears on the screen, it is not actually within the QWidget. If I build
the same test example on Fedora, the application jut fails with lots of
waylandsink errors printed.
Is there a better and simple way of getting a gstreamer pipe line to
display video in a QWidget these days ? I have seen there is the Qt QML
based QMultimedia system, but that adds all of the complexity of QML and
I have heard is quite inefficient and no longer supports a manual
program controlled gstreamer pipeline that we need for our application.
Terry
More information about the gstreamer-devel
mailing list