summaryrefslogtreecommitdiff
path: root/libavcodec/cuvid.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2017-06-01 12:29:35 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2017-06-01 12:39:06 +0200
commitff3084606c09911cdd3b6d6b588c47b9e71acea3 (patch)
tree006b570ced1682fb15f93f17315e6e221871bd8a /libavcodec/cuvid.c
parentf890a6d71286cd4602a778fc551df0b4d87bc39e (diff)
avcodec/cuvid: make capability check optional
Diffstat (limited to 'libavcodec/cuvid.c')
-rw-r--r--libavcodec/cuvid.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/cuvid.c b/libavcodec/cuvid.c
index 218be8495d..2ba8e00c6a 100644
--- a/libavcodec/cuvid.c
+++ b/libavcodec/cuvid.c
@@ -707,6 +707,21 @@ static int cuvid_test_capabilities(AVCodecContext *avctx,
CUVIDDECODECAPS *caps;
int res8 = 0, res10 = 0, res12 = 0;
+ if (!ctx->cvdl->cuvidGetDecoderCaps) {
+ av_log(avctx, AV_LOG_WARNING, "Used Nvidia driver is too old to perform a capability check.\n");
+ av_log(avctx, AV_LOG_WARNING, "The minimum required version is "
+#if defined(_WIN32) || defined(__CYGWIN__)
+ "378.66"
+#else
+ "378.13"
+#endif
+ ". Continuing blind.\n");
+ ctx->caps8.bIsSupported = ctx->caps10.bIsSupported = 1;
+ // 12 bit was not supported before the capability check was introduced, so disable it.
+ ctx->caps12.bIsSupported = 0;
+ return 0;
+ }
+
ctx->caps8.eCodecType = ctx->caps10.eCodecType = ctx->caps12.eCodecType
= cuparseinfo->CodecType;
ctx->caps8.eChromaFormat = ctx->caps10.eChromaFormat = ctx->caps12.eChromaFormat