[gtk/wip.win32.fixes] gtkgstsink.c: Fix up thinko



commit 8c32339091e23a16c12f215918af592bfc9d6484
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue May 18 17:23:03 2021 +0800

    gtkgstsink.c: Fix up thinko
    
    We need to ensure that the WGL GstGLDisplay is set up properly

 modules/media/gtkgstsink.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/modules/media/gtkgstsink.c b/modules/media/gtkgstsink.c
index bdbc1ad9ea..13346f7688 100644
--- a/modules/media/gtkgstsink.c
+++ b/modules/media/gtkgstsink.c
@@ -485,7 +485,6 @@ gtk_gst_sink_initialize_gl (GtkGstSink *self)
           gchar *gl_api_str = NULL;
           gpointer display_ptr = NULL;
 
-#ifdef GST_GL_HAVE_PLATFORM_EGL
           /*
            * We must force a win32 GstGL display type and if using desktop GL, the GL_Platform to be WGL
            * and an appropriate GstGL API depending on the gl_api we receive.  We also ensure that we use
@@ -493,9 +492,6 @@ gtk_gst_sink_initialize_gl (GtkGstSink *self)
            * gst_gl_display_new() does things correctly if we have GstGL built with both EGL and WGL
            * support, otherwise gst_gl_display_new() will assume an EGL display, which won't work for us
            */
-          gl_api_str = gst_gl_api_to_string (gl_api);
-          g_setenv ("GST_GL_API", gl_api_str, TRUE);
-          g_free (gl_api_str);
 
           if (gl_api == GST_GL_API_OPENGL3 || gl_api == GST_GL_API_OPENGL)
             {
@@ -503,9 +499,14 @@ gtk_gst_sink_initialize_gl (GtkGstSink *self)
               g_setenv("GST_GL_PLATFORM", "wgl", TRUE);
               self->gst_display = gst_gl_display_new ();
             }
+
+#ifdef GST_GL_HAVE_PLATFORM_EGL
           else
             {
               gpointer display_ptr = gdk_win32_display_get_egl_display (display);
+              gl_api_str = gst_gl_api_to_string (gl_api);
+              g_setenv ("GST_GL_API", gl_api_str, TRUE);
+              g_free (gl_api_str);
               self->gst_display = GST_GL_DISPLAY (gst_gl_display_egl_new_with_egl_display (display_ptr));
             }
 #endif


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