gstgl shouldn't use eglGetProcAddress to determine presence
gstgl has code like this in it:
gst_eglDestroyImage = gst_gl_context_get_proc_address (context,
"eglDestroyImage");
if (!gst_eglDestroyImage) {
gst_eglDestroyImage = gst_gl_context_get_proc_address (context,
"eglDestroyImageKHR");
if (!gst_eglDestroyImage) {
GST_ERROR_OBJECT (context, "\"eglDestroyImage\" not exposed by the "
"implementation");
return;
}
}
This is not the correct way to detect entrypoint usability. eglGetProcAddress
is explicitly specified not to work like this:
A non-NULL return value does not guarantee that an extension function is actually supported at runtime. The client must also make a corresponding query, such as glGetString(GL_EXTENSIONS) for OpenGL and OpenGL ES extensions; vgGetString(VG_EXTENSIONS) for OpenVG extensions; eglQueryString(display, EGL_EXTENSIONS); or query the EGL or client API version for non-extension functions, to determine if a function is supported by EGL or a specific client API context. eglGetProcAddress may be queried for all EGL and client API functions supported by the implementation (whether those functions are extensions or not, and whether they are supported by the current client API context or not).
In this specific example, the way to detect if eglCreateImage
and eglDestroyImage
are usable is to see whether or not EGL is v >= 1.5. The way to detect if eglCreateImageKHR
and eglDestroyImageKHR
are usable is to see whether or not EGL_KHR_image_base
is exposed as a display extension for the specific display, etc.
One way this can break is when running GStreamer under apitrace. apitrace will answer all possible entrypoints to eglGetProcAddress()
, but if the underlying implementation does not support those entrypoints then it will hard fail at runtime.