[vlc-commits] [Git][videolan/vlc][master] filters: fallback to OpenGL 2 if OpenGL 3 is not available for EGL

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Nov 28 09:56:18 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
ea266ab1 by Yann Lochet at 2022-11-28T09:33:12+00:00
filters: fallback to OpenGL 2 if OpenGL 3 is not available for EGL

- - - - -


1 changed file:

- modules/video_filter/egl_pbuffer.c


Changes:

=====================================
modules/video_filter/egl_pbuffer.c
=====================================
@@ -221,11 +221,31 @@ static int InitEGL(vlc_gl_t *gl, unsigned width, unsigned height)
         = sys->context
         = eglCreateContext(sys->display, cfgv[0], EGL_NO_CONTEXT, ctx_attr);
 
+#ifdef USE_OPENGL_ES2
     if (ctx == EGL_NO_CONTEXT)
     {
         msg_Err (gl, "cannot create EGL context");
         goto error;
     }
+#else
+    if (ctx == EGL_NO_CONTEXT)
+    {
+        const GLint ctx_attr_fallback[] = {
+            EGL_CONTEXT_CLIENT_VERSION, 2,
+            EGL_NONE
+        };
+
+        ctx
+            = sys->context
+            = eglCreateContext(sys->display, cfgv[0], EGL_NO_CONTEXT, ctx_attr_fallback);
+
+        if (ctx == EGL_NO_CONTEXT)
+        {
+            msg_Err (gl, "cannot create EGL context");
+            goto error;
+        }
+    }
+#endif
 
     return VLC_SUCCESS;
 error:



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ea266ab16bccfcdfeddb582ddf2a1452cf9102ac

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ea266ab16bccfcdfeddb582ddf2a1452cf9102ac
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list