[vlc-commits] [Git][videolan/vlc][master] 2 commits: egl: factor common code

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sat Jan 13 11:03:51 UTC 2024



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
9ae398fd by Rémi Denis-Courmont at 2024-01-13T12:40:58+02:00
egl: factor common code

No functional changes.

- - - - -
467c85eb by Rémi Denis-Courmont at 2024-01-13T12:40:58+02:00
egl/wayland: require reference counting

Apart from the stand-alone window provider (which requires server-side
decorations), this provider cannot practically be used - unless
reference counting is supported.

So check that reference counting is supported and fail safe otherwise.

- - - - -


1 changed file:

- modules/video_output/opengl/egl.c


Changes:

=====================================
modules/video_output/opengl/egl.c
=====================================
@@ -164,34 +164,32 @@ static void ReleaseDisplay(vlc_gl_t *gl)
 static EGLDisplay OpenDisplay(vlc_gl_t *gl)
 {
     vlc_window_t *surface = gl->surface;
-    EGLint ref_attr = EGL_NONE;
-
-# ifdef EGL_KHR_display_reference
-    if (CheckClientExt("EGL_KHR_display_reference"))
-        ref_attr = EGL_TRACK_REFERENCES_KHR;
-# endif
 
     if (surface->type != VLC_WINDOW_TYPE_WAYLAND)
         return EGL_NO_DISPLAY;
+    if (!CheckClientExt("EGL_KHR_display_reference")) {
+        msg_Warn(gl, "EGL display reference counting not supported");
+        return EGL_NO_DISPLAY;
+    }
 
-# if defined(EGL_VERSION_1_5)
-#  ifdef EGL_KHR_platform_wayland
-    if (CheckClientExt("EGL_KHR_platform_wayland")) {
-        const EGLAttrib attrs[] = { ref_attr, EGL_TRUE, EGL_NONE };
+# ifdef EGL_KHR_display_reference
+    static const EGLAttrib attrs[] = {
+        EGL_TRACK_REFERENCES_KHR, EGL_TRUE,
+        EGL_NONE
+    };
 
+#  if defined(EGL_VERSION_1_5)
+#   ifdef EGL_KHR_platform_wayland
+    if (CheckClientExt("EGL_KHR_platform_wayland"))
         return eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR,
                                      surface->display.wl, attrs);
-    }
-#  endif
-
-# elif defined(EGL_EXT_platform_wayland)
-    if (CheckClientExt("EGL_EXT_platform_wayland")) {
-        const EGLint attrs[] = { ref_attr, EGL_TRUE, EGL_NONE };
+#   endif
 
+#  elif defined(EGL_EXT_platform_wayland)
+    if (CheckClientExt("EGL_EXT_platform_wayland"))
         return getPlatformDisplayEXT(EGL_PLATFORM_WAYLAND_EXT,
                                      surface->display.wl, attrs);
-    }
-
+#  endif
 # endif
     return EGL_NO_DISPLAY;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/346113b36b5ff643a886c1b59c14a00ada39ce02...467c85eba337e5b2ac57afb9bbbe0773d22fd10b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/346113b36b5ff643a886c1b59c14a00ada39ce02...467c85eba337e5b2ac57afb9bbbe0773d22fd10b
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