|
76 | 76 | av_log(NULL, AV_LOG_TRACE, "Loaded sym: %s\n", symbol); \ |
77 | 77 | } while (0) |
78 | 78 |
|
| 79 | +#define LOAD_SYMBOL_OPT(fun, tp, symbol) \ |
| 80 | + do { \ |
| 81 | + if (!((f->fun) = (tp*)dlsym(f->lib, symbol))) { \ |
| 82 | + av_log(NULL, AV_LOG_DEBUG, "Cannot load optional %s\n", symbol); \ |
| 83 | + } else { \ |
| 84 | + av_log(NULL, AV_LOG_TRACE, "Loaded sym: %s\n", symbol); \ |
| 85 | + } \ |
| 86 | + } while (0) |
| 87 | + |
79 | 88 | #define GENERIC_LOAD_FUNC_PREAMBLE(T, n, N) \ |
80 | 89 | T *f; \ |
81 | 90 | int ret; \ |
@@ -205,7 +214,7 @@ static inline int cuvid_load_functions(CuvidFunctions **functions) |
205 | 214 | { |
206 | 215 | GENERIC_LOAD_FUNC_PREAMBLE(CuvidFunctions, cuvid, NVCUVID_LIBNAME); |
207 | 216 |
|
208 | | - LOAD_SYMBOL(cuvidGetDecoderCaps, tcuvidGetDecoderCaps, "cuvidGetDecoderCaps"); |
| 217 | + LOAD_SYMBOL_OPT(cuvidGetDecoderCaps, tcuvidGetDecoderCaps, "cuvidGetDecoderCaps"); |
209 | 218 | LOAD_SYMBOL(cuvidCreateDecoder, tcuvidCreateDecoder, "cuvidCreateDecoder"); |
210 | 219 | LOAD_SYMBOL(cuvidDestroyDecoder, tcuvidDestroyDecoder, "cuvidDestroyDecoder"); |
211 | 220 | LOAD_SYMBOL(cuvidDecodePicture, tcuvidDecodePicture, "cuvidDecodePicture"); |
|
0 commit comments