gst-plugins-base: Set swap interval to 0 for wayland EGL windows

This allows the stream to drive the buffers submitted to the display server.
If the application does not receive frame events for a period of time due to
minimization or tty switch for example, instead of waiting to process and
then catching up when frame events resume, the stream will resume instantly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7691>
This commit is contained in:
Scott Moreau 2024-10-18 23:51:53 -06:00 committed by GStreamer Marge Bot
parent 64c6ff97c4
commit 6846746a0e

View file

@ -1278,6 +1278,15 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate)
}
result = eglMakeCurrent (egl->egl_display, egl->egl_surface,
egl->egl_surface, egl->egl_context);
#if GST_GL_HAVE_WINDOW_WAYLAND
if (GST_IS_GL_WINDOW_WAYLAND_EGL (context->window)) {
if (eglSwapInterval (egl->egl_display, 0) == EGL_TRUE) {
GST_INFO ("Set EGL swap interval to 0");
} else {
GST_INFO ("Failed to set EGL swap interval to 0");
}
}
#endif
} else {
result = eglMakeCurrent (egl->egl_display, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);