glcontext: Try to open lib{EGL|GL|GLESv2}.so.1 before lib{EGL|GL|GLESv2}

Fixes issues with .so (without numbering) being installed for development
(such as from mesa-dev) but actual driver (with numbering) coming from
some other place (like nvidia drivers)
This commit is contained in:
Edward Hervey 2014-05-29 16:59:28 +02:00
parent 4f02c5679b
commit 30622337ab
2 changed files with 16 additions and 12 deletions

View file

@ -509,13 +509,14 @@ load_egl_module (gpointer user_data)
#ifdef GST_GL_LIBEGL_MODULE_NAME #ifdef GST_GL_LIBEGL_MODULE_NAME
module_egl = g_module_open (GST_GL_LIBEGL_MODULE_NAME, G_MODULE_BIND_LAZY); module_egl = g_module_open (GST_GL_LIBEGL_MODULE_NAME, G_MODULE_BIND_LAZY);
#else #else
/* This automatically handles the suffix and even .la files */
module_egl = g_module_open ("libEGL", G_MODULE_BIND_LAZY);
/* On Linux the .so is only in -dev packages, try with a real soname /* On Linux the .so is only in -dev packages, try with a real soname
* Proper compilers will optimize away the strcmp */ * Proper compilers will optimize away the strcmp */
if (!module_egl && strcmp (G_MODULE_SUFFIX, "so") == 0) if (strcmp (G_MODULE_SUFFIX, "so") == 0)
module_egl = g_module_open ("libEGL.so.1", G_MODULE_BIND_LAZY); module_egl = g_module_open ("libEGL.so.1", G_MODULE_BIND_LAZY);
/* This automatically handles the suffix and even .la files */
if (!module_egl)
module_egl = g_module_open ("libEGL", G_MODULE_BIND_LAZY);
#endif #endif
return NULL; return NULL;

View file

@ -77,13 +77,14 @@ load_opengl_module (gpointer user_data)
#ifdef GST_GL_LIBGL_MODULE_NAME #ifdef GST_GL_LIBGL_MODULE_NAME
module_opengl = g_module_open (GST_GL_LIBGL_MODULE_NAME, G_MODULE_BIND_LAZY); module_opengl = g_module_open (GST_GL_LIBGL_MODULE_NAME, G_MODULE_BIND_LAZY);
#else #else
/* This automatically handles the suffix and even .la files */
module_opengl = g_module_open ("libGL", G_MODULE_BIND_LAZY);
/* On Linux the .so is only in -dev packages, try with a real soname /* On Linux the .so is only in -dev packages, try with a real soname
* Proper compilers will optimize away the strcmp */ * Proper compilers will optimize away the strcmp */
if (!module_opengl && strcmp (G_MODULE_SUFFIX, "so") == 0) if (strcmp (G_MODULE_SUFFIX, "so") == 0)
module_opengl = g_module_open ("libGL.so.1", G_MODULE_BIND_LAZY); module_opengl = g_module_open ("libGL.so.1", G_MODULE_BIND_LAZY);
/* This automatically handles the suffix and even .la files */
if (!module_opengl)
module_opengl = g_module_open ("libGL", G_MODULE_BIND_LAZY);
#endif #endif
return NULL; return NULL;
@ -101,13 +102,15 @@ load_gles2_module (gpointer user_data)
module_gles2 = module_gles2 =
g_module_open (GST_GL_LIBGLESV2_MODULE_NAME, G_MODULE_BIND_LAZY); g_module_open (GST_GL_LIBGLESV2_MODULE_NAME, G_MODULE_BIND_LAZY);
#else #else
/* This automatically handles the suffix and even .la files */
module_gles2 = g_module_open ("libGLESv2", G_MODULE_BIND_LAZY);
/* On Linux the .so is only in -dev packages, try with a real soname /* On Linux the .so is only in -dev packages, try with a real soname
* Proper compilers will optimize away the strcmp */ * Proper compilers will optimize away the strcmp */
if (!module_gles2 && strcmp (G_MODULE_SUFFIX, "so") == 0) if (strcmp (G_MODULE_SUFFIX, "so") == 0)
module_gles2 = g_module_open ("libGLESv2.so.2", G_MODULE_BIND_LAZY); module_gles2 = g_module_open ("libGLESv2.so.2", G_MODULE_BIND_LAZY);
/* This automatically handles the suffix and even .la files */
if (!module_gles2)
module_gles2 = g_module_open ("libGLESv2", G_MODULE_BIND_LAZY);
#endif #endif
return NULL; return NULL;