From 6846746a0e1562230023f43c44b5c9f3bee3e6c8 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Fri, 18 Oct 2024 23:51:53 -0600 Subject: [PATCH] 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: --- .../gst-libs/gst/gl/egl/gstglcontext_egl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gstglcontext_egl.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gstglcontext_egl.c index e7f767ec6a..0dae00df91 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -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);