set(the_description "GPU-accelerated Computer Vision")
ocv_add_module(gpu opencv_imgproc opencv_calib3d opencv_objdetect opencv_video opencv_nonfree opencv_photo opencv_legacy)
-ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/cuda" "${CMAKE_CURRENT_SOURCE_DIR}/../highgui/src")
+ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/cuda" "${OpenCV_SOURCE_DIR}/modules/highgui/src")
file(GLOB lib_hdrs "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
file(GLOB lib_device_hdrs "include/opencv2/${name}/device/*.hpp" "include/opencv2/${name}/device/*.h")
source_group("Device" FILES ${lib_device_hdrs})
source_group("Device\\Detail" FILES ${lib_device_hdrs_detail})
-if (HAVE_CUDA)
+if(HAVE_CUDA)
file(GLOB_RECURSE ncv_srcs "src/nvidia/*.cpp" "src/nvidia/*.h*")
- file(GLOB_RECURSE ncv_cuda "src/nvidia/*.cu")
+ file(GLOB_RECURSE ncv_cuda "src/nvidia/*.cu")
set(ncv_files ${ncv_srcs} ${ncv_cuda})
source_group("Src\\NVidia" FILES ${ncv_files})
- ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
+
+ ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/nvidia" "${CMAKE_CURRENT_SOURCE_DIR}/src/nvidia/core" "${CMAKE_CURRENT_SOURCE_DIR}/src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
- string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")
+ string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
if(MSVC)
if(NOT ENABLE_NOISY_WARNINGS)
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
- if(NOT APPLE)
- unset(CUDA_nvcuvid_LIBRARY CACHE)
+ if(WIN32)
find_cuda_helper_libs(nvcuvid)
set(cuda_link_libs ${cuda_link_libs} ${CUDA_nvcuvid_LIBRARY})
- endif()
- if(WIN32)
- unset(CUDA_nvcuvenc_LIBRARY CACHE)
find_cuda_helper_libs(nvcuvenc)
set(cuda_link_libs ${cuda_link_libs} ${CUDA_nvcuvenc_LIBRARY})
endif()
-
- if(NOT APPLE AND WITH_FFMPEG)
- set(cuda_link_libs ${cuda_link_libs} ${HIGHGUI_LIBRARIES})
- endif()
else()
set(lib_cuda "")
set(cuda_objs "")
}
}
+#ifdef WIN32
+
//////////////////////////////////////////////////////
// VideoWriter
-PERF_TEST_P(Video, DISABLED_Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
+PERF_TEST_P(Video, Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
{
declare.time(30);
}
}
+#endif
+
} // namespace
#include "cuvid_video_source.h"
#include "cu_safe_call.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
cv::gpu::detail::CuvidVideoSource::CuvidVideoSource(const std::string& fname)
{
#include "precomp.hpp"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
namespace cv { namespace gpu
{
#include "ffmpeg_video_source.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
#if defined(HAVE_FFMPEG) && defined(BUILD_SHARED_LIBS)
#include "cap_ffmpeg_impl.hpp"
#include "precomp.hpp"
#include "thread_wrappers.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
struct InputMediaStream_FFMPEG;
#include "frame_queue.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
cv::gpu::detail::FrameQueue::FrameQueue() :
endOfDecode_(0),
#include "precomp.hpp"
#include "thread_wrappers.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
namespace cv { namespace gpu
{
#include <cublas.h>
#endif
- #ifndef __APPLE__
- #include <nvcuvid.h>
- #endif
-
#ifdef WIN32
+ #include <nvcuvid.h>
#include <NVEncoderAPI.h>
#endif
#include "thread_wrappers.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
#ifdef WIN32
#define NOMINMAX
#include "precomp.hpp"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
namespace cv { namespace gpu
{
#include "video_decoder.h"
#include "frame_queue.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& videoFormat)
{
#include "precomp.hpp"
#include "cu_safe_call.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
namespace cv { namespace gpu
{
#include "video_parser.h"
#include "cu_safe_call.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
cv::gpu::detail::VideoParser::VideoParser(VideoDecoder* videoDecoder, FrameQueue* frameQueue) :
videoDecoder_(videoDecoder), frameQueue_(frameQueue), unparsedPackets_(0), hasError_(false)
#include "frame_queue.h"
#include "video_decoder.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(WIN32)
namespace cv { namespace gpu
{
#include "precomp.hpp"
-#if !defined HAVE_CUDA || defined(CUDA_DISABLER) || defined(__APPLE__)
+#if !defined HAVE_CUDA || defined(CUDA_DISABLER) || !defined(WIN32)
class cv::gpu::VideoReader_GPU::Impl
{
testing::Values(Channels(1), Channels(3), Channels(4)),
WHOLE_SUBMAT));
+#ifdef WIN32
+
//////////////////////////////////////////////////////
// VideoWriter
-#ifdef WIN32
-
PARAM_TEST_CASE(VideoWriter, cv::gpu::DeviceInfo, std::string)
{
cv::gpu::DeviceInfo devInfo;
ALL_DEVICES,
testing::Values(std::string("768x576.avi"), std::string("1920x1080.avi"))));
-#endif // WIN32
-
//////////////////////////////////////////////////////
// VideoReader
ALL_DEVICES,
testing::Values(std::string("768x576.avi"), std::string("1920x1080.avi"))));
+#endif // WIN32
+
#endif // HAVE_CUDA