From 30622337ab5ad66a5b3cdf1469dd02f72e74f886 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 29 May 2014 16:59:28 +0200 Subject: [PATCH] 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) --- gst-libs/gst/gl/egl/gstglcontext_egl.c | 9 +++++---- gst-libs/gst/gl/gstglcontext.c | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c index 2cd1b31b75..4ccec8dbf7 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -509,13 +509,14 @@ load_egl_module (gpointer user_data) #ifdef GST_GL_LIBEGL_MODULE_NAME module_egl = g_module_open (GST_GL_LIBEGL_MODULE_NAME, G_MODULE_BIND_LAZY); #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 * 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); + + /* This automatically handles the suffix and even .la files */ + if (!module_egl) + module_egl = g_module_open ("libEGL", G_MODULE_BIND_LAZY); #endif return NULL; diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 4eb0b50d08..ff172d84d6 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -77,13 +77,14 @@ load_opengl_module (gpointer user_data) #ifdef GST_GL_LIBGL_MODULE_NAME module_opengl = g_module_open (GST_GL_LIBGL_MODULE_NAME, G_MODULE_BIND_LAZY); #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 * 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); + + /* This automatically handles the suffix and even .la files */ + if (!module_opengl) + module_opengl = g_module_open ("libGL", G_MODULE_BIND_LAZY); #endif return NULL; @@ -101,13 +102,15 @@ load_gles2_module (gpointer user_data) module_gles2 = g_module_open (GST_GL_LIBGLESV2_MODULE_NAME, G_MODULE_BIND_LAZY); #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 * 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); + + /* This automatically handles the suffix and even .la files */ + if (!module_gles2) + module_gles2 = g_module_open ("libGLESv2", G_MODULE_BIND_LAZY); + #endif return NULL;