As long as we can create a GL context, pass one to
gstreamer. This at least gets us GL textures with
the ngl renderer, the previous code was arbitrarily
refusing that.
GModule requires the .so file extension on macOS for historic reasons.
However Meson defaults to .dylib for modules, so we need to override
it to get the correct extension.
Fixes#3645.
Visual Studio 2013 is just shy of being sufficiently C99-compliant to
build GTK master, as it did not support snprintf() in its CRT
implementation.
Use g_snprintf() to cover for this.
...for at least WGL, since we are not allowed to use wglMakeCurrent(),
which is eventually called by gdk_gl_context_make_current() to share WGL
contexts across different threads, which will cause a crash.
This means, we cannot enable WGL in the gstreamer media backend on
Windows.
The memory pointed to by GstVideoFrame::plane_data becomes invalid after
unmapping causing the GBytes to point at some random memory if the
unmapping is not deferred until its destroy notify.
When the GStreamer buffer is backed by normal system memory this is not
a problem but if it is backed by e.g. an OpenGL texture, dmabuf or some
other hardware-specific memory this will otherwise cause interesting
problems.
This gracefully disable ffmpeg, gstreamer, cups and cloudprint optional
dependencies when they are not available, while still giving full
control to distributors using -Dauto_features=enabled.
Visual Studio does not allow decorating functions with '__declspec (dllexport)'
if a prototype exists and is not decorated with '__declspec (dllexport)' as
well, so we cannot just decorate g_io_module_[load|unload|query] in the various
module sources with G_MODULE_EXPORT because the prototypes of these functions
have been marked with _GLIB_EXTERN, which equates to 'extern' unless overridden
Fix this by overriding _GLIB_EXTERN with the appropriate visibility flag, as we
have used to define _GDK_EXTERN. Unfortunately, we can't just use _GDK_EXTERN
G_MODULE_EXPORT as they may have not been defined yet for our use
Do this across the board for all modules, even if they are not buildable on
Visual Studio nor Windows, for consistency's sake.
We need to override _GLIB_EXTERN to export the required symbols for the
GIO module on Visual Studio, so that the media modules can be
successfully loaded.
We were leaking the GBytes for the image memory, which is a
noticeable memleak to anyone who's casually running a memory monitor.
Go KDE users!
Closes#1200
This way, we can support external libraries providing implementations of
GtkMediaFile.
We also add a media backend called 'nomedia' that can be enabled to not
compile any support for GtkMediaFile. This is useful when people want to
statically compile GTK into an application that does not use media.
For now, this option is the default.
We also support a new environment variable GTK_MEDIA that allows
selecting the implementation to use.
GTK_MEDIA=help can be used to get info about the available
implementations.