diff --git a/cmake/OpenCVDetectCUDA.cmake b/cmake/OpenCVDetectCUDA.cmake index 37a77cd660..22879f3152 100644 --- a/cmake/OpenCVDetectCUDA.cmake +++ b/cmake/OpenCVDetectCUDA.cmake @@ -53,6 +53,7 @@ if(CUDA_FOUND) else() set(${_result} 1) endif() + unset(_header_result CACHE) endmacro() SEARCH_NVCUVID_HEADER("nvcuvid.h" HAVE_NVCUVID_HEADER) SEARCH_NVCUVID_HEADER("dynlink_nvcuvid.h" HAVE_DYNLINK_NVCUVID_HEADER) diff --git a/modules/cudacodec/src/cuvid_video_source.hpp b/modules/cudacodec/src/cuvid_video_source.hpp index 4dd7761620..d36d856611 100644 --- a/modules/cudacodec/src/cuvid_video_source.hpp +++ b/modules/cudacodec/src/cuvid_video_source.hpp @@ -44,17 +44,9 @@ #ifndef __CUVID_VIDEO_SOURCE_HPP__ #define __CUVID_VIDEO_SOURCE_HPP__ -#if defined(HAVE_DYNLINK_NVCUVID_HEADER) - #include -#elif defined(HAVE_NVCUVID_HEADER) - #include -#endif -#include "opencv2/core/private.cuda.hpp" -#include "opencv2/cudacodec.hpp" #include "video_source.hpp" -namespace cv { namespace cudacodec { namespace detail -{ +namespace cv { namespace cudacodec { namespace detail { class CuvidVideoSource : public VideoSource { diff --git a/modules/cudacodec/src/frame_queue.hpp b/modules/cudacodec/src/frame_queue.hpp index f7fe7ad57d..3051a1e450 100644 --- a/modules/cudacodec/src/frame_queue.hpp +++ b/modules/cudacodec/src/frame_queue.hpp @@ -45,16 +45,8 @@ #define __FRAME_QUEUE_HPP__ #include "opencv2/core/utility.hpp" -#include "opencv2/core/private.cuda.hpp" -#if defined(HAVE_DYNLINK_NVCUVID_HEADER) - #include -#elif defined(HAVE_NVCUVID_HEADER) - #include -#endif - -namespace cv { namespace cudacodec { namespace detail -{ +namespace cv { namespace cudacodec { namespace detail { class FrameQueue { diff --git a/modules/cudacodec/src/video_decoder.hpp b/modules/cudacodec/src/video_decoder.hpp index 46caccaf83..e41b1a655f 100644 --- a/modules/cudacodec/src/video_decoder.hpp +++ b/modules/cudacodec/src/video_decoder.hpp @@ -44,17 +44,7 @@ #ifndef __VIDEO_DECODER_HPP__ #define __VIDEO_DECODER_HPP__ -#if defined(HAVE_DYNLINK_NVCUVID_HEADER) - #include -#elif defined(HAVE_NVCUVID_HEADER) - #include -#endif - -#include "opencv2/core/private.cuda.hpp" -#include "opencv2/cudacodec.hpp" - -namespace cv { namespace cudacodec { namespace detail -{ +namespace cv { namespace cudacodec { namespace detail { class VideoDecoder { diff --git a/modules/cudacodec/src/video_parser.hpp b/modules/cudacodec/src/video_parser.hpp index 03fff8e96a..91e50b3e2b 100644 --- a/modules/cudacodec/src/video_parser.hpp +++ b/modules/cudacodec/src/video_parser.hpp @@ -44,19 +44,10 @@ #ifndef __VIDEO_PARSER_HPP__ #define __VIDEO_PARSER_HPP__ -#if defined(HAVE_DYNLINK_NVCUVID_HEADER) - #include -#elif defined(HAVE_NVCUVID_HEADER) - #include -#endif - -#include "opencv2/core/private.cuda.hpp" -#include "opencv2/cudacodec.hpp" #include "frame_queue.hpp" #include "video_decoder.hpp" -namespace cv { namespace cudacodec { namespace detail -{ +namespace cv { namespace cudacodec { namespace detail { class VideoParser { diff --git a/modules/cudacodec/src/video_source.hpp b/modules/cudacodec/src/video_source.hpp index 9f2ed29d58..887ac04679 100644 --- a/modules/cudacodec/src/video_source.hpp +++ b/modules/cudacodec/src/video_source.hpp @@ -44,12 +44,9 @@ #ifndef __CUDACODEC_VIDEO_SOURCE_H__ #define __CUDACODEC_VIDEO_SOURCE_H__ -#include "opencv2/core/private.cuda.hpp" -#include "opencv2/cudacodec.hpp" #include "thread.hpp" -namespace cv { namespace cudacodec { namespace detail -{ +namespace cv { namespace cudacodec { namespace detail { class VideoParser;