Merge pull request #6037 from atinfinity:pullreq/160130-enable-nvcuvid-2.4

This commit is contained in:
Alexander Alekhin 2016-02-02 07:09:20 +00:00
commit d6e2097435
5 changed files with 25 additions and 6 deletions

View File

@ -35,7 +35,18 @@ if(CUDA_FOUND)
if(WITH_NVCUVID) if(WITH_NVCUVID)
find_cuda_helper_libs(nvcuvid) find_cuda_helper_libs(nvcuvid)
set(HAVE_NVCUVID 1)
if(WIN32)
find_cuda_helper_libs(nvcuvenc)
endif()
if(CUDA_nvcuvid_LIBRARY)
set(HAVE_NVCUVID 1)
endif()
if(CUDA_nvcuvenc_LIBRARY)
set(HAVE_NVCUVENC 1)
endif()
endif() endif()
message(STATUS "CUDA detected: " ${CUDA_VERSION}) message(STATUS "CUDA detected: " ${CUDA_VERSION})

View File

@ -109,6 +109,9 @@
/* NVidia Video Decoding API*/ /* NVidia Video Decoding API*/
#cmakedefine HAVE_NVCUVID #cmakedefine HAVE_NVCUVID
/* NVidia Video Encoding API*/
#cmakedefine HAVE_NVCUVENC
/* OpenCL Support */ /* OpenCL Support */
#cmakedefine HAVE_OPENCL #cmakedefine HAVE_OPENCL
#cmakedefine HAVE_OPENCL_STATIC #cmakedefine HAVE_OPENCL_STATIC

View File

@ -54,11 +54,14 @@ if(HAVE_CUDA)
endif() endif()
if(WITH_NVCUVID) if(WITH_NVCUVID)
set(cuda_link_libs ${cuda_link_libs} ${CUDA_CUDA_LIBRARY} ${CUDA_nvcuvid_LIBRARY}) if(HAVE_NVCUVID)
set(cuda_link_libs ${cuda_link_libs} ${CUDA_CUDA_LIBRARY} ${CUDA_nvcuvid_LIBRARY})
endif()
if(WIN32) if(WIN32)
find_cuda_helper_libs(nvcuvenc) if(HAVE_NVCUVENC)
set(cuda_link_libs ${cuda_link_libs} ${CUDA_nvcuvenc_LIBRARY}) set(cuda_link_libs ${cuda_link_libs} ${CUDA_nvcuvenc_LIBRARY})
endif()
endif() endif()
if(WITH_FFMPEG) if(WITH_FFMPEG)

View File

@ -98,7 +98,9 @@
#include <nvcuvid.h> #include <nvcuvid.h>
#ifdef WIN32 #ifdef WIN32
#include <NVEncoderAPI.h> #ifdef HAVE_NVCUVENC
#include <NVEncoderAPI.h>
#endif
#endif #endif
#endif #endif

View File

@ -42,7 +42,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#if !defined(HAVE_CUDA) || defined(CUDA_DISABLER) || !defined(HAVE_NVCUVID) || !defined(WIN32) #if !defined(HAVE_CUDA) || defined(CUDA_DISABLER) || !defined(HAVE_NVCUVENC) || !defined(WIN32)
class cv::gpu::VideoWriter_GPU::Impl class cv::gpu::VideoWriter_GPU::Impl
{ {