diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2014-04-30 18:37:27 +0100 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2014-04-30 15:16:06 -0400 |
commit | 441ac82d7f0aa0b8c1de4defbf85fc6acfb0b19a (patch) | |
tree | 63e0a3770fb217155bc30c7b195d732e70acbbc7 | |
parent | d8fb89e4e69dc3f74314ca274a6818c1e3396f52 (diff) | |
download | gstreamer-plugins-bad-441ac82d7f0aa0b8c1de4defbf85fc6acfb0b19a.tar.gz |
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
-rw-r--r-- | gst-libs/gst/gl/gstglcontext.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 432d8bd1a..2b397f9ed 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -412,17 +412,18 @@ gst_gl_context_default_get_proc_address (GstGLContext * context, const gchar * name) { gpointer ret = NULL; + static GModule *module = NULL; -#ifdef USE_EGL_RPI - - //FIXME: Can't understand why default does not work - // so for now retrieve proc addressed manually - +#if GST_GL_HAVE_PLATFORM_EGL static GModule *module_egl = NULL; - static GModule *module_glesv2 = NULL; - if (!module_egl) - module_egl = g_module_open ("/opt/vc/lib/libEGL.so", G_MODULE_BIND_LAZY); + if (!module_egl) { + module_egl = g_module_open ("libEGL.so.1", G_MODULE_BIND_LAZY); + + /* fallback */ + if (!module_egl) + module_egl = g_module_open (NULL, G_MODULE_BIND_LAZY); + } if (module_egl) { if (!g_module_symbol (module_egl, name, &ret)) { @@ -432,28 +433,25 @@ gst_gl_context_default_get_proc_address (GstGLContext * context, if (ret) return ret; +#endif - if (!module_glesv2) - module_glesv2 = - g_module_open ("/opt/vc/lib/libGLESv2.so", G_MODULE_BIND_LAZY); + if (!module) { + const gchar *name = NULL; +#if GST_GL_HAVE_GLES2 + name = "libGLESv2.so.2"; +#endif + module = g_module_open (name, G_MODULE_BIND_LAZY); - if (module_glesv2) { - if (!g_module_symbol (module_glesv2, name, &ret)) { - return NULL; - } + /* fallback */ + if (!module) + module = g_module_open (NULL, G_MODULE_BIND_LAZY); } -#else - static GModule *module = NULL; - - if (!module) - module = g_module_open (NULL, G_MODULE_BIND_LAZY); if (module) { if (!g_module_symbol (module, name, &ret)) { return NULL; } } -#endif return ret; } |