egl: handle configless contexts
authorMatthias Clasen <mclasen@redhat.com>
Mon, 1 Nov 2021 19:48:58 +0000 (15:48 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 2 Nov 2021 18:00:41 +0000 (18:00 +0000)
With EGL_KHR_no_config_context, EGL contexts may just not
have an EGLConfig to give you. Deal with it.

Fixes: #858
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1289>

subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gstglcontext_egl.c

index 24f2091..d3515e1 100644 (file)
@@ -1458,6 +1458,12 @@ gst_gl_context_egl_fill_info (GstGLContext * context, GError ** error)
     goto failure;
   }
 
+  if (config_id == 0) {
+    GST_INFO_OBJECT (context, "egl config not available. ID is 0");
+    gst_object_unref (display_egl);
+    return TRUE;
+  }
+
   attrs[0] = EGL_CONFIG_ID;
   attrs[1] = config_id;
   attrs[2] = EGL_NONE;