From bab3d66c715ff8afacee1d066f65166a894ded38 Mon Sep 17 00:00:00 2001 From: Tomoaki Teshima Date: Thu, 11 Jun 2020 23:06:18 +0900 Subject: [PATCH] [moved from opencv] fix corner case of libnvcuvid * detect header automatically and not based on version number original commit: https://github.com/opencv/opencv/commit/d4af89781b81cdc2ffa93af2a04a26370575d230 --- modules/cudacodec/src/cuvid_video_source.hpp | 4 ++-- modules/cudacodec/src/frame_queue.hpp | 4 ++-- modules/cudacodec/src/precomp.hpp | 4 ++-- modules/cudacodec/src/video_decoder.hpp | 4 ++-- modules/cudacodec/src/video_parser.hpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/cudacodec/src/cuvid_video_source.hpp b/modules/cudacodec/src/cuvid_video_source.hpp index 802e65a92..4dd776162 100644 --- a/modules/cudacodec/src/cuvid_video_source.hpp +++ b/modules/cudacodec/src/cuvid_video_source.hpp @@ -44,9 +44,9 @@ #ifndef __CUVID_VIDEO_SOURCE_HPP__ #define __CUVID_VIDEO_SOURCE_HPP__ -#if CUDA_VERSION >= 9000 && CUDA_VERSION < 10000 +#if defined(HAVE_DYNLINK_NVCUVID_HEADER) #include -#else +#elif defined(HAVE_NVCUVID_HEADER) #include #endif #include "opencv2/core/private.cuda.hpp" diff --git a/modules/cudacodec/src/frame_queue.hpp b/modules/cudacodec/src/frame_queue.hpp index 3ff06a67e..f7fe7ad57 100644 --- a/modules/cudacodec/src/frame_queue.hpp +++ b/modules/cudacodec/src/frame_queue.hpp @@ -47,9 +47,9 @@ #include "opencv2/core/utility.hpp" #include "opencv2/core/private.cuda.hpp" -#if CUDA_VERSION >= 9000 && CUDA_VERSION < 10000 +#if defined(HAVE_DYNLINK_NVCUVID_HEADER) #include -#else +#elif defined(HAVE_NVCUVID_HEADER) #include #endif diff --git a/modules/cudacodec/src/precomp.hpp b/modules/cudacodec/src/precomp.hpp index 6fac7322b..ca3c68958 100644 --- a/modules/cudacodec/src/precomp.hpp +++ b/modules/cudacodec/src/precomp.hpp @@ -58,9 +58,9 @@ #include #ifdef HAVE_NVCUVID - #if CUDA_VERSION >= 9000 && CUDA_VERSION < 10000 + #if defined(HAVE_DYNLINK_NVCUVID_HEADER) #include - #else + #elif defined(HAVE_NVCUVID_HEADER) #include #endif diff --git a/modules/cudacodec/src/video_decoder.hpp b/modules/cudacodec/src/video_decoder.hpp index 99eb224dd..80777fb69 100644 --- a/modules/cudacodec/src/video_decoder.hpp +++ b/modules/cudacodec/src/video_decoder.hpp @@ -44,9 +44,9 @@ #ifndef __VIDEO_DECODER_HPP__ #define __VIDEO_DECODER_HPP__ -#if CUDA_VERSION >= 9000 && CUDA_VERSION < 10000 +#if defined(HAVE_DYNLINK_NVCUVID_HEADER) #include -#else +#elif defined(HAVE_NVCUVID_HEADER) #include #endif diff --git a/modules/cudacodec/src/video_parser.hpp b/modules/cudacodec/src/video_parser.hpp index 5bd0f9656..03fff8e96 100644 --- a/modules/cudacodec/src/video_parser.hpp +++ b/modules/cudacodec/src/video_parser.hpp @@ -44,9 +44,9 @@ #ifndef __VIDEO_PARSER_HPP__ #define __VIDEO_PARSER_HPP__ -#if CUDA_VERSION >= 9000 && CUDA_VERSION < 10000 +#if defined(HAVE_DYNLINK_NVCUVID_HEADER) #include -#else +#elif defined(HAVE_NVCUVID_HEADER) #include #endif