# Optional 3rd party components
# ===================================================
-OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (UNIX AND NOT ANDROID AND NOT IOS) )
+OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (UNIX AND NOT ANDROID AND NOT IOS AND NOT CARMA) )
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE )
-OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
+OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
+OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
-OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS) )
-OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
-OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
+OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS AND NOT CARMA) )
+OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT CARMA) )
+OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT CARMA) )
OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) )
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
OCV_OPTION(WITH_JPEG "Include JPEG support" ON IF (NOT IOS) )
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS) )
-OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE) )
-OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) )
+OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE AND NOT CARMA) )
+OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS AND NOT CARMA) )
OCV_OPTION(WITH_PNG "Include PNG support" ON IF (NOT IOS) )
-OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
-OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )
+OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS AND NOT CARMA) )
+OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS AND NOT CARMA) )
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE )
-OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) )
+OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS AND NOT CARMA) )
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 )
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )
-OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
-OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
+OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT CARMA) )
+OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT CARMA) )
OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON IF WIN32 )
-OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
-OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
+OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE AND NOT CARMA) )
+OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT CARMA) )
OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF)
-OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" OFF IF (NOT ANDROID AND NOT IOS) )
-OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" OFF IF (NOT ANDROID AND NOT IOS) )
-OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" OFF IF (NOT ANDROID AND NOT IOS) )
+OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" OFF IF (NOT ANDROID AND NOT IOS AND NOT CARMA) )
+OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" OFF IF (NOT ANDROID AND NOT IOS AND NOT CARMA) )
+OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" OFF IF (NOT ANDROID AND NOT IOS AND NOT CARMA) )
# OpenCV build components
# ===================================================
-OCV_OPTION(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" NOT (ANDROID OR IOS) )
+OCV_OPTION(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" NOT (ANDROID OR IOS OR CARMA) )
OCV_OPTION(BUILD_ANDROID_EXAMPLES "Build examples for Android platform" ON IF ANDROID )
OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON )
OCV_OPTION(BUILD_EXAMPLES "Build all examples" OFF )
OCV_OPTION(BUILD_ANDROID_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID )
# 3rd party libs
-OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
-OCV_OPTION(BUILD_TIFF "Build libtiff from source" WIN32 OR ANDROID OR APPLE )
-OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 OR ANDROID OR APPLE )
-OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE )
-OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
-OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )
+OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE OR CARMA )
+OCV_OPTION(BUILD_TIFF "Build libtiff from source" WIN32 OR ANDROID OR APPLE OR CARMA )
+OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 OR ANDROID OR APPLE OR CARMA )
+OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE OR CARMA )
+OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE OR CARMA )
+OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE OR CARMA )
# OpenCV installation options
return()
endif()
-find_package(CUDA 4.1)
+find_package(CUDA 4.2)
if(CUDA_FOUND)
set(HAVE_CUDA 1)
set(HAVE_CUBLAS 1)
endif()
+ if(WITH_NVCUVID)
+ find_cuda_helper_libs(nvcuvid)
+ set(HAVE_NVCUVID 1)
+ endif()
+
message(STATUS "CUDA detected: " ${CUDA_VERSION})
- if(${CUDA_VERSION_STRING} VERSION_GREATER "4.1")
- set(CUDA_ARCH_BIN "1.1 1.2 1.3 2.0 2.1(2.0) 3.0" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
+ if (CARMA)
+ set(CUDA_ARCH_BIN "3.0" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
+ set(CUDA_ARCH_PTX "3.0" CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
else()
- set(CUDA_ARCH_BIN "1.1 1.2 1.3 2.0 2.1(2.0)" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
+ set(CUDA_ARCH_BIN "1.1 1.2 1.3 2.0 2.1(2.0) 3.0" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
+ set(CUDA_ARCH_PTX "2.0 3.0" CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
endif()
- set(CUDA_ARCH_PTX "2.0" CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
-
string(REGEX REPLACE "\\." "" ARCH_BIN_NO_POINTS "${CUDA_ARCH_BIN}")
string(REGEX REPLACE "\\." "" ARCH_PTX_NO_POINTS "${CUDA_ARCH_PTX}")
set(OPENCV_CUDA_ARCH_FEATURES "${OPENCV_CUDA_ARCH_FEATURES} ${ARCH}")
endforeach()
+ if(CARMA)
+ set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --target-cpu-architecture=ARM "-ccbin=${CMAKE_CXX_COMPILER}")
+ endif()
+
# These vars will be processed in other scripts
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ${NVCC_FLAGS_EXTRA})
set(OpenCV_CUDA_CC "${NVCC_FLAGS_EXTRA}")
/* NVidia Cuda Runtime API*/
#cmakedefine HAVE_CUDA
-/* OpenCL Support */
-#cmakedefine HAVE_OPENCL
-
-/* AMD's OpenCL Fast Fourier Transform Library*/
-#cmakedefine HAVE_CLAMDFFT
-
-/* AMD's Basic Linear Algebra Subprograms Library*/
-#cmakedefine HAVE_CLAMDBLAS
-
/* NVidia Cuda Fast Fourier Transform (FFT) API*/
#cmakedefine HAVE_CUFFT
/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/
#cmakedefine HAVE_CUBLAS
+/* NVidia Video Decoding API*/
+#cmakedefine HAVE_NVCUVID
+
/* Compile for 'real' NVIDIA GPU architectures */
#define CUDA_ARCH_BIN "${OPENCV_CUDA_ARCH_BIN}"
/* Create PTX or BIN for 1.0 compute capability */
#cmakedefine CUDA_ARCH_BIN_OR_PTX_10
+/* OpenCL Support */
+#cmakedefine HAVE_OPENCL
+
+/* AMD's OpenCL Fast Fourier Transform Library*/
+#cmakedefine HAVE_CLAMDFFT
+
+/* AMD's Basic Linear Algebra Subprograms Library*/
+#cmakedefine HAVE_CLAMDBLAS
+
/* VideoInput library */
#cmakedefine HAVE_VIDEOINPUT
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
- if(NOT APPLE)
- unset(CUDA_nvcuvid_LIBRARY CACHE)
- find_cuda_helper_libs(nvcuvid)
+ if(WITH_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)
+ if(WITH_FFMPEG)
set(cuda_link_libs ${cuda_link_libs} ${HIGHGUI_LIBRARIES})
endif()
else()
--- /dev/null
+set(CMAKE_SYSTEM_NAME Linux)
+SET(CMAKE_SYSTEM_VERSION 1)
+
+set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc-4.5)
+set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++-4.5)
+
+SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabi)
+
+set(CARMA 1)
+add_definitions(-DCARMA)
#include "cuvid_video_source.h"
#include "cu_safe_call.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
cv::gpu::detail::CuvidVideoSource::CuvidVideoSource(const std::string& fname)
{
#include "precomp.hpp"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
namespace cv { namespace gpu
{
#include "ffmpeg_video_source.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
#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(HAVE_NVCUVID)
struct InputMediaStream_FFMPEG;
#include "frame_queue.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
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(HAVE_NVCUVID)
namespace cv { namespace gpu
{
#include <cublas.h>
#endif
- #ifndef __APPLE__
+ #ifdef HAVE_NVCUVID
#include <nvcuvid.h>
- #endif
- #ifdef WIN32
- #include <NVEncoderAPI.h>
+ #ifdef WIN32
+ #include <NVEncoderAPI.h>
+ #endif
#endif
#include "internal_shared.hpp"
#include "thread_wrappers.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
#ifdef WIN32
#define NOMINMAX
#include "precomp.hpp"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
namespace cv { namespace gpu
{
#include "video_decoder.h"
#include "frame_queue.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
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(HAVE_NVCUVID)
namespace cv { namespace gpu
{
#include "video_parser.h"
#include "cu_safe_call.h"
-#if defined(HAVE_CUDA) && !defined(__APPLE__)
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
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(HAVE_NVCUVID)
namespace cv { namespace gpu
{
#include "precomp.hpp"
-#if !defined HAVE_CUDA || defined(CUDA_DISABLER) || defined(__APPLE__)
+#if !defined(HAVE_CUDA) || defined(CUDA_DISABLER) || !defined(HAVE_NVCUVID)
class cv::gpu::VideoReader_GPU::Impl
{
#include "precomp.hpp"
-#if !defined HAVE_CUDA || defined(CUDA_DISABLER) || !defined(WIN32)
+#if !defined(HAVE_CUDA) || defined(CUDA_DISABLER) || !defined(HAVE_NVCUVID) || !defined(WIN32)
class cv::gpu::VideoWriter_GPU::Impl
{
cv::write(fs, "DisableSPSPPS" , DisableSPSPPS);
}
-#endif // !defined HAVE_CUDA || !defined WIN32
\ No newline at end of file
+#endif // !defined HAVE_CUDA || !defined WIN32
#include "test_precomp.hpp"
-#ifdef HAVE_CUDA
+#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
+
+//////////////////////////////////////////////////////
+// VideoReader
+
+PARAM_TEST_CASE(VideoReader, cv::gpu::DeviceInfo, std::string)
+{
+ cv::gpu::DeviceInfo devInfo;
+ std::string inputFile;
+
+ virtual void SetUp()
+ {
+ devInfo = GET_PARAM(0);
+ inputFile = GET_PARAM(1);
+
+ cv::gpu::setDevice(devInfo.deviceID());
+
+ inputFile = std::string(cvtest::TS::ptr()->get_data_path()) + "video/" + inputFile;
+ }
+};
+
+GPU_TEST_P(VideoReader, Regression)
+{
+ cv::gpu::VideoReader_GPU reader(inputFile);
+ ASSERT_TRUE(reader.isOpened());
+
+ cv::gpu::GpuMat frame;
+
+ for (int i = 0; i < 10; ++i)
+ {
+ ASSERT_TRUE(reader.read(frame));
+ ASSERT_FALSE(frame.empty());
+ }
+
+ reader.close();
+ ASSERT_FALSE(reader.isOpened());
+}
+
+INSTANTIATE_TEST_CASE_P(GPU_Video, VideoReader, testing::Combine(
+ ALL_DEVICES,
+ testing::Values(std::string("768x576.avi"), std::string("1920x1080.avi"))));
//////////////////////////////////////////////////////
// VideoWriter
#endif // WIN32
-//////////////////////////////////////////////////////
-// VideoReader
-
-#ifdef HAVE_NVCUVID
-
-PARAM_TEST_CASE(VideoReader, cv::gpu::DeviceInfo, std::string)
-{
- cv::gpu::DeviceInfo devInfo;
- std::string inputFile;
-
- virtual void SetUp()
- {
- devInfo = GET_PARAM(0);
- inputFile = GET_PARAM(1);
-
- cv::gpu::setDevice(devInfo.deviceID());
-
- inputFile = std::string(cvtest::TS::ptr()->get_data_path()) + "video/" + inputFile;
- }
-};
-
-GPU_TEST_P(VideoReader, Regression)
-{
- cv::gpu::VideoReader_GPU reader(inputFile);
- ASSERT_TRUE(reader.isOpened());
-
- cv::gpu::GpuMat frame;
-
- for (int i = 0; i < 10; ++i)
- {
- ASSERT_TRUE(reader.read(frame));
- ASSERT_FALSE(frame.empty());
- }
-
- reader.close();
- ASSERT_FALSE(reader.isOpened());
-}
-
-INSTANTIATE_TEST_CASE_P(GPU_Video, VideoReader, testing::Combine(
- ALL_DEVICES,
- testing::Values(std::string("768x576.avi"), std::string("1920x1080.avi"))));
-
-#endif // HAVE_NVCUVID
-
-#endif // HAVE_CUDA
+#endif // defined(HAVE_CUDA) && defined(HAVE_NVCUVID)