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




commit 1c5aa08f5bcbeb04d3bf675715acedc2e861b5a0
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]