[gtk/gst.gl.win32: 9/11] gtkgstsink.c: Win32: Limit GL API to gles2 when using EGL




commit 6f5c5dc0463a68107bf901fe8036fc4e4ca653fc
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu May 20 11:39:58 2021 +0800

    gtkgstsink.c: Win32: Limit GL API to gles2 when using EGL
    
    ...if that is the GL API that we got after asking our GdkGLContext.

 modules/media/gtkgstsink.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/modules/media/gtkgstsink.c b/modules/media/gtkgstsink.c
index 33ad04a41c..c6f7d61ea2 100644
--- a/modules/media/gtkgstsink.c
+++ b/modules/media/gtkgstsink.c
@@ -511,11 +511,11 @@ gtk_gst_sink_initialize_gl (GtkGstSink *self)
           else
             {
               gpointer display_ptr = gdk_win32_display_get_egl_display (display);
-              g_message ("If media fails to play, set the envvar `GST_DEBUG=1`, and if GstGL context 
creation fails");
-              g_message ("due to \"Couldn't create GL context: Failed to bind OpenGL API: 
EGL_BAD_PARAMETER\",");
-              g_message ("set in the environment `GST_GL_API=gles2` and restart the GTK application");
-
               self->gst_display = GST_GL_DISPLAY (gst_gl_display_egl_new_with_egl_display (display_ptr));
+
+              /* limit GL API to gles2 if that is what we got from asking GdkGLContext */
+              if (gl_api == GST_GL_API_GLES2)
+                gst_gl_display_filter_gl_api (self->gst_display, GST_GL_API_GLES2);
             }
 #endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]