[vlc-commits] [Git][videolan/vlc][master] 2 commits: egl: Fix initialization on some non-MESA egl 1.4 implementations

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 10 08:34:15 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
cd1e0095 by Romain Roffé at 2022-11-10T06:32:36+00:00
egl: Fix initialization on some non-MESA egl 1.4 implementations

A lot of egl 1.4 implementations on Android devices reject
eglQueryString(EGL_NO_DISPLAY, xxx) calls.

This partially reverts commit 8ff0e6267b4f3b76e2526192a98af68fcd6aa953.

Fixes #27461

- - - - -
978e6b99 by Romain Roffé at 2022-11-10T06:32:36+00:00
egl: ensure version 1.4

Restores the expected goal of 8ff0e6267b4f3b76e2526192a98af68fcd6aa953.

- - - - -


1 changed file:

- modules/video_output/opengl/egl.c


Changes:

=====================================
modules/video_output/opengl/egl.c
=====================================
@@ -574,12 +574,15 @@ static void Close(vlc_gl_t *gl)
     free (sys);
 }
 
-static bool InitEGL(void)
+static void InitEGL(void)
 {
     static vlc_once_t once = VLC_STATIC_ONCE;
 
     if (unlikely(!vlc_once_begin(&once))) {
         clientExts = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+        if (!clientExts)
+            clientExts = "";
+
 #ifdef EGL_EXT_platform_base
         getPlatformDisplayEXT =
             (void *) eglGetProcAddress("eglGetPlatformDisplayEXT");
@@ -588,7 +591,6 @@ static bool InitEGL(void)
 #endif
         vlc_once_complete(&once);
     }
-    return clientExts != NULL; /* check if EGL version is 1.4 or later */
 }
 
 /**
@@ -597,8 +599,7 @@ static bool InitEGL(void)
 static int Open(vlc_gl_t *gl, const struct gl_api *api,
                 unsigned width, unsigned height)
 {
-    if (!InitEGL())
-        return VLC_ENOTSUP;
+    InitEGL();
 
     int ret = VLC_EGENERIC;
     vlc_object_t *obj = VLC_OBJECT(gl);
@@ -701,7 +702,7 @@ error:
 static int OpenGLES2(vlc_gl_t *gl, unsigned width, unsigned height)
 {
     static const struct gl_api api = {
-        "OpenGL_ES", EGL_OPENGL_ES_API, 3, EGL_OPENGL_ES2_BIT,
+        "OpenGL_ES", EGL_OPENGL_ES_API, 4, EGL_OPENGL_ES2_BIT,
         { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE },
     };
     return Open(gl, &api, width, height);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/79052fae54a5fa6ad9f03f762e066b9642ecd499...978e6b994da9e4bf86007d3bfe518ffa8849b9f4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/79052fae54a5fa6ad9f03f762e066b9642ecd499...978e6b994da9e4bf86007d3bfe518ffa8849b9f4
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