GStreamer does not take pixel aspect ratio into account for overlay rectangles.
If we do so, we end up with subtitles that are displayed off-center.
Behave like any other GStreamer sink on this matter.
Instead figuring out what kind of pool we should make just use the upstream provided
functionality that comes as part of GLUpload API.
Fixes uploads with GstVideoGLTextureUploadMeta, which legacy VAAPI plugin uses on GLX.
This tries to avoid "scrambled" image on Linux with Intel GPUs that are mostly used
together with x86 CPUs at the expense of using slightly slower non-direct DMABuf import,
by not going with GLES by default on EGL.
The "GST_GL_API" env can still be used to force one or another context type.
We need for GStreamer to be aware of currently used DRM modifier first. On the other
hand forcing GL everywhere would break most embedded systems that only work with GLES,
so do it for x86 processors only... and pray for it to work.
See: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1236
There were various problems with importer loader code. One defect was that
it kept managing a single global list of available importers and marking
which one is currently used on it. This made it not work correctly for
multiple sink instances in single process and was not thread safe.
This commit changes importer loader code into a GstObject subclass, which
keeps its own list of importers per instance and unlike before makes it
possible to free this data from memory when destroyed.
Now only open modules are kept always in memory until process finishes
since we cannot unload them once loaded anyway.
We do not support zero width/height (described in our caps). Set initial video
dimensions to 1x1. They are going to be updated on first buffer after video info is set.
This avoids running into https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1139
and makes sure we do not do any divisions by zero here either.
Add support for premultiplied alpha flag detection when creating GdkMemoryTextures.
Also check if overlays have premultiplied alpha and if they do set this flag for
their video info, so it will be detected when creating a GdkMemoryTexture out of them.
Fixes performance issues with karaoke subtitles, as now GTK does not have to perform
unnecessary multiplication.
Make GL base importer class and all its subclasses that access parent props,
use a different mutex lock then the main importer class.
This way main importer class can continue processing buffers without waiting for
GL-based subclasses, as most GL operations (e.g. upload) are time consuming.
We do not want to build GL-based importers when GTK GL windowing support is missing,
which might happen because of missing deps or on unsupported platform
No need to auto build rawimporter if we are building gluploader as it
will be always loaded on startup, but never used.
Skip the build of it when its meson option is set to "auto".
Add "clappergluploader" module which uses "glupload" and "glcolorconvert" internally,
allowing either uploading RAW system memory into GPU with GL colorspace conversion or
importing DMABufs into GL memory and making a GdkTexture out of them at one go.
Add new GStreamer plugin with custom video sink for Clapper video player.
The main difference is that unlike the old one, this does not operate using `GtkGLArea`
anymore, but processes and displays `GdkTextures` directly through `GtkPicture` widget.
Also this one is installed like any other GStreamer plugin, thus can be used via
`gst-launch-1.0` binary or even by other GTK4 apps if they wish to integrate it.
In order to not depend on GL stuff at build time, this plugin uses seperate GModules
called "importers" in order to import different kind of memories into GdkTexture. This
allows expanding its capabilities further then we were able to do before.