When the glupload element renegotiates the caps, set_caps will reset the
method_impl to NULL, but the method will be kept. transform_caps tries
to use the method_impl to transform the caps, because a method is set,
but will segfault.
gst_gl_memory_setup_buffer() was marked as introspectable=0
anyway, so might just as well mark it as '(skip)' and suppress
the warning. Reason is the (element-type gpointer) on wrapped_data.
gstglmemory.c:1426: Warning: GstGL: gst_gl_memory_setup_buffer: argument wrapped_data: Missing (element-type) annotation
gstglmemory.c:1426: Warning: GstGL: gst_gl_memory_setup_buffer: argument wrapped_data: Missing (element-type) annotation
egl/gstegl.h:40: Warning: GstGL: symbol='EGL_EGLEXT_PROTOTYPES': Unknown namespace for symbol 'EGL_EGLEXT_PROTOTYPES'
Using a single condition variable for synchronization across all GL
messages is very slow on Windows and uses up to 20% CPU usage in some
workloads due to lock contention and false broadcasts.
Using per-message event handles reduces the CPU usage to negligible
amounts despite having to allocate a new event handle for each
message.
Implement the prepare and check functions according to the
documentation by returning TRUE when events should be dispatched
via the dispatch function.
As wl_display_read_events never blocks we can call it unconditionally
without looking at the poll status.
This simplifies the implementation and gets rid of a race where the
mainloop could get blocked due to nobody actually reading the events
from the wayland connection.
Doing so involves retrieving the current viewport from OpenGL which as
with any glGet operation, is expensive.
This means that the various sinks need to reset the viewport on draw.
In the process, fix resizing on cocoa.
If we only ever make it to READY, transform_caps can create an
internal convert object that will never be freed by basetransform's
stop vmethod (PAUSED->READY).
The use of mediump as a specifier in GLSL shaders will have limited
resolution and when used as texture coordinates may become inaccurate
over texture sizes of 1024.
Make consistent with what autotools puts into enabled_gl_apis
variable. Autotools puts 'gl' in there instead of 'opengl'.
This would cause problems when building -bad glmixers plugin
in meson against a -base that was built with autotools.
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/871
Otherwise surface_width/surface_height stored in GstGLWindowPrivate
isn't changed, sometimes an unnecessary reconfigure event is sent on
sinkpad, then result in upstream reconfiguring.
Example pipeline:
gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink
Binding the vertex array to 0 will unbind everything else already.
In the previous order older versions of the Intel GL driver caused
errors to be printed for every single call when disabling the vertex
attrib arrays after binding the vertex array to 0.
Non-direct dmabuf uploads, just as direct dmabuf uploads, create EGL
images and thus GL textures of the same width as the imported image.
The input dmabuf line stride is not relevant to the resulting texture
in both cases.
This fixes the case where non-direct uploads of input dmabufs with line
stride larger than the width will for example cause glcolorconvert to
sample only the left part (width * bytes per pixel / stride) of the
image, causing a horizontally stretched and cropped output image.
If multiple DRM connectors are connected, currently the first one is
picked. Improve this by adding an environment variable that allows for
choosing a connector by name. The connector name has been made so they
are compatible with modetest/modeprint DRM utilities.
Related to #490
* List all connectors, modes, and encoders, even after picking one
* Add missing DRM_MODE_CONNECTOR_DPI string for logging and improve
existing strings
* Make sure the names matches modetest/modeprint from DRM utilities
Related to #490
This adds a few missing gst_object_unref calls for the opengl context in
gstglwindow_gbm_egl.c, as well as the missing close call for the
drm node fd in gst_gl_display_gbm_finalize.
Currently in Python it would become a signed 64 bit value but should
actually be an unsigned 32 bit value with all bits set.
This is the same problem as with GST_MESSAGE_TYPE_ANY.
See https://bugzilla.gnome.org/show_bug.cgi?id=732633
Rather then letting gst_gl_memory_setup_buffer guess the GL format used
for an eglimage after importing a dmabuf be explicit about it. This
fixes issues where dmabuf import may have used another format then
gst_gl_format_from_video_info would guess on the basis of the available
GL extensions.
In particular on etnaviv the gst_gl_format_from_video_info would
assuming a luminance + alpha GL format is used for YUY2, but the dmabuf
import will always use RG88. Which causes images to end up somewhat pink when
displayed on the screen.
When importing an egl image from dmabuf gst_gl_format_from_video_info
was used to work what the result GL format will be. Unfortunately that
will only work if the conventional format and the choosen DRM fourcc for
the format match up.
On etnaviv platforms there is no support for GL_EXT_texture_rg, so the
GL format chosen for YUY2 ends up being GST_GL_LUMINANCE_ALPHA. However
DRM does not do luminance + alpha as it's a legacy GL thing, so the
dmabuf import ends up using DRM_FORMAT_GR88.
To fix this, tie the DRM_FORMAT and the GL format together so they
always match up.