gl/context: move egl creation lower in priority on _new()

e.g. if running a dual wgl/egl built library, then egl will always
succeed in creating the GstGLContext because almost anything could
support egl, as long as eglGetDisplay() works.

wgl, however has a check for the correct display type so should move
earlier in the tried list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1154>
This commit is contained in:
Matthew Waters 2021-05-18 20:00:01 +10:00 committed by GStreamer Marge Bot
parent f0eca69a14
commit 42512c92de

View file

@ -353,10 +353,6 @@ gst_gl_context_new (GstGLDisplay * display)
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "glx")))
context = GST_GL_CONTEXT (gst_gl_context_glx_new (display));
#endif
#if GST_GL_HAVE_PLATFORM_EGL
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "egl")))
context = GST_GL_CONTEXT (gst_gl_context_egl_new (display));
#endif
#if GST_GL_HAVE_PLATFORM_WGL
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "wgl")))
context = GST_GL_CONTEXT (gst_gl_context_wgl_new (display));
@ -365,6 +361,10 @@ gst_gl_context_new (GstGLDisplay * display)
if (!context && (!user_choice || g_strstr_len (user_choice, 4, "eagl")))
context = GST_GL_CONTEXT (gst_gl_context_eagl_new (display));
#endif
#if GST_GL_HAVE_PLATFORM_EGL
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "egl")))
context = GST_GL_CONTEXT (gst_gl_context_egl_new (display));
#endif
if (!context) {
/* subclass returned a NULL context */