gstreamer/subprojects/gst-plugins-good/ext/qt
Matthias Fuchs 7c49ce1c21 qmlglsrc: sync on the streaming thread
After rendering a QML scene the qmlglsrc element copies the contents of
the scene to a GStreamer buffer. This happens on the Qt render thread.
Then it attaches a sync point to the destination buffer. This sync point
must be awaited by other threads which use the buffer later on. The
current implementation relies on the downstream elements to wait for the
sync point. However, there are situation where this does not work. The
GstBaseTransform e.g. copies the buffer metadata (which overwrites the
sync point without waiting for it) *before* waiting for the sync point.

This commit waits for the sync point inside the qmlglsrc element before
sending it downstream. The wait command is issued on the streaming
thread with the pipeline OpenGL context, i.e. it will synchronize with
the GStreamer OpenGL thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5515>
2023-10-20 00:36:26 +00:00
..
gstplugin.cc Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqsgtexture.cc Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqsgtexture.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtelement.cc Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtelements.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtgl.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtglutility.cc gl: provide a pkg-config/gir file for the viv-fb backend 2023-07-12 22:45:04 +10:00
gstqtglutility.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtoverlay.cc Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtoverlay.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtsink.cc all: Use new navigation interface and API 2022-03-23 13:14:52 +00:00
gstqtsink.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstqtsrc.cc qmlglsrc: sync on the streaming thread 2023-10-20 00:36:26 +00:00
gstqtsrc.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
meson.build qt: Unbreak build with qt-egl enabled but viv_fb missing 2023-08-18 12:45:14 +00:00
qtglrenderer.cc qt/glrenderer: don't attempt to use QWindow from non-Qt main thread 2023-05-31 11:20:04 +01:00
qtglrenderer.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
qtitem.cc base:navigation: Cleanup navigation key modifiers enum 2022-12-15 16:47:13 +00:00
qtitem.h qt: Add touch event support 2022-03-23 13:14:52 +00:00
qtplugin.pro Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
qtwindow.cc qtwindow: unref caps in destructor 2023-04-14 16:04:55 +00:00
qtwindow.h qmlglsrc: Fix deadlock when stopping 2022-04-06 10:54:51 +00:00
README.md Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00

Building for non-linux platforms

Compiling the gstqmlgl plugin for non-linux platforms is not so trivial. This file explains the steps that need to be followed for a successful build.

Step 1

Build GStreamer for the target platform using cerbero.

Step 2

Enter the cerbero shell:

./cerbero-uninstalled -c config/<target platform config>.cbc shell

Step 3

Export the following environment variables:

export PATH=/path/to/Qt/<version>/<platform>/bin:$PATH

if you are cross-compiling (ex. for android), also export:

export PKG_CONFIG_SYSROOT_DIR=/

Additionally, if you are building for android:

export ANDROID_NDK_ROOT=$ANDROID_NDK

Note: the ANDROID_NDK variable is set by the cerbero shell; if you are not using this shell, set it to the directory where you have installed the android NDK. Additionally, if you are not building through the cerbero shell, it is also important to have set PKG_CONFIG_LIBDIR to $GSTREAMER_ROOT/lib/pkgconfig.

Step 4

cd to the directory of the gstqmlgl plugin and run:

qmake .
make

Step 5

Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it directly if it is compiled statically

Building for Windows using pre-built gstreamer development package and Qt Creator

Step 1

Open qtplugin.pro in Qt Creator as project and configure it as usual.

Step 2

Open qtplugin.pro in the editor and make sure GSTREAMER_PATH variable in qmlplugin.pro is set to the path of your gstreamer SDK installation. This directory should contain subdirectories bin, include, lib etc. Pay attention to the correct choice of x86 or x86_64 platform.

Step 3

Build the project as usual.

Step 3

Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it directly if it is compiled statically.

Building for Windows using pre-built gstreamer development package and Qt on MinGW command line

Step 1

Launch Qt developer command line from the Start menu.

Step 2

cd to the directory of the gstqmlgl plugin and make sure GSTREAMER_PATH variable in qmlplugin.pro is set to the path of your gstreamer SDK installation. This directory should contain subdirectories bin, include, lib etc. Pay attention to the correct choice of x86 or x86_64 platform.

Step 3

Run the following commands in the gstqmlgl plugin directory:

qmake 
mingw32-make

Step 4

Copy the built plugin to your $GSTREAMER_ROOT/lib/gstreamer-1.0 or link to it directly if it is compiled statically.