[FFmpeg-cvslog] compat/cuda: make cuvidGetDecoderCaps optional

Timo Rothenpieler git at videolan.org
Thu Jun 1 17:09:25 EEST 2017


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Thu Jun  1 12:33:54 2017 +0200| [f890a6d71286cd4602a778fc551df0b4d87bc39e] | committer: Timo Rothenpieler

compat/cuda: make cuvidGetDecoderCaps optional

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f890a6d71286cd4602a778fc551df0b4d87bc39e
---

 compat/cuda/dynlink_loader.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/compat/cuda/dynlink_loader.h b/compat/cuda/dynlink_loader.h
index 572cf8b907..7d2c87449e 100644
--- a/compat/cuda/dynlink_loader.h
+++ b/compat/cuda/dynlink_loader.h
@@ -76,6 +76,15 @@
         av_log(NULL, AV_LOG_TRACE, "Loaded sym: %s\n", symbol);     \
     } while (0)
 
+#define LOAD_SYMBOL_OPT(fun, tp, symbol)                                     \
+    do {                                                                     \
+        if (!((f->fun) = (tp*)dlsym(f->lib, symbol))) {                      \
+            av_log(NULL, AV_LOG_DEBUG, "Cannot load optional %s\n", symbol); \
+        } else {                                                             \
+            av_log(NULL, AV_LOG_TRACE, "Loaded sym: %s\n", symbol);          \
+        }                                                                    \
+    } while (0)
+
 #define GENERIC_LOAD_FUNC_PREAMBLE(T, n, N)  \
     T *f;                                    \
     int ret;                                 \
@@ -205,7 +214,7 @@ static inline int cuvid_load_functions(CuvidFunctions **functions)
 {
     GENERIC_LOAD_FUNC_PREAMBLE(CuvidFunctions, cuvid, NVCUVID_LIBNAME);
 
-    LOAD_SYMBOL(cuvidGetDecoderCaps, tcuvidGetDecoderCaps, "cuvidGetDecoderCaps");
+    LOAD_SYMBOL_OPT(cuvidGetDecoderCaps, tcuvidGetDecoderCaps, "cuvidGetDecoderCaps");
     LOAD_SYMBOL(cuvidCreateDecoder, tcuvidCreateDecoder, "cuvidCreateDecoder");
     LOAD_SYMBOL(cuvidDestroyDecoder, tcuvidDestroyDecoder, "cuvidDestroyDecoder");
     LOAD_SYMBOL(cuvidDecodePicture, tcuvidDecodePicture, "cuvidDecodePicture");



More information about the ffmpeg-cvslog mailing list