aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/nvdec.h
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2018-04-13 09:36:49 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2018-04-13 11:19:43 +0200
commit9f3902f107343f2690dce7ac7fef7c66887692b1 (patch)
treebdca818f2528af84e0cb75911c2b811ae192544a /libavcodec/nvdec.h
parent987026adda79be4bbc541e12c5c6796b43f84bc1 (diff)
downloadffmpeg-9f3902f107343f2690dce7ac7fef7c66887692b1.tar.gz
avcodec/nv{enc,dec}: use sane version checking macro
For some odd reason, the Nvidia version macros puts the minor version in the msb, so comparing against it is impossible.
Diffstat (limited to 'libavcodec/nvdec.h')
-rw-r--r--libavcodec/nvdec.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/nvdec.h b/libavcodec/nvdec.h
index 90578d5a1c..85a0fcf725 100644
--- a/libavcodec/nvdec.h
+++ b/libavcodec/nvdec.h
@@ -32,6 +32,15 @@
#include "avcodec.h"
+#if defined(NVDECAPI_MAJOR_VERSION) && defined(NVDECAPI_MINOR_VERSION)
+# define NVDECAPI_CHECK_VERSION(major, minor) \
+ ((major) < NVDECAPI_MAJOR_VERSION || ((major) == NVDECAPI_MAJOR_VERSION && (minor) <= NVDECAPI_MINOR_VERSION))
+#else
+/* version macros were added in SDK 8.1 ffnvcodec */
+# define NVDECAPI_CHECK_VERSION(major, minor) \
+ ((major) < 8 || ((major) == 8 && (minor) <= 0))
+#endif
+
typedef struct NVDECFrame {
unsigned int idx;
AVBufferRef *idx_ref;