Merge #190023: gst-plugins-bad: patch nvcodec to check opengl path

...into staging
This commit is contained in:
Vladimír Čunát 2022-09-28 09:58:48 +02:00
commit bfff65312a
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
2 changed files with 58 additions and 0 deletions

View File

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchurl
, substituteAll
, meson
, ninja
, gettext
@ -78,6 +79,7 @@
, mjpegtools
, libGLU
, libGL
, addOpenGLRunpath
, libintl
, game-music-emu
, openssl
@ -109,6 +111,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-ehHBO1XdHSOG3ZAiGeQcv83ajh4Ko+c4GGyVB0s12k8=";
};
patches = [
# Add fallback paths for nvidia userspace libraries
(substituteAll {
src = ./fix-paths.patch;
inherit (addOpenGLRunpath) driverLink;
})
];
nativeBuildInputs = [
meson
ninja

View File

@ -0,0 +1,48 @@
diff --git a/sys/nvcodec/gstcudaloader.c b/sys/nvcodec/gstcudaloader.c
index 4223ba1fbd..ca8bb5ceb1 100644
--- a/sys/nvcodec/gstcudaloader.c
+++ b/sys/nvcodec/gstcudaloader.c
@@ -135,6 +135,11 @@ gst_cuda_load_library (void)
return TRUE;
module = g_module_open (filename, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open("@driverLink@/lib/" CUDA_LIBNAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
return FALSE;
diff --git a/sys/nvcodec/gstcuvidloader.c b/sys/nvcodec/gstcuvidloader.c
index 3c7505ca36..eeb376fa80 100644
--- a/sys/nvcodec/gstcuvidloader.c
+++ b/sys/nvcodec/gstcuvidloader.c
@@ -85,6 +85,11 @@ gst_cuvid_load_library (guint api_major_ver, guint api_minor_ver)
return TRUE;
module = g_module_open (filename, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open ("@driverLink@/lib/" NVCUVID_LIBNAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
return FALSE;
diff --git a/sys/nvcodec/gstnvenc.c b/sys/nvcodec/gstnvenc.c
index 19637671ad..39858ccdee 100644
--- a/sys/nvcodec/gstnvenc.c
+++ b/sys/nvcodec/gstnvenc.c
@@ -874,6 +874,11 @@ gst_nvenc_load_library (guint * api_major_ver, guint * api_minor_ver)
};
module = g_module_open (NVENC_LIBRARY_NAME, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open ("@driverLink@/lib/" NVENC_LIBRARY_NAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s",
NVENC_LIBRARY_NAME, g_module_error ());