diff --git a/modules/cudacodec/src/cuvid_video_source.hpp b/modules/cudacodec/src/cuvid_video_source.hpp index e2f3a6c024..085979feb9 100644 --- a/modules/cudacodec/src/cuvid_video_source.hpp +++ b/modules/cudacodec/src/cuvid_video_source.hpp @@ -44,8 +44,11 @@ #ifndef __CUVID_VIDEO_SOURCE_HPP__ #define __CUVID_VIDEO_SOURCE_HPP__ -#include - +#if CUDA_VERSION >= 9000 + #include +#else + #include +#endif #include "opencv2/core/private.cuda.hpp" #include "opencv2/cudacodec.hpp" #include "video_source.hpp" diff --git a/modules/cudacodec/src/frame_queue.hpp b/modules/cudacodec/src/frame_queue.hpp index 1ed7e039cd..0d485953f0 100644 --- a/modules/cudacodec/src/frame_queue.hpp +++ b/modules/cudacodec/src/frame_queue.hpp @@ -47,7 +47,11 @@ #include "opencv2/core/utility.hpp" #include "opencv2/core/private.cuda.hpp" -#include +#if CUDA_VERSION >= 9000 + #include +#else + #include +#endif namespace cv { namespace cudacodec { namespace detail { diff --git a/modules/cudacodec/src/precomp.hpp b/modules/cudacodec/src/precomp.hpp index 5a3da5f0f8..3c53a9b940 100644 --- a/modules/cudacodec/src/precomp.hpp +++ b/modules/cudacodec/src/precomp.hpp @@ -56,7 +56,11 @@ #include "opencv2/core/private.cuda.hpp" #ifdef HAVE_NVCUVID - #include + #if CUDA_VERSION >= 9000 + #include + #else + #include + #endif #ifdef _WIN32 #define NOMINMAX diff --git a/modules/cudacodec/src/video_decoder.hpp b/modules/cudacodec/src/video_decoder.hpp index 5b101b8d21..3fce5194c5 100644 --- a/modules/cudacodec/src/video_decoder.hpp +++ b/modules/cudacodec/src/video_decoder.hpp @@ -44,7 +44,11 @@ #ifndef __VIDEO_DECODER_HPP__ #define __VIDEO_DECODER_HPP__ -#include +#if CUDA_VERSION >= 9000 + #include +#else + #include +#endif #include "opencv2/core/private.cuda.hpp" #include "opencv2/cudacodec.hpp" diff --git a/modules/cudacodec/src/video_parser.hpp b/modules/cudacodec/src/video_parser.hpp index 8629610b07..165b4206fe 100644 --- a/modules/cudacodec/src/video_parser.hpp +++ b/modules/cudacodec/src/video_parser.hpp @@ -44,7 +44,11 @@ #ifndef __VIDEO_PARSER_HPP__ #define __VIDEO_PARSER_HPP__ -#include +#if CUDA_VERSION >= 9000 + #include +#else + #include +#endif #include "opencv2/core/private.cuda.hpp" #include "opencv2/cudacodec.hpp"