gl: no need to provide full lib path to load symbols

- Make gstgl work on Mali
- Keep it work on RPI
- fallback to NULL name module if fails with usual lib name

https://bugzilla.gnome.org/show_bug.cgi?id=728753
This commit is contained in:
Nicolas Dufresne 2014-04-30 18:37:27 +01:00 committed by Tim-Philipp Müller
parent 2a12e57a9f
commit 1e8fc49203

View file

@ -412,17 +412,18 @@ gst_gl_context_default_get_proc_address (GstGLContext * context,
const gchar * name) const gchar * name)
{ {
gpointer ret = NULL; gpointer ret = NULL;
static GModule *module = NULL;
#ifdef USE_EGL_RPI #if GST_GL_HAVE_PLATFORM_EGL
//FIXME: Can't understand why default does not work
// so for now retrieve proc addressed manually
static GModule *module_egl = NULL; static GModule *module_egl = NULL;
static GModule *module_glesv2 = NULL;
if (!module_egl) {
module_egl = g_module_open ("libEGL.so.1", G_MODULE_BIND_LAZY);
/* fallback */
if (!module_egl) if (!module_egl)
module_egl = g_module_open ("/opt/vc/lib/libEGL.so", G_MODULE_BIND_LAZY); module_egl = g_module_open (NULL, G_MODULE_BIND_LAZY);
}
if (module_egl) { if (module_egl) {
if (!g_module_symbol (module_egl, name, &ret)) { if (!g_module_symbol (module_egl, name, &ret)) {
@ -432,28 +433,25 @@ gst_gl_context_default_get_proc_address (GstGLContext * context,
if (ret) if (ret)
return ret; return ret;
#endif
if (!module_glesv2) if (!module) {
module_glesv2 = const gchar *name = NULL;
g_module_open ("/opt/vc/lib/libGLESv2.so", G_MODULE_BIND_LAZY); #if GST_GL_HAVE_GLES2
name = "libGLESv2.so.2";
if (module_glesv2) { #endif
if (!g_module_symbol (module_glesv2, name, &ret)) { module = g_module_open (name, G_MODULE_BIND_LAZY);
return NULL;
}
}
#else
static GModule *module = NULL;
/* fallback */
if (!module) if (!module)
module = g_module_open (NULL, G_MODULE_BIND_LAZY); module = g_module_open (NULL, G_MODULE_BIND_LAZY);
}
if (module) { if (module) {
if (!g_module_symbol (module, name, &ret)) { if (!g_module_symbol (module, name, &ret)) {
return NULL; return NULL;
} }
} }
#endif
return ret; return ret;
} }