Commit fc175a0e authored by Haihua Hu's avatar Haihua Hu

glcontext_egl: fix glcontext fail when egl support EGL_KHR_no_config_context

eglchooseconfig() will return NULL config when no valid config found, eg when
try GLES 3.2 on GLES 2.0 platform, but this will not make create context fail
because it support EGL_KHR_no_config_context, and will fail later.

Need also check numconfig if support EGL_KHR_no_config_context
parent d98835fd
Pipeline #39464 passed with stages
in 61 minutes and 6 seconds
......@@ -452,8 +452,14 @@ gst_gl_context_egl_choose_config (GstGLContextEGL * egl, GstGLAPI gl_api,
if (eglChooseConfig (egl->egl_display, config_attrib,
&egl->egl_config, 1, &numConfigs)) {
GST_INFO ("config set: %" G_GUINTPTR_FORMAT ", %u",
(guintptr) egl->egl_config, (unsigned int) numConfigs);
if (numConfigs > 0) {
GST_INFO ("config set: %" G_GUINTPTR_FORMAT ", %u",
(guintptr) egl->egl_config, (unsigned int) numConfigs);
} else {
g_set_error (error, GST_GL_CONTEXT_ERROR,
GST_GL_CONTEXT_ERROR_WRONG_CONFIG, "no match config");
goto failure;
}
} else {
g_set_error (error, GST_GL_CONTEXT_ERROR, GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
"Failed to set window configuration: %s",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment