Commit 73959fed authored by Maksim Shabunin's avatar Maksim Shabunin Committed by Alexander Alekhin

Merge pull request #13422 from mshabunin:split-videoio-cmake

* Split videoio dependencies search into pieces, removed obsolete backends
parent e2673421
......@@ -221,10 +221,13 @@ OCV_OPTION(BUILD_ITT "Build Intel ITT from source" (NOT MI
# ===================================================
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
VERIFY HAVE_DC1394)
VERIFY HAVE_DC1394_2)
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O (iOS/Mac)" ON
VISIBLE_IF APPLE
VERIFY HAVE_AVFOUNDATION)
OCV_OPTION(WITH_CAP_IOS "Enable iOS video capture" ON
VISIBLE_IF IOS
VERIFY HAVE_CAP_IOS)
OCV_OPTION(WITH_CAROTENE "Use NVidia carotene acceleration library for ARM platform" ON
VISIBLE_IF (ARM OR AARCH64) AND NOT IOS AND NOT (CMAKE_VERSION VERSION_LESS "2.8.11"))
OCV_OPTION(WITH_CPUFEATURES "Use cpufeatures Android library" ON
......@@ -253,10 +256,7 @@ OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON
VERIFY HAVE_FFMPEG)
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
VERIFY HAVE_GSTREAMER AND GSTREAMER_BASE_VERSION VERSION_GREATER "0.99")
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF
VISIBLE_IF TRUE
VERIFY HAVE_GSTREAMER AND GSTREAMER_BASE_VERSION VERSION_LESS "1.0")
VERIFY HAVE_GSTREAMER AND GSTREAMER_VERSION VERSION_GREATER "0.99")
OCV_OPTION(WITH_GTK "Include GTK support" ON
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
VERIFY HAVE_GTK)
......@@ -308,9 +308,6 @@ OCV_OPTION(WITH_GDCM "Include DICOM support" OFF
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" OFF
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
VERIFY HAVE_PVAPI)
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" OFF
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
VERIFY HAVE_GIGE_API)
OCV_OPTION(WITH_ARAVIS "Include Aravis GigE support" OFF
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT WIN32
VERIFY HAVE_ARAVIS_API)
......@@ -371,9 +368,6 @@ OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON
OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON
VISIBLE_IF WIN32 AND NOT WINRT
VERIFY HAVE_DIRECTX)
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF
VISIBLE_IF WIN32 AND NOT WINRT
VERIFY HAVE_INTELPERC)
OCV_OPTION(WITH_LIBREALSENSE "Include Intel librealsense support" OFF
VISIBLE_IF NOT WITH_INTELPERC
VERIFY HAVE_LIBREALSENSE)
......@@ -1351,7 +1345,7 @@ if(WITH_GDAL OR HAVE_GDAL)
endif()
if(WITH_GDCM OR HAVE_GDCM)
status(" GDCM:" HAVE_GDCM THEN "YES (ver ${GDCM_VERSION})" ELSE "NO")
status(" GDCM:" HAVE_GDCM THEN "YES (${GDCM_VERSION})" ELSE "NO")
endif()
if(WITH_IMGCODEC_HDR OR DEFINED HAVE_IMGCODEC_HDR)
......@@ -1375,11 +1369,7 @@ status("")
status(" Video I/O:")
if(WITH_1394 OR HAVE_DC1394_2)
if (HAVE_DC1394_2)
status(" DC1394:" "YES (ver ${ALIASOF_libdc1394-2_VERSION})")
else()
status(" DC1394:" "NO")
endif()
status(" DC1394:" HAVE_DC1394_2 THEN "YES (${DC1394_2_VERSION})" ELSE NO)
endif()
if(WITH_FFMPEG OR HAVE_FFMPEG)
......@@ -1390,79 +1380,64 @@ if(WITH_FFMPEG OR HAVE_FFMPEG)
else()
status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO)
endif()
status(" avcodec:" FFMPEG_libavcodec_FOUND THEN "YES (ver ${FFMPEG_libavcodec_VERSION})" ELSE NO)
status(" avformat:" FFMPEG_libavformat_FOUND THEN "YES (ver ${FFMPEG_libavformat_VERSION})" ELSE NO)
status(" avutil:" FFMPEG_libavutil_FOUND THEN "YES (ver ${FFMPEG_libavutil_VERSION})" ELSE NO)
status(" swscale:" FFMPEG_libswscale_FOUND THEN "YES (ver ${FFMPEG_libswscale_VERSION})" ELSE NO)
status(" avresample:" FFMPEG_libavresample_FOUND THEN "YES (ver ${FFMPEG_libavresample_VERSION})" ELSE NO)
status(" avcodec:" FFMPEG_libavcodec_VERSION THEN "YES (${FFMPEG_libavcodec_VERSION})" ELSE NO)
status(" avformat:" FFMPEG_libavformat_VERSION THEN "YES (${FFMPEG_libavformat_VERSION})" ELSE NO)
status(" avutil:" FFMPEG_libavutil_VERSION THEN "YES (${FFMPEG_libavutil_VERSION})" ELSE NO)
status(" swscale:" FFMPEG_libswscale_VERSION THEN "YES (${FFMPEG_libswscale_VERSION})" ELSE NO)
status(" avresample:" FFMPEG_libavresample_VERSION THEN "YES (${FFMPEG_libavresample_VERSION})" ELSE NO)
endif()
if(WITH_GSTREAMER OR HAVE_GSTREAMER)
status(" GStreamer:" HAVE_GSTREAMER THEN "" ELSE NO)
if(HAVE_GSTREAMER)
status(" base:" "YES (ver ${GSTREAMER_BASE_VERSION})")
status(" video:" "YES (ver ${GSTREAMER_VIDEO_VERSION})")
status(" app:" "YES (ver ${GSTREAMER_APP_VERSION})")
status(" riff:" "YES (ver ${GSTREAMER_RIFF_VERSION})")
status(" pbutils:" "YES (ver ${GSTREAMER_PBUTILS_VERSION})")
endif(HAVE_GSTREAMER)
endif()
if(WITH_OPENNI OR HAVE_OPENNI)
status(" OpenNI:" HAVE_OPENNI THEN "YES (ver ${OPENNI_VERSION_STRING}, build ${OPENNI_VERSION_BUILD})" ELSE NO)
status(" OpenNI PrimeSensor Modules:" HAVE_OPENNI_PRIME_SENSOR_MODULE THEN "YES (${OPENNI_PRIME_SENSOR_MODULE})" ELSE NO)
status(" GStreamer:" HAVE_GSTREAMER THEN "YES (${GSTREAMER_VERSION})" ELSE NO)
endif()
if(WITH_OPENNI2 OR HAVE_OPENNI2)
status(" OpenNI2:" HAVE_OPENNI2 THEN "YES (ver ${OPENNI2_VERSION_STRING}, build ${OPENNI2_VERSION_BUILD})" ELSE NO)
status(" OpenNI2:" HAVE_OPENNI2 THEN "YES (${OPENNI2_VERSION})" ELSE NO)
endif()
if(WITH_PVAPI OR HAVE_PVAPI)
status(" PvAPI:" HAVE_PVAPI THEN YES ELSE NO)
status(" PvAPI:" HAVE_PVAPI THEN YES ELSE NO)
endif()
if(WITH_GIGEAPI OR HAVE_GIGE_API)
status(" GigEVisionSDK:" HAVE_GIGE_API THEN YES ELSE NO)
if(WITH_ARAVIS OR HAVE_ARAVIS_API)
status(" Aravis SDK:" HAVE_ARAVIS_API THEN "YES (${ARAVIS_VERSION})" ELSE NO)
endif()
if(WITH_ARAVIS OR HAVE_ARAVIS_API)
status(" Aravis SDK:" HAVE_ARAVIS_API THEN "YES (${ARAVIS_LIBRARIES})" ELSE NO)
if(WITH_AVFOUNDATION OR HAVE_AVFOUNDATION)
status(" AVFoundation:" HAVE_AVFOUNDATION THEN YES ELSE NO)
endif()
if(APPLE)
status(" AVFoundation:" HAVE_AVFOUNDATION THEN YES ELSE NO)
if(WITH_QUICKTIME OR HAVE_QUICKTIME)
status(" QuickTime:" HAVE_QUICKTIME THEN YES ELSE NO)
endif()
if(HAVE_CAP_IOS)
status(" iOS capture:" YES)
endif()
if(WITH_V4L OR HAVE_CAMV4L2 OR HAVE_VIDEOIO)
if(WITH_V4L OR HAVE_V4L)
ocv_build_features_string(v4l_status
IF HAVE_CAMV4L2 THEN "linux/videodev2.h"
IF HAVE_VIDEOIO THEN "sys/videoio.h"
ELSE "NO")
status(" v4l/v4l2:" "${v4l_status}")
status(" v4l/v4l2:" HAVE_V4L THEN "YES (${v4l_status})" ELSE NO)
endif()
if(WITH_DSHOW OR HAVE_DSHOW)
status(" DirectShow:" HAVE_DSHOW THEN YES ELSE NO)
status(" DirectShow:" HAVE_DSHOW THEN YES ELSE NO)
endif()
if(WITH_MSMF OR HAVE_MSMF)
status(" Media Foundation:" HAVE_MSMF THEN YES ELSE NO)
status(" DXVA:" HAVE_MSMF_DXVA THEN YES ELSE NO)
status(" Media Foundation:" HAVE_MSMF THEN YES ELSE NO)
status(" DXVA:" HAVE_MSMF_DXVA THEN YES ELSE NO)
endif()
if(WITH_XIMEA OR HAVE_XIMEA)
status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO)
status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO)
endif()
if(WITH_XINE OR HAVE_XINE)
status(" Xine:" HAVE_XINE THEN "YES (ver ${ALIASOF_libxine_VERSION})" ELSE NO)
status(" Xine:" HAVE_XINE THEN "YES (${XINE_VERSION})" ELSE NO)
endif()
if(WITH_INTELPERC OR HAVE_INTELPERC)
status(" Intel PerC:" HAVE_INTELPERC THEN "YES" ELSE NO)
if(WITH_LIBREALSENSE OR HAVE_LIBREALSENSE)
status(" Intel RealSense:" HAVE_LIBREALSENSE THEN "YES (${LIBREALSENSE_VERSION})" ELSE NO)
endif()
if(WITH_MFX OR HAVE_MFX)
......
This diff is collapsed.
set(HAVE_MFX 0)
if (UNIX)
set(root "$ENV{MFX_HOME}")
elseif(WIN32)
set(root "$ENV{INTELMEDIASDKROOT}")
endif()
# TODO: ICC? MINGW? ARM? IOS?
if(WIN32)
if(X86_64)
set(arch "x64")
else()
set(arch "win32")
endif()
elseif(UNIX)
set(arch "lin_x64")
else()
# ???
endif()
find_path(MFX_INCLUDE mfxdefs.h PATHS "${root}/include" NO_DEFAULT_PATH)
message(STATUS "MFX_INCLUDE: ${MFX_INCLUDE} (${root}/include)")
find_library(MFX_LIBRARY NAMES mfx PATHS "${root}/lib/${arch}" NO_DEFAULT_PATH)
if(MSVC)
if(MSVC14)
find_library(MFX_LIBRARY NAMES libmfx_vs2015.lib PATHS "${root}/lib/${arch}" NO_DEFAULT_PATH)
else()
find_library(MFX_LIBRARY NAMES libmfx.lib PATHS "${root}/lib/${arch}" NO_DEFAULT_PATH)
endif()
endif()
if(NOT MFX_INCLUDE OR NOT MFX_LIBRARY)
return()
endif()
set(deps)
if (UNIX)
find_library(MFX_VA_LIBRARY va)
find_library(MFX_VA_DRM_LIBRARY va-drm)
if (NOT MFX_VA_LIBRARY OR NOT MFX_VA_DRM_LIBRARY)
return()
endif()
add_library(mfx-va UNKNOWN IMPORTED)
set_target_properties(mfx-va PROPERTIES IMPORTED_LOCATION "${MFX_VA_LIBRARY}")
add_library(mfx-va-drm UNKNOWN IMPORTED)
set_target_properties(mfx-va-drm PROPERTIES IMPORTED_LOCATION "${MFX_VA_DRM_LIBRARY}")
list(APPEND deps mfx-va mfx-va-drm "-Wl,--exclude-libs=libmfx")
endif()
add_library(mfx UNKNOWN IMPORTED)
set_target_properties(mfx PROPERTIES
IMPORTED_LOCATION "${MFX_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${MFX_INCLUDE}"
INTERFACE_LINK_LIBRARIES "${deps}"
)
set(HAVE_MFX 1)
# Main variables:
# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
if(X86_64)
find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
else()
find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/Win32" DOC "Path to Intel Perceptual Computing SDK interface libraries")
endif()
if(INTELPERC_INCLUDE_DIR AND INTELPERC_LIBRARIES)
set(HAVE_INTELPERC TRUE)
else()
set(HAVE_INTELPERC FALSE)
message(WARNING "Intel Perceptual Computing SDK library directory (set by INTELPERC_LIB_DIR variable) is not found or does not have Intel Perceptual Computing SDK libraries.")
endif() #if(INTELPERC_INCLUDE_DIR AND INTELPERC_LIBRARIES)
mark_as_advanced(FORCE INTELPERC_LIBRARIES INTELPERC_INCLUDE_DIR)
\ No newline at end of file
# Main variables:
# LIBREALSENSE_LIBRARIES and LIBREALSENSE_INCLUDE to link Intel librealsense modules
# HAVE_LIBREALSENSE for conditional compilation OpenCV with/without librealsense
find_path(LIBREALSENSE_INCLUDE_DIR "librealsense2/rs.hpp" PATHS "$ENV{LIBREALSENSE_INCLUDE}" DOC "Path to librealsense interface headers")
find_library(LIBREALSENSE_LIBRARIES "realsense2" PATHS "$ENV{LIBREALSENSE_LIB}" DOC "Path to librealsense interface libraries")
if(LIBREALSENSE_INCLUDE_DIR AND LIBREALSENSE_LIBRARIES)
set(HAVE_LIBREALSENSE TRUE)
else()
set(HAVE_LIBREALSENSE FALSE)
message( WARNING, " librealsense include directory (set by LIBREALSENSE_INCLUDE_DIR variable) is not found or does not have librealsense include files." )
endif() #if(LIBREALSENSE_INCLUDE_DIR AND LIBREALSENSE_LIBRARIES)
mark_as_advanced(FORCE LIBREALSENSE_LIBRARIES LIBREALSENSE_INCLUDE_DIR)
\ No newline at end of file
This diff is collapsed.
# Main variables:
# OPENNI_LIBRARY and OPENNI_INCLUDES to link OpenCV modules with OpenNI
# HAVE_OPENNI for conditional compilation OpenCV with/without OpenNI
if(NOT "${OPENNI_LIB_DIR}" STREQUAL "${OPENNI_LIB_DIR_INTERNAL}")
unset(OPENNI_LIBRARY CACHE)
unset(OPENNI_LIB_DIR CACHE)
endif()
if(NOT "${OPENNI_INCLUDE_DIR}" STREQUAL "${OPENNI_INCLUDE_DIR_INTERNAL}")
unset(OPENNI_INCLUDES CACHE)
unset(OPENNI_INCLUDE_DIR CACHE)
endif()
if(NOT "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}" STREQUAL "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR_INTERNAL}")
unset(OPENNI_PRIME_SENSOR_MODULE CACHE)
unset(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR CACHE)
endif()
if(WIN32)
if(NOT (MSVC64 OR MINGW64))
find_file(OPENNI_INCLUDES "XnCppWrapper.h" PATHS "$ENV{OPEN_NI_INSTALL_PATH}Include" DOC "OpenNI c++ interface header")
find_library(OPENNI_LIBRARY "OpenNI" PATHS $ENV{OPEN_NI_LIB} DOC "OpenNI library")
else()
find_file(OPENNI_INCLUDES "XnCppWrapper.h" PATHS "$ENV{OPEN_NI_INSTALL_PATH64}Include" DOC "OpenNI c++ interface header")
find_library(OPENNI_LIBRARY "OpenNI64" PATHS $ENV{OPEN_NI_LIB64} DOC "OpenNI library")
endif()
elseif(UNIX OR APPLE)
find_file(OPENNI_INCLUDES "XnCppWrapper.h" PATHS "/usr/include/ni" "/usr/include/openni" DOC "OpenNI c++ interface header")
find_library(OPENNI_LIBRARY "OpenNI" PATHS "/usr/lib" DOC "OpenNI library")
endif()
if(OPENNI_LIBRARY AND OPENNI_INCLUDES)
set(HAVE_OPENNI TRUE)
# the check: are PrimeSensor Modules for OpenNI installed
if(WIN32)
if(NOT (MSVC64 OR MINGW64))
find_file(OPENNI_PRIME_SENSOR_MODULE "XnCore.dll" PATHS "$ENV{OPEN_NI_INSTALL_PATH}../PrimeSense/Sensor/Bin" "$ENV{OPEN_NI_INSTALL_PATH}../PrimeSense/SensorKinect/Bin" DOC "Core library of PrimeSensor Modules for OpenNI")
else()
find_file(OPENNI_PRIME_SENSOR_MODULE "XnCore64.dll" PATHS "$ENV{OPEN_NI_INSTALL_PATH64}../PrimeSense/Sensor/Bin64" "$ENV{OPEN_NI_INSTALL_PATH64}../PrimeSense/SensorKinect/Bin64" DOC "Core library of PrimeSensor Modules for OpenNI")
endif()
elseif(UNIX OR APPLE)
find_library(OPENNI_PRIME_SENSOR_MODULE "XnCore" PATHS "/usr/lib" DOC "Core library of PrimeSensor Modules for OpenNI")
endif()
if(OPENNI_PRIME_SENSOR_MODULE)
set(HAVE_OPENNI_PRIME_SENSOR_MODULE TRUE)
endif()
endif() #if(OPENNI_LIBRARY AND OPENNI_INCLUDES)
get_filename_component(OPENNI_LIB_DIR "${OPENNI_LIBRARY}" PATH)
get_filename_component(OPENNI_INCLUDE_DIR ${OPENNI_INCLUDES} PATH)
get_filename_component(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "${OPENNI_PRIME_SENSOR_MODULE}" PATH)
if(HAVE_OPENNI)
set(OPENNI_LIB_DIR "${OPENNI_LIB_DIR}" CACHE PATH "Path to OpenNI libraries" FORCE)
set(OPENNI_INCLUDE_DIR "${OPENNI_INCLUDE_DIR}" CACHE PATH "Path to OpenNI headers" FORCE)
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}" CACHE PATH "Path to OpenNI PrimeSensor Module binaries" FORCE)
endif()
if(OPENNI_LIBRARY)
set(OPENNI_LIB_DIR_INTERNAL "${OPENNI_LIB_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_LIB_DIR was set successfully." FORCE)
else()
message( WARNING, " OpenNI library directory (set by OPENNI_LIB_DIR variable) is not found or does not have OpenNI libraries." )
endif()
if(OPENNI_INCLUDES)
set(OPENNI_INCLUDE_DIR_INTERNAL "${OPENNI_INCLUDE_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_INCLUDE_DIR was set successfully." FORCE)
else()
message( WARNING, " OpenNI include directory (set by OPENNI_INCLUDE_DIR variable) is not found or does not have OpenNI include files." )
endif()
if(OPENNI_PRIME_SENSOR_MODULE)
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR_INTERNAL "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_PRIME_SENSOR_MODULE_BIN_DIR was set successfully." FORCE)
else()
message( WARNING, " PrimeSensor Module binaries directory (set by OPENNI_PRIME_SENSOR_MODULE_BIN_DIR variable) is not found or does not have PrimeSensor Module binaries." )
endif()
mark_as_advanced(FORCE OPENNI_PRIME_SENSOR_MODULE)
mark_as_advanced(FORCE OPENNI_LIBRARY)
mark_as_advanced(FORCE OPENNI_INCLUDES)
if(HAVE_OPENNI)
ocv_parse_header("${OPENNI_INCLUDE_DIR}/XnVersion.h" OPENNI_VERSION_LINES XN_MAJOR_VERSION XN_MINOR_VERSION XN_MAINTENANCE_VERSION XN_BUILD_VERSION)
if(XN_MAJOR_VERSION)
set(OPENNI_VERSION_STRING ${XN_MAJOR_VERSION}.${XN_MINOR_VERSION}.${XN_MAINTENANCE_VERSION} CACHE INTERNAL "OpenNI version")
set(OPENNI_VERSION_BUILD ${XN_BUILD_VERSION} CACHE INTERNAL "OpenNI build version")
endif()
endif()
# Main variables:
# OPENNI2_LIBRARY and OPENNI2_INCLUDES to link OpenCV modules with OpenNI2
# HAVE_OPENNI2 for conditional compilation OpenCV with/without OpenNI2
if(NOT "${OPENNI2_LIB_DIR}" STREQUAL "${OPENNI2_LIB_DIR_INTERNAL}")
unset(OPENNI2_LIBRARY CACHE)
unset(OPENNI2_LIB_DIR CACHE)
endif()
if(NOT "${OPENNI2_INCLUDE_DIR}" STREQUAL "${OPENNI2_INCLUDE_DIR_INTERNAL}")
unset(OPENNI2_INCLUDES CACHE)
unset(OPENNI2_INCLUDE_DIR CACHE)
endif()
if(WIN32)
if(NOT (MSVC64 OR MINGW64))
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS $ENV{OPENNI2_INCLUDE} "$ENV{OPEN_NI_INSTALL_PATH}Include" DOC "OpenNI2 c++ interface header")
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB} DOC "OpenNI2 library")
else()
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS $ENV{OPENNI2_INCLUDE64} "$ENV{OPEN_NI_INSTALL_PATH64}Include" DOC "OpenNI2 c++ interface header")
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB64} DOC "OpenNI2 library")
endif()
elseif(UNIX OR APPLE)
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "/usr/include/ni2" "/usr/include/openni2" $ENV{OPENNI2_INCLUDE} DOC "OpenNI2 c++ interface header")
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS "/usr/lib" $ENV{OPENNI2_REDIST} DOC "OpenNI2 library")
endif()
if(OPENNI2_LIBRARY AND OPENNI2_INCLUDES)
set(HAVE_OPENNI2 TRUE)
endif() #if(OPENNI2_LIBRARY AND OPENNI2_INCLUDES)
get_filename_component(OPENNI2_LIB_DIR "${OPENNI2_LIBRARY}" PATH)
get_filename_component(OPENNI2_INCLUDE_DIR ${OPENNI2_INCLUDES} PATH)
if(HAVE_OPENNI2)
set(OPENNI2_LIB_DIR "${OPENNI2_LIB_DIR}" CACHE PATH "Path to OpenNI2 libraries" FORCE)
set(OPENNI2_INCLUDE_DIR "${OPENNI2_INCLUDE_DIR}" CACHE PATH "Path to OpenNI2 headers" FORCE)
endif()
if(OPENNI2_LIBRARY)
set(OPENNI2_LIB_DIR_INTERNAL "${OPENNI2_LIB_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_LIB_DIR was set successfully." FORCE)
else()
message( WARNING, " OpenNI2 library directory (set by OPENNI2_LIB_DIR variable) is not found or does not have OpenNI2 libraries." )
endif()
if(OPENNI2_INCLUDES)
set(OPENNI2_INCLUDE_DIR_INTERNAL "${OPENNI2_INCLUDE_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI2_INCLUDE_DIR was set successfully." FORCE)
else()
message( WARNING, " OpenNI2 include directory (set by OPENNI2_INCLUDE_DIR variable) is not found or does not have OpenNI2 include files." )
endif()
mark_as_advanced(FORCE OPENNI2_LIBRARY)
mark_as_advanced(FORCE OPENNI2_INCLUDES)
if(HAVE_OPENNI2)
ocv_parse_header("${OPENNI2_INCLUDE_DIR}/OniVersion.h" ONI_VERSION_LINE ONI_VERSION_MAJOR ONI_VERSION_MINOR ONI_VERSION_MAINTENANCE ONI_VERSION_BUILD)
if(ONI_VERSION_MAJOR)
set(OPENNI2_VERSION_STRING ${ONI_VERSION_MAJOR}.${ONI_VERSION_MINOR}.${ONI_VERSION_MAINTENANCE} CACHE INTERNAL "OpenNI2 version")
set(OPENNI2_VERSION_BUILD ${ONI_VERSION_BUILD} CACHE INTERNAL "OpenNI2 build version")
endif()
endif()
# - Find XIMEA
# This module finds if XIMEA Software package is installed
# and determines where the binaries and header files are.
# This code sets the following variables:
#
# XIMEA_FOUND - True if XIMEA API found
# XIMEA_PATH: - Path to the XIMEA API folder
# XIMEA_LIBRARY_DIR - XIMEA libraries folder
#
# Created: 5 Aug 2011 by Marian Zajko (marian.zajko@ximea.com)
# Updated: 25 June 2012 by Igor Kuzmin (parafin@ximea.com)
# Updated: 22 October 2012 by Marian Zajko (marian.zajko@ximea.com)
#
set(XIMEA_FOUND)
set(XIMEA_PATH)
set(XIMEA_LIBRARY_DIR)
if(WIN32)
# Try to find the XIMEA API path in registry.
GET_FILENAME_COMPONENT(XIMEA_PATH "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE)
if(EXISTS ${XIMEA_PATH})
set(XIMEA_FOUND 1)
# set LIB folders
if(X86_64)
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x64")
else()
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x86")
endif()
else()
set(XIMEA_FOUND 0)
endif()
elseif(APPLE)
if(EXISTS /Library/Frameworks/m3api.framework)
set(XIMEA_FOUND 1)
else()
set(XIMEA_FOUND 0)
endif()
else()
if(EXISTS /opt/XIMEA)
set(XIMEA_FOUND 1)
# set folders
set(XIMEA_PATH /opt/XIMEA/include)
else()
set(XIMEA_FOUND 0)
endif()
endif()
mark_as_advanced(FORCE XIMEA_FOUND)
mark_as_advanced(FORCE XIMEA_PATH)
mark_as_advanced(FORCE XIMEA_LIBRARY_DIR)
......@@ -41,7 +41,7 @@ foreach(m ${OPENCV_MODULES_BUILD})
endif()
endforeach()
export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules.cmake")
export(EXPORT OpenCVModules FILE "${CMAKE_BINARY_DIR}/OpenCVModules.cmake")
if(TARGET ippicv AND NOT BUILD_SHARED_LIBS)
set(USE_IPPICV TRUE)
......
......@@ -1243,14 +1243,6 @@ macro(ocv_parse_header2 LIBNAME HDR_PATH VARNAME)
endif()
endmacro()
# read single version info from the pkg file
macro(ocv_parse_pkg LIBNAME PKG_PATH SCOPE)
if(EXISTS "${PKG_PATH}/${LIBNAME}.pc")
file(STRINGS "${PKG_PATH}/${LIBNAME}.pc" line_to_parse REGEX "^Version:[ \t]+[0-9.]*.*$" LIMIT_COUNT 1)
STRING(REGEX REPLACE ".*Version: ([^ ]+).*" "\\1" ALIASOF_${LIBNAME}_VERSION "${line_to_parse}" )
endif()
endmacro()
################################################################################################
# short command to setup source group
function(ocv_source_group group)
......
......@@ -22,12 +22,6 @@
/* Compile for 'virtual' NVIDIA PTX architectures */
#define CUDA_ARCH_PTX "${OPENCV_CUDA_ARCH_PTX}"
/* AVFoundation video libraries */
#cmakedefine HAVE_AVFOUNDATION
/* V4L2 capturing support */
#cmakedefine HAVE_CAMV4L2
/* AMD's Basic Linear Algebra Subprograms Library*/
#cmakedefine HAVE_CLAMDBLAS
......@@ -49,12 +43,6 @@
/* NVIDIA CUDA Fast Fourier Transform (FFT) API*/
#cmakedefine HAVE_CUFFT
/* IEEE1394 capturing support */
#cmakedefine HAVE_DC1394
/* IEEE1394 capturing support - libdc1394 v2.x */
#cmakedefine HAVE_DC1394_2
/* DirectX */
#cmakedefine HAVE_DIRECTX
#cmakedefine HAVE_DIRECTX_NV12
......@@ -62,21 +50,12 @@
#cmakedefine HAVE_D3D10
#cmakedefine HAVE_D3D9
/* DirectShow Video Capture library */
#cmakedefine HAVE_DSHOW
/* Eigen Matrix & Linear Algebra Library */
#cmakedefine HAVE_EIGEN
/* FFMpeg video library */
#cmakedefine HAVE_FFMPEG
/* Geospatial Data Abstraction Library */
#cmakedefine HAVE_GDAL
/* GStreamer multimedia framework */
#cmakedefine HAVE_GSTREAMER
/* GTK+ 2.0 Thread support */
#cmakedefine HAVE_GTHREAD
......@@ -92,9 +71,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Intel Perceptual Computing SDK library */
#cmakedefine HAVE_INTELPERC
/* Intel Integrated Performance Primitives */
#cmakedefine HAVE_IPP
#cmakedefine HAVE_IPP_ICV
......@@ -113,9 +89,6 @@
/* GDCM DICOM codec */
#cmakedefine HAVE_GDCM
/* Microsoft Media Foundation Capture library */
#cmakedefine HAVE_MSMF
/* NVIDIA Video Decoding API*/
#cmakedefine HAVE_NVCUVID
......@@ -133,15 +106,6 @@
/* OpenGL support*/
#cmakedefine HAVE_OPENGL
/* OpenNI library */
#cmakedefine HAVE_OPENNI
/* OpenNI library */
#cmakedefine HAVE_OPENNI2
/* librealsense library */
#cmakedefine HAVE_LIBREALSENSE
/* PNG codec */
#cmakedefine HAVE_PNG
......@@ -166,34 +130,19 @@
/* TIFF codec */
#cmakedefine HAVE_TIFF
/* V4L2 capturing support in videoio.h */
#cmakedefine HAVE_VIDEOIO
/* Win32 UI */
#cmakedefine HAVE_WIN32UI
/* XIMEA camera support */
#cmakedefine HAVE_XIMEA
/* Xine video library */
#cmakedefine HAVE_XINE
/* Define if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#cmakedefine WORDS_BIGENDIAN
/* gPhoto2 library */
#cmakedefine HAVE_GPHOTO2
/* VA library (libva) */
#cmakedefine HAVE_VA
/* Intel VA-API/OpenCL */
#cmakedefine HAVE_VA_INTEL
/* Intel Media SDK */
#cmakedefine HAVE_MFX
/* Lapack */
#cmakedefine HAVE_LAPACK
......@@ -203,23 +152,6 @@
/* OpenVX */
#cmakedefine HAVE_OPENVX
#if defined(HAVE_XINE) || \
defined(HAVE_GSTREAMER) || \
defined(HAVE_AVFOUNDATION) || \
/*defined(HAVE_OPENNI) || too specialized */ \
defined(HAVE_FFMPEG) || \
defined(HAVE_MSMF)
#define HAVE_VIDEO_INPUT
#endif
#if /*defined(HAVE_XINE) || */\
defined(HAVE_GSTREAMER) || \
defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \
defined(HAVE_MSMF)
#define HAVE_VIDEO_OUTPUT
#endif
/* OpenCV trace utilities */
#cmakedefine OPENCV_TRACE
......
Using Creative Senz3D and other Intel Perceptual Computing SDK compatible depth sensors {#tutorial_intelperc}
=======================================================================================
**Note**: this tutorial is partially obsolete since PerC SDK has been replaced with RealSense SDK
Depth sensors compatible with Intel Perceptual Computing SDK are supported through VideoCapture
class. Depth map, RGB image and some other formats of output can be retrieved by using familiar
interface of VideoCapture.
......
......@@ -6,7 +6,6 @@
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL
#ifdef HAVE_VIDEO_INPUT
#include "../perf_bgfg_utils.hpp"
namespace cvtest {
......@@ -32,7 +31,8 @@ OCL_PERF_TEST_P(KNN_Apply, KNN, Combine(Values("gpu/video/768x576.avi", "gpu/vid
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer);
UMat u_foreground;
......@@ -65,7 +65,8 @@ OCL_PERF_TEST_P(KNN_GetBackgroundImage, KNN, Values(
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer, skipFrames);
UMat u_foreground, u_background;
......@@ -92,4 +93,3 @@ OCL_PERF_TEST_P(KNN_GetBackgroundImage, KNN, Values(
}}// namespace cvtest::ocl
#endif
#endif
......@@ -6,7 +6,6 @@
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL
#ifdef HAVE_VIDEO_INPUT
#include "../perf_bgfg_utils.hpp"
namespace opencv_test {
......@@ -32,7 +31,8 @@ OCL_PERF_TEST_P(MOG2_Apply, Mog2, Combine(Values("gpu/video/768x576.avi", "gpu/v
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer);
UMat u_foreground;
......@@ -65,7 +65,8 @@ OCL_PERF_TEST_P(MOG2_GetBackgroundImage, Mog2, Values(
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer, skipFrames);
UMat u_foreground, u_background;
......@@ -92,4 +93,3 @@ OCL_PERF_TEST_P(MOG2_GetBackgroundImage, Mog2, Values(
}}// namespace opencv_test::ocl
#endif
#endif
......@@ -4,7 +4,6 @@
#include "perf_precomp.hpp"
#ifdef HAVE_VIDEO_INPUT
#include "perf_bgfg_utils.hpp"
namespace opencv_test { namespace {
......@@ -27,7 +26,8 @@ PERF_TEST_P(KNN_Apply, KNN, Combine(Values("gpu/video/768x576.avi", "gpu/video/1
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer);
Mat foreground;
......@@ -60,7 +60,8 @@ PERF_TEST_P(KNN_GetBackgroundImage, KNN, Values(
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer, skipFrames);
Mat foreground, background;
......@@ -85,5 +86,3 @@ PERF_TEST_P(KNN_GetBackgroundImage, KNN, Values(
}
}}// namespace
#endif
......@@ -4,7 +4,6 @@
#include "perf_precomp.hpp"
#ifdef HAVE_VIDEO_INPUT
#include "perf_bgfg_utils.hpp"
namespace opencv_test { namespace {
......@@ -27,7 +26,8 @@ PERF_TEST_P(MOG2_Apply, Mog2, Combine(Values("gpu/video/768x576.avi", "gpu/video
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer);
Mat foreground;
......@@ -60,7 +60,8 @@ PERF_TEST_P(MOG2_GetBackgroundImage, Mog2, Values(
vector<Mat> frame_buffer(nFrame);
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
prepareData(cap, cn, frame_buffer, skipFrames);
Mat foreground, background;
......@@ -85,5 +86,3 @@ PERF_TEST_P(MOG2_GetBackgroundImage, Mog2, Values(
}
}}// namespace
#endif
......@@ -2,7 +2,6 @@
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL
#ifdef HAVE_VIDEO_INPUT
namespace opencv_test {
namespace ocl {
......@@ -33,7 +32,8 @@ OCL_TEST_P(Mog2_Update, Accuracy)
{
string inputFile = string(TS::ptr()->get_data_path()) + "video/768x576.avi";
VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
Ptr<BackgroundSubtractorMOG2> mog2_cpu = createBackgroundSubtractorMOG2();
Ptr<BackgroundSubtractorMOG2> mog2_ocl = createBackgroundSubtractorMOG2();
......@@ -90,7 +90,8 @@ OCL_TEST_P(Mog2_getBackgroundImage, Accuracy)
{
string inputFile = string(TS::ptr()->get_data_path()) + "video/768x576.avi";
VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
if (!cap.isOpened())
throw SkipTestException("Video file can not be opened");
Ptr<BackgroundSubtractorMOG2> mog2_cpu = createBackgroundSubtractorMOG2();
Ptr<BackgroundSubtractorMOG2> mog2_ocl = createBackgroundSubtractorMOG2();
......@@ -142,4 +143,3 @@ OCL_INSTANTIATE_TEST_CASE_P(OCL_Video, Mog2_getBackgroundImage, Combine(
}}// namespace opencv_test::ocl
#endif
#endif
This diff is collapsed.
# --- Aravis SDK ---
if(NOT HAVE_ARAVIS_API AND PKG_CONFIG_FOUND)
pkg_check_modules(ARAVIS aravis-0.6 QUIET)
if(ARAVIS_FOUND)
set(HAVE_ARAVIS_API TRUE)
endif()
endif()
if(NOT HAVE_ARAVIS_API)
find_path(ARAVIS_INCLUDE "arv.h"
PATHS "${ARAVIS_ROOT}" ENV ARAVIS_ROOT
PATH_SUFFIXES "include/aravis-0.6"
NO_DEFAULT_PATH)
find_library(ARAVIS_LIBRARY "aravis-0.6"
PATHS "${ARAVIS_ROOT}" ENV ARAVIS_ROOT
PATH_SUFFIXES "lib"
NO_DEFAULT_PATH)
if(ARAVIS_INCLUDE AND ARAVIS_LIBRARY)
set(HAVE_ARAVIS_API TRUE)
file(STRINGS "${ARAVIS_INCLUDE}/arvversion.h" ver_strings REGEX "#define +ARAVIS_(MAJOR|MINOR|MICRO)_VERSION.*")
string(REGEX REPLACE ".*ARAVIS_MAJOR_VERSION[^0-9]+([0-9]+).*" "\\1" ver_major "${ver_strings}")
string(REGEX REPLACE ".*ARAVIS_MINOR_VERSION[^0-9]+([0-9]+).*" "\\1" ver_minor "${ver_strings}")
string(REGEX REPLACE ".*ARAVIS_MICRO_VERSION[^0-9]+([0-9]+).*" "\\1" ver_micro "${ver_strings}")
set(ARAVIS_VERSION "${ver_major}.${ver_minor}.${ver_micro}" PARENT_SCOPE) # informational
set(ARAVIS_INCLUDE_DIRS "${ARAVIS_INCLUDE}")
set(ARAVIS_LIBRARIES "${ARAVIS_LIBRARY}")
endif()
endif()
if(HAVE_ARAVIS_API)
ocv_add_external_target(aravis "${ARAVIS_INCLUDE_DIRS}" "${ARAVIS_LIBRARIES}" "HAVE_ARAVIS_API")
endif()
set(HAVE_ARAVIS_API ${HAVE_ARAVIS_API} PARENT_SCOPE)
if(APPLE)
set(HAVE_AVFOUNDATION TRUE)
if(IOS)
set(libs "-framework AVFoundation" "-framework QuartzCore")
else()
set(libs
"-framework Cocoa"
"-framework Accelerate"
"-framework AVFoundation"
"-framework CoreGraphics"
"-framework CoreMedia"
"-framework CoreVideo"
"-framework QuartzCore")
endif()
ocv_add_external_target(avfoundation "" "${libs}" "HAVE_AVFOUNDATION")
endif()
set(HAVE_AVFOUNDATION ${HAVE_AVFOUNDATION} PARENT_SCOPE)
# --- Dc1394 ---
if(NOT HAVE_DC1394_2 AND PKG_CONFIG_FOUND)
pkg_check_modules(DC1394_2 libdc1394-2 QUIET)
if(DC1394_2_FOUND)
set(DC1394_2_VERSION "${DC1394_2_VERSION}" PARENT_SCOPE) # informational
set(HAVE_DC1394_2 TRUE)
endif()
endif()
if(NOT HAVE_DC1394_2)
find_path(DC1394_INCLUDE "dc1394/dc1394.h"
PATHS "${DC1394_ROOT}" ENV DC1394_ROOT
PATH_SUFFIXES "include"
NO_DEFAULT_PATH)
find_library(DC1394_LIBRARY "dc1394"
PATHS "${DC1394_ROOT}" ENV DC1394_ROOT
PATH_SUFFIXES "lib"
NO_DEFAULT_PATH)
if(DC1394_INCLUDE AND DC1394_LIBRARY)
set(HAVE_DC1394_2 TRUE)
set(DC1394_2_INCLUDE_DIRS "${DC1394_INCLUDE}")
set(DC1394_2_LIBRARIES "${DC1394_LIBRARY}")
set(DC1394_2_VERSION "unknown" PARENT_SCOPE) # informational
endif()
endif()
if(HAVE_DC1394_2)
ocv_add_external_target(dc1394_2 "${DC1394_2_INCLUDE_DIRS}" "${DC1394_2_LIBRARIES}" "HAVE_DC1394_2")
endif()
set(HAVE_DC1394_2 ${HAVE_DC1394_2} PARENT_SCOPE)
# --- VideoInput/DirectShow ---
if(NOT HAVE_DSHOW AND MSVC AND NOT MSVC_VERSION LESS 1500)
set(HAVE_DSHOW TRUE)
endif()
if(NOT HAVE_DSHOW)
check_include_file(dshow.h HAVE_DSHOW)
endif()
if(HAVE_DSHOW)
ocv_add_external_target(dshow "" "" "HAVE_DSHOW")
endif()
set(HAVE_DSHOW ${HAVE_DSHOW} PARENT_SCOPE)
# --- FFMPEG ---
if(NOT HAVE_FFMPEG AND OPENCV_FFMPEG_USE_FIND_PACKAGE)
if(OPENCV_FFMPEG_USE_FIND_PACKAGE STREQUAL "1" OR OPENCV_FFMPEG_USE_FIND_PACKAGE STREQUAL "ON")
set(OPENCV_FFMPEG_USE_FIND_PACKAGE "FFMPEG")
endif()
find_package(${OPENCV_FFMPEG_USE_FIND_PACKAGE}) # Required components: AVCODEC AVFORMAT AVUTIL SWSCALE
if(FFMPEG_FOUND OR FFmpeg_FOUND)
set(HAVE_FFMPEG TRUE)
endif()
endif()
if(NOT HAVE_FFMPEG AND WIN32 AND NOT ARM AND NOT OPENCV_FFMPEG_SKIP_DOWNLOAD)
include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg.cmake")
download_win_ffmpeg(FFMPEG_CMAKE_SCRIPT)
if(FFMPEG_CMAKE_SCRIPT)
include("${FFMPEG_CMAKE_SCRIPT}")
set(FFMPEG_libavcodec_VERSION ${FFMPEG_libavcodec_VERSION} PARENT_SCOPE) # info
set(FFMPEG_libavformat_VERSION ${FFMPEG_libavformat_VERSION} PARENT_SCOPE) # info
set(FFMPEG_libavutil_VERSION ${FFMPEG_libavutil_VERSION} PARENT_SCOPE) # info
set(FFMPEG_libswscale_VERSION ${FFMPEG_libswscale_VERSION} PARENT_SCOPE) # info
set(FFMPEG_libavresample_VERSION ${FFMPEG_libavresample_VERSION} PARENT_SCOPE) # info
set(HAVE_FFMPEG TRUE)
set(HAVE_FFMPEG_WRAPPER TRUE)
endif()
endif()
if(NOT HAVE_FFMPEG AND PKG_CONFIG_FOUND)
pkg_check_modules(FFMPEG libavcodec libavformat libavutil libswscale QUIET)
pkg_check_modules(FFMPEG_libavresample libavresample QUIET) # optional
if(FFMPEG_FOUND)
if(FFMPEG_libavresample_FOUND)
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_libavresample_LIBRARIES})
endif()
set(HAVE_FFMPEG TRUE)
endif()
endif()
#==================================
if(HAVE_FFMPEG AND NOT HAVE_FFMPEG_WRAPPER)
try_compile(__VALID_FFMPEG
"${OpenCV_BINARY_DIR}"
"${OpenCV_SOURCE_DIR}/cmake/checks/ffmpeg_test.cpp"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${FFMPEG_INCLUDE_DIRS}"
"-DLINK_DIRECTORIES:STRING=${FFMPEG_LIBRARY_DIRS}"
"-DLINK_LIBRARIES:STRING=${FFMPEG_LIBRARIES}"
OUTPUT_VARIABLE TRY_OUT
)
if(NOT __VALID_FFMPEG)
# message(FATAL_ERROR "FFMPEG: test check build log:\n${TRY_OUT}")
message(STATUS "WARNING: Can't build ffmpeg test code")
set(HAVE_FFMPEG FALSE)
endif()
endif()
#==================================
if(HAVE_FFMPEG)
set(defs "HAVE_FFMPEG")
if(HAVE_FFMPEG_WRAPPER)
list(APPEND defs "HAVE_FFMPEG_WRAPPER")
endif()
ocv_add_external_target(ffmpeg "${FFMPEG_INCLUDE_DIRS}" "${FFMPEG_LIBRARIES}" "${defs}")
endif()
set(HAVE_FFMPEG ${HAVE_FFMPEG} PARENT_SCOPE)
# --- gPhoto2 ---
if(NOT HAVE_GPHOTO2 AND PKG_CONFIG_FOUND)
pkg_check_modules(GPHOTO2 libgphoto2 QUIET)
if(GPHOTO2_FOUND)
set(HAVE_GPHOTO2 TRUE)
endif()
endif()
if(HAVE_GPHOTO2)
ocv_add_external_target(gphoto2 "${GPHOTO2_INCLUDE_DIRS}" "${GPHOTO2_LIBRARIES}" "HAVE_GPHOTO2")
endif()
set(HAVE_GPHOTO2 ${HAVE_GPHOTO2} PARENT_SCOPE)
# --- GStreamer ---
if(NOT HAVE_GSTREAMER AND WIN32)
set(env_paths "${GSTREAMER_DIR}" ENV GSTREAMER_ROOT)
if(X86_64)
list(APPEND env_paths ENV GSTREAMER_1_0_ROOT_X86_64 ENV GSTREAMER_ROOT_X86_64)
else()
list(APPEND env_paths ENV GSTREAMER_1_0_ROOT_X86 ENV GSTREAMER_ROOT_X86)
endif()
find_path(GSTREAMER_gst_INCLUDE_DIR
gst/gst.h
PATHS ${env_paths}
PATH_SUFFIXES "include/gstreamer-1.0")
find_path(GSTREAMER_glib_INCLUDE_DIR
glib.h
PATHS ${env_paths}
PATH_SUFFIXES "include/glib-2.0")
find_path(GSTREAMER_glibconfig_INCLUDE_DIR
glibconfig.h
PATHS ${env_paths}
PATH_SUFFIXES "lib/glib-2.0/include")
find_library(GSTREAMER_gstreamer_LIBRARY
NAMES gstreamer gstreamer-1.0
PATHS ${env_paths}
PATH_SUFFIXES "lib")
find_library(GSTREAMER_app_LIBRARY
NAMES gstapp gstapp-1.0
PATHS ${env_paths}
PATH_SUFFIXES "lib")
find_library(GSTREAMER_base_LIBRARY
NAMES gstbase gstbase-1.0
PATHS ${env_paths}
PATH_SUFFIXES "lib")
find_library(GSTREAMER_pbutils_LIBRARY
NAMES gstpbutils gstpbutils-1.0
PATHS ${env_paths}
PATH_SUFFIXES "lib")
find_library(GSTREAMER_riff_LIBRARY
NAMES gstriff gstriff-1.0
PATHS ${env_paths}
PATH_SUFFIXES "lib")
find_library(GSTREAMER_glib_LIBRARY
NAMES glib-2.0
PATHS ${env_paths}
PATH_SUFFIXES "lib")
find_library(GSTREAMER_gobject_LIBRARY
NAMES gobject-2.0
PATHS ${env_paths}
PATH_SUFFIXES "lib")
if(GSTREAMER_gst_INCLUDE_DIR
AND GSTREAMER_glib_INCLUDE_DIR
AND GSTREAMER_glibconfig_INCLUDE_DIR
AND GSTREAMER_gstreamer_LIBRARY
AND GSTREAMER_app_LIBRARY
AND GSTREAMER_base_LIBRARY
AND GSTREAMER_pbutils_LIBRARY
AND GSTREAMER_riff_LIBRARY
AND GSTREAMER_glib_LIBRARY
AND GSTREAMER_gobject_LIBRARY)
file(STRINGS "${GSTREAMER_gst_INCLUDE_DIR}/gst/gstversion.h" ver_strings REGEX "#define +GST_VERSION_(MAJOR|MINOR|MICRO|NANO).*")
string(REGEX REPLACE ".*GST_VERSION_MAJOR[^0-9]+([0-9]+).*" "\\1" ver_major "${ver_strings}")
string(REGEX REPLACE ".*GST_VERSION_MINOR[^0-9]+([0-9]+).*" "\\1" ver_minor "${ver_strings}")
string(REGEX REPLACE ".*GST_VERSION_MICRO[^0-9]+([0-9]+).*" "\\1" ver_micro "${ver_strings}")
set(GSTREAMER_VERSION "${ver_major}.${ver_minor}.${ver_micro}" PARENT_SCOPE) # informational
set(HAVE_GSTREAMER TRUE)
set(GSTREAMER_LIBRARIES
${GSTREAMER_gstreamer_LIBRARY}
${GSTREAMER_base_LIBRARY}
${GSTREAMER_app_LIBRARY}
${GSTREAMER_riff_LIBRARY}
${GSTREAMER_pbutils_LIBRARY}
${GSTREAMER_glib_LIBRARY}
${GSTREAMER_gobject_LIBRARY})
set(GSTREAMER_INCLUDE_DIRS
${GSTREAMER_gst_INCLUDE_DIR}
${GSTREAMER_glib_INCLUDE_DIR}
${GSTREAMER_glibconfig_INCLUDE_DIR})
endif()
endif()
if(NOT HAVE_GSTREAMER AND PKG_CONFIG_FOUND)
pkg_check_modules(GSTREAMER_base gstreamer-base-1.0 QUIET)
pkg_check_modules(GSTREAMER_app gstreamer-app-1.0 QUIET)
pkg_check_modules(GSTREAMER_riff gstreamer-riff-1.0 QUIET)
pkg_check_modules(GSTREAMER_pbutils gstreamer-pbutils-1.0 QUIET)
if(GSTREAMER_base_FOUND AND GSTREAMER_app_FOUND AND GSTREAMER_riff_FOUND AND GSTREAMER_pbutils_FOUND)
set(HAVE_GSTREAMER TRUE)
set(GSTREAMER_VERSION ${GSTREAMER_base_VERSION} PARENT_SCOPE) # informational
set(GSTREAMER_LIBRARIES ${GSTREAMER_base_LIBRARIES} ${GSTREAMER_app_LIBRARIES} ${GSTREAMER_riff_LIBRARIES} ${GSTREAMER_pbutils_LIBRARIES})
set(GSTREAMER_INCLUDE_DIRS ${GSTREAMER_base_INCLUDE_DIRS} ${GSTREAMER_app_INCLUDE_DIRS} ${GSTREAMER_riff_INCLUDE_DIRS} ${GSTREAMER_pbutils_INCLUDE_DIRS})
endif()
endif()
if(HAVE_GSTREAMER)
ocv_add_external_target(gstreamer "${GSTREAMER_INCLUDE_DIRS}" "${GSTREAMER_LIBRARIES}" "HAVE_GSTREAMER")
endif()
set(HAVE_GSTREAMER ${HAVE_GSTREAMER} PARENT_SCOPE)
if(APPLE AND IOS)
set(HAVE_CAP_IOS TRUE)
set(libs
"-framework Accelerate"
"-framework AVFoundation"
"-framework CoreGraphics"
"-framework CoreImage"
"-framework CoreMedia"
"-framework CoreVideo"
"-framework QuartzCore"
"-framework UIKit")
ocv_add_external_target(cap_ios "" "${libs}" "HAVE_CAP_IOS")
endif()
set(HAVE_CAP_IOS ${HAVE_CAP_IOS} PARENT_SCOPE)
if(NOT HAVE_MFX)
set(paths "${MFX_HOME}" ENV "MFX_HOME" ENV "INTELMEDIASDKROOT")
if(MSVC)
if(MSVC_VERSION LESS 1900)
set(vs_suffix)
else()
set(vs_suffix "_vs2015")
endif()
if(X86_64)
set(vs_arch "x64")
else()
set(vs_arch "win32")
endif()
endif()
find_path(MFX_INCLUDE mfxdefs.h
PATHS ${paths}
PATH_SUFFIXES "include"
NO_DEFAULT_PATH)
find_library(MFX_LIBRARY mfx libmfx${vs_suffix}
PATHS ${paths}
PATH_SUFFIXES "lib64" "lib/lin_x64" "lib/${vs_arch}"
NO_DEFAULT_PATH)
if(MFX_INCLUDE AND MFX_LIBRARY)
set(HAVE_MFX TRUE)
set(MFX_INCLUDE_DIRS "${MFX_INCLUDE}")
set(MFX_LIBRARIES "${MFX_LIBRARY}")
endif()
endif()
if(HAVE_MFX AND UNIX)
find_path(MFX_va_INCLUDE va/va.h PATHS ${paths} PATH_SUFFIXES "include")
find_library(MFX_va_LIBRARY va PATHS ${paths} PATH_SUFFIXES "lib64" "lib/lin_x64")
find_library(MFX_va_drm_LIBRARY va-drm PATHS ${paths} PATH_SUFFIXES "lib64" "lib/lin_x64")
if(MFX_va_INCLUDE AND MFX_va_LIBRARY AND MFX_va_drm_LIBRARY)
list(APPEND MFX_INCLUDE_DIRS "${MFX_va_INCLUDE}")
list(APPEND MFX_LIBRARIES "${MFX_va_LIBRARY}" "${MFX_va_drm_LIBRARY}")
# list(APPEND MFX_LIBRARIES "-Wl,--exclude-libs=libmfx")
else()
set(HAVE_MFX FALSE)
endif()
endif()
if(HAVE_MFX)
ocv_add_external_target(mediasdk "${MFX_INCLUDE_DIRS}" "${MFX_LIBRARIES}" "HAVE_MFX")
endif()
set(HAVE_MFX ${HAVE_MFX} PARENT_SCOPE)
# --- VideoInput/Microsoft Media Foundation ---
if(NOT HAVE_MSMF)
check_include_file(mfapi.h HAVE_MFAPI)
if(HAVE_MFAPI)
set(HAVE_MSMF TRUE)
endif()
endif()
if(HAVE_MSMF)
if(WITH_MSMF_DXVA)
check_include_file(d3d11.h HAVE_D3D11)
check_include_file(d3d11_4.h HAVE_D3D11_4)
if(HAVE_D3D11 AND HAVE_D3D11_4)
set(HAVE_MSMF_DXVA TRUE)
endif()
endif()
set(defs "HAVE_MSMF")
if(HAVE_MSMF_DXVA)
list(APPEND defs "HAVE_MSMF_DXVA")
endif()
ocv_add_external_target(msmf "" "" "${defs}")
endif()
set(HAVE_MSMF ${HAVE_MSMF} PARENT_SCOPE)
set(HAVE_MSMF_DXVA ${HAVE_MSMF_DXVA} PARENT_SCOPE)
# --- OpenNI2 ---
if(NOT HAVE_OPENNI2)
set(paths "${OPENNI2_DIR}")
if(MSVC AND X86_64)
list(APPEND paths ENV OPENNI2_INCLUDE64 ENV OPENNI2_LIB64 ENV OPENNI2_REDIST64)
else()
list(APPEND paths ENV OPENNI2_INCLUDE ENV OPENNI2_LIB ENV OPENNI2_REDIST)
endif()
# From SDK
find_path(OPENNI2_INCLUDE "OpenNI.h"
PATHS ${paths}
PATH_SUFFIXES "Include"
NO_DEFAULT_PATH)
find_library(OPENNI2_LIBRARY "OpenNI2"
PATHS ${paths}
PATH_SUFFIXES "Redist" "Lib"
NO_DEFAULT_PATH)
if(OPENNI2_LIBRARY AND OPENNI2_INCLUDE)
set(HAVE_OPENNI2 TRUE)
set(OPENNI2_INCLUDE_DIRS "${OPENNI2_INCLUDE}")
set(OPENNI2_LIBRARIES "${OPENNI2_LIBRARY}")
endif()
endif()
if(NOT HAVE_OPENNI2)
# From system
find_path(OPENNI2_SYS_INCLUDE "OpenNI.h" PATH_SUFFIXES "openni2" "ni2")
find_library(OPENNI2_SYS_LIBRARY "OpenNI2")
if(OPENNI2_SYS_LIBRARY AND OPENNI2_SYS_INCLUDE)
set(HAVE_OPENNI2 TRUE)
set(OPENNI2_INCLUDE_DIRS "${OPENNI2_SYS_INCLUDE}")
set(OPENNI2_LIBRARIES "${OPENNI2_SYS_LIBRARY}")
endif()
endif()
if(HAVE_OPENNI2)
file(STRINGS "${OPENNI2_INCLUDE_DIRS}/OniVersion.h" ver_strings REGEX "#define +ONI_VERSION_(MAJOR|MINOR|MAINTENANCE|BUILD).*")
string(REGEX REPLACE ".*ONI_VERSION_MAJOR[^0-9]+([0-9]+).*" "\\1" ver_major "${ver_strings}")
string(REGEX REPLACE ".*ONI_VERSION_MINOR[^0-9]+([0-9]+).*" "\\1" ver_minor "${ver_strings}")
string(REGEX REPLACE ".*ONI_VERSION_MAINTENANCE[^0-9]+([0-9]+).*" "\\1" ver_maint "${ver_strings}")
set(OPENNI2_VERSION "${ver_major}.${ver_minor}.${ver_maint}" PARENT_SCOPE) # informational
ocv_add_external_target(openni2 "${OPENNI2_INCLUDE_DIRS}" "${OPENNI2_LIBRARIES}" "HAVE_OPENNI2")
endif()
set(HAVE_OPENNI2 ${HAVE_OPENNI2} PARENT_SCOPE)
# --- PvApi ---
if(NOT HAVE_PVAPI)
if(X86_64)
set(arch x64)
else()
set(arch x86)
endif()
find_path(PVAPI_INCLUDE "PvApi.h"
PATHS "${PVAPI_ROOT}" ENV PVAPI_ROOT
PATH_SUFFIXES "inc-pc")
find_library(PVAPI_LIBRARY "PvAPI"
PATHS "${PVAPI_ROOT}" ENV PVAPI_ROOT
PATH_SUFFIXES "bin-pc/${arch}/${gcc}")
if(PVAPI_INCLUDE AND PVAPI_LIBRARY)
set(HAVE_PVAPI TRUE)
endif()
endif()
if(HAVE_PVAPI)
ocv_add_external_target(pvapi "${PVAPI_INCLUDE}" "${PVAPI_LIBRARY}" "HAVE_PVAPI")
endif()
set(HAVE_PVAPI ${HAVE_PVAPI} PARENT_SCOPE)
# --- Intel librealsense ---
if(NOT HAVE_LIBREALSENSE)
find_package(realsense2 QUIET)
if(realsense2_FOUND)
set(HAVE_LIBREALSENSE TRUE)
set(LIBREALSENSE_VERSION "${realsense2_VERSION}" PARENT_SCOPE) # informational
ocv_add_external_target(librealsense "" "${realsense2_LIBRARY}" "HAVE_LIBREALSENSE")
endif()
endif()
if(NOT HAVE_LIBREALSENSE)
find_path(LIBREALSENSE_INCLUDE_DIR "librealsense2/rs.hpp"
PATHS "${LIBREALSENSE_INCLUDE}" ENV LIBREALSENSE_INCLUDE)
find_library(LIBREALSENSE_LIBRARIES "realsense2"
PATHS "${LIBREALSENSE_LIB}" ENV LIBREALSENSE_LIB)
if(LIBREALSENSE_INCLUDE_DIR AND LIBREALSENSE_LIBRARIES)
set(HAVE_LIBREALSENSE TRUE)
file(STRINGS "${LIBREALSENSE_INCLUDE_DIR}/librealsense2/rs.h" ver_strings REGEX "#define +RS2_API_(MAJOR|MINOR|PATCH|BUILD)_VERSION.*")
string(REGEX REPLACE ".*RS2_API_MAJOR_VERSION[^0-9]+([0-9]+).*" "\\1" ver_major "${ver_strings}")
string(REGEX REPLACE ".*RS2_API_MINOR_VERSION[^0-9]+([0-9]+).*" "\\1" ver_minor "${ver_strings}")
string(REGEX REPLACE ".*RS2_API_PATCH_VERSION[^0-9]+([0-9]+).*" "\\1" ver_patch "${ver_strings}")
set(LIBREALSENSE_VERSION "${ver_major}.${ver_minor}.${ver_patch}" PARENT_SCOPE) # informational
ocv_add_external_target(librealsense "${LIBREALSENSE_INCLUDE_DIR}" "${LIBREALSENSE_LIBRARIES}" "HAVE_LIBREALSENSE")
endif()
endif()
set(HAVE_LIBREALSENSE ${HAVE_LIBREALSENSE} PARENT_SCOPE)
# --- V4L ---
if(NOT HAVE_V4L)
set(CMAKE_REQUIRED_QUIET TRUE) # for check_include_file
check_include_file(linux/videodev2.h HAVE_CAMV4L2)
check_include_file(sys/videoio.h HAVE_VIDEOIO)
if(HAVE_CAMV4L2 OR HAVE_VIDEOIO)
set(HAVE_V4L TRUE)
set(defs)
if(HAVE_CAMV4L2)
list(APPEND defs "HAVE_CAMV4L2")
endif()
if(HAVE_VIDEOIO)
list(APPEND defs "HAVE_VIDEOIO")
endif()
ocv_add_external_target(v4l "" "" "${defs}")
endif()
endif()
set(HAVE_V4L ${HAVE_V4L} PARENT_SCOPE)
if(NOT HAVE_XIMEA)
if(WIN32)
get_filename_component(regpath "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE)
endif()
if(X86_64)
set(lib_dir "x64")
set(lib_suffix "64")
else()
set(lib_dir "x86")
set(lib_suffix "32")
endif()
find_path(XIMEA_INCLUDE "xiApi.h"
PATHS "${XIMEA_ROOT}" ENV XIMEA_ROOT "/opt/XIMEA"
HINTS "${regpath}"
PATH_SUFFIXES "include" "API")
find_library(XIMEA_LIBRARY m3api xiapi${lib_suffix}
PATHS "${XIMEA_ROOT}" ENV XIMEA_ROOT "/opt/XIMEA"
HINTS "${regpath}"
PATH_SUFFIXES "API/${lib_dir}")
if(XIMEA_INCLUDE AND XIMEA_LIBRARY)
set(HAVE_XIMEA TRUE)
endif()
endif()
if(HAVE_XIMEA)
ocv_add_external_target(ximea "${XIMEA_INCLUDE}" "${XIMEA_LIBRARY}" "HAVE_XIMEA")
endif()
set(HAVE_XIMEA ${HAVE_XIMEA} PARENT_SCOPE)
if(NOT HAVE_XINE AND PKG_CONFIG_FOUND)
pkg_check_modules(XINE libxine QUIET)
if(XINE_FOUND)
set(HAVE_XINE TRUE)
endif()
endif()
if(HAVE_XINE)
ocv_add_external_target(xine "${XINE_INCLUDE_DIRS}" "${XINE_LIBRARIES}" "HAVE_XINE")
endif()
set(HAVE_XINE ${HAVE_XINE} PARENT_SCOPE)
macro(add_backend backend_id cond_var)
if(${cond_var})
include("${CMAKE_CURRENT_LIST_DIR}/detect_${backend_id}.cmake")
endif()
endmacro()
function(ocv_add_external_target name inc link def)
if(BUILD_SHARED_LIBS)
set(imp IMPORTED)
endif()
add_library(ocv.3rdparty.${name} INTERFACE ${imp})
set_target_properties(ocv.3rdparty.${name} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${inc}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${inc}"
INTERFACE_LINK_LIBRARIES "${link}"
INTERFACE_COMPILE_DEFINITIONS "${def}")
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ocv.3rdparty.${name} EXPORT OpenCVModules)
endif()
endfunction()
add_backend("ffmpeg" WITH_FFMPEG)
add_backend("gstreamer" WITH_GSTREAMER)
add_backend("v4l" WITH_V4L)
add_backend("aravis" WITH_ARAVIS)
add_backend("dc1394" WITH_1394)
add_backend("gphoto" WITH_GPHOTO2)
add_backend("msdk" WITH_MFX)
add_backend("openni2" WITH_OPENNI2)
add_backend("pvapi" WITH_PVAPI)
add_backend("realsense" WITH_LIBREALSENSE)
add_backend("ximea" WITH_XIMEA)
add_backend("xine" WITH_XINE)
add_backend("avfoundation" WITH_AVFOUNDATION)
add_backend("ios" WITH_CAP_IOS)
add_backend("dshow" WITH_DSHOW)
add_backend("msmf" WITH_MSMF)
......@@ -108,7 +108,8 @@ enum VideoCaptureAPIs {
CAP_GIGANETIX = 1300, //!< Smartek Giganetix GigEVisionSDK
CAP_MSMF = 1400, //!< Microsoft Media Foundation (via videoInput)
CAP_WINRT = 1410, //!< Microsoft Windows Runtime using Media Foundation
CAP_INTELPERC = 1500, //!< Intel Perceptual Computing SDK
CAP_INTELPERC = 1500, //!< RealSense (former Intel Perceptual Computing SDK)
CAP_REALSENSE = 1500, //!< Synonym for CAP_INTELPERC
CAP_OPENNI2 = 1600, //!< OpenNI2 (for Kinect)
CAP_OPENNI2_ASUS = 1610, //!< OpenNI2 (for Asus Xtion and Occipital Structure sensors)
CAP_GPHOTO2 = 1700, //!< gPhoto2 connection
......
......@@ -3,8 +3,6 @@
// of this distribution and at http://opencv.org/license.html
#include "perf_precomp.hpp"
#ifdef HAVE_VIDEO_INPUT
namespace opencv_test
{
using namespace perf;
......@@ -35,5 +33,3 @@ PERF_TEST_P(VideoCapture_Reading, ReadFile, testing::ValuesIn(bunny_files) )
}
} // namespace
#endif // HAVE_VIDEO_INPUT
......@@ -3,8 +3,6 @@
// of this distribution and at http://opencv.org/license.html
#include "perf_precomp.hpp"
#ifdef HAVE_VIDEO_OUTPUT
namespace opencv_test
{
using namespace perf;
......@@ -38,11 +36,12 @@ PERF_TEST_P(VideoWriter_Writing, WriteFrame,
#endif
VideoWriter writer(outfile, fourcc, 25, cv::Size(image.cols, image.rows), isColor);
if (!writer.isOpened())
throw SkipTestException("Video file can not be opened");
TEST_CYCLE_N(100) { writer << image; }
SANITY_CHECK_NOTHING();
remove(outfile.c_str());
}
} // namespace
#endif // HAVE_VIDEO_OUTPUT
......@@ -29,13 +29,15 @@
*
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#include "precomp.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#import <AVFoundation/AVFoundation.h>
#import <Foundation/NSException.h>
/********************** Declaration of class headers ************************/
/*****************************************************************************
......@@ -1330,3 +1332,5 @@ bool CvVideoWriter_AVFoundation::writeFrame(const IplImage* iplimage) {
}
}
#pragma clang diagnostic pop
......@@ -39,6 +39,8 @@
//
//M*////////////////////////////////////////////////////////////////////////////////////////
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#include "precomp.hpp"
#include "opencv2/imgproc.hpp"
......@@ -1333,3 +1335,5 @@ bool CvVideoWriter_AVFoundation::writeFrame(const IplImage* iplimage) {
}
}
#pragma clang diagnostic pop
This diff is collapsed.
......@@ -96,6 +96,7 @@ Thanks to:
#ifdef __MINGW32__
// MinGW does not understand COM interfaces
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#define STRSAFE_NO_DEPRECATE
#endif
#include <tchar.h>
......@@ -108,9 +109,9 @@ Thanks to:
#include <vector>
//Include Directshow stuff here so we don't worry about needing all the h files.
#include "DShow.h"
#include "dshow.h"
#include "strmif.h"
#include "Aviriff.h"
#include "aviriff.h"
#include "dvdmedia.h"
#include "bdaiface.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2014, Itseez, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
//M*/
#ifndef _CAP_INTELPERC_HPP_
#define _CAP_INTELPERC_HPP_
#include "precomp.hpp"
#ifdef HAVE_INTELPERC
#include "pxcsession.h"
#include "pxcsmartptr.h"
#include "pxccapture.h"
namespace cv
{
class IntelPerCStreamBase
{
public:
IntelPerCStreamBase();
virtual ~IntelPerCStreamBase();
bool isValid();
bool grabFrame();
int getProfileIDX() const;
public:
virtual bool initStream(PXCSession *session) = 0;
virtual double getProperty(int propIdx) const;
virtual bool setProperty(int propIdx, double propVal);
protected:
mutable PXCSmartPtr<PXCCapture::Device> m_device;
bool initDevice(PXCSession *session);
PXCSmartPtr<PXCCapture::VideoStream> m_stream;
void initStreamImpl(PXCImage::ImageType type);
protected:
std::vector<PXCCapture::VideoStream::ProfileInfo> m_profiles;
int m_profileIdx;
int m_frameIdx;
pxcU64 m_timeStampStartNS;
double m_timeStamp;
PXCSmartPtr<PXCImage> m_pxcImage;
virtual bool validProfile(const PXCCapture::VideoStream::ProfileInfo& /*pinfo*/);
void enumProfiles();
};
class IntelPerCStreamImage
: public IntelPerCStreamBase
{
public:
IntelPerCStreamImage();
virtual ~IntelPerCStreamImage();
virtual bool initStream(PXCSession *session);
virtual double getProperty(int propIdx) const;
virtual bool setProperty(int propIdx, double propVal);
public:
bool retrieveAsOutputArray(OutputArray image);
};
class IntelPerCStreamDepth
: public IntelPerCStreamBase
{
public:
IntelPerCStreamDepth();
virtual ~IntelPerCStreamDepth();
virtual bool initStream(PXCSession *session);
virtual double getProperty(int propIdx) const;
virtual bool setProperty(int propIdx, double propVal);
public:
bool retrieveDepthAsOutputArray(OutputArray image);
bool retrieveIRAsOutputArray(OutputArray image);
bool retrieveUVAsOutputArray(OutputArray image);
protected:
virtual bool validProfile(const PXCCapture::VideoStream::ProfileInfo& pinfo);
protected:
bool retriveFrame(int type, int planeIdx, OutputArray frame);
};
class VideoCapture_IntelPerC : public IVideoCapture
{
public:
VideoCapture_IntelPerC();
virtual ~VideoCapture_IntelPerC();
virtual double getProperty(int propIdx) const CV_OVERRIDE;
virtual bool setProperty(int propIdx, double propVal) CV_OVERRIDE;
virtual bool grabFrame() CV_OVERRIDE;
virtual bool retrieveFrame(int outputType, OutputArray frame) CV_OVERRIDE;
virtual int getCaptureDomain() CV_OVERRIDE;
virtual bool isOpened() const CV_OVERRIDE;
protected:
bool m_contextOpened;
PXCSmartPtr<PXCSession> m_session;
IntelPerCStreamImage m_imageStream;
IntelPerCStreamDepth m_depthStream;
};
}
#endif //HAVE_INTELPERC
#endif //_CAP_INTELPERC_HPP_
\ No newline at end of file
......@@ -52,6 +52,7 @@
#undef WINVER
#define WINVER _WIN32_WINNT_WIN8
#endif
#include <windows.h>
#include <guiddef.h>
#include <mfidl.h>
......@@ -60,7 +61,7 @@
#include <mfobjects.h>
#include <tchar.h>
#include <strsafe.h>
#include <Mfreadwrite.h>
#include <mfreadwrite.h>
#ifdef HAVE_MSMF_DXVA
#include <d3d11.h>
#include <d3d11_4.h>
......
This diff is collapsed.
......@@ -8,7 +8,6 @@
#include "opencv2/videoio/registry.hpp"
#include "cap_intelperc.hpp"
#include "cap_librealsense.hpp"
#include "cap_dshow.hpp"
......@@ -45,7 +44,7 @@ namespace {
/** Ordering guidelines:
- modern optimized, multi-platform libraries: ffmpeg, gstreamer, Media SDK
- platform specific universal SDK: WINRT, AVFOUNDATION, MSMF/DSHOW, V4L/V4L2
- RGB-D: OpenNI/OpenNI2, INTELPERC/REALSENSE
- RGB-D: OpenNI/OpenNI2, REALSENSE
- special OpenCV (file-based): "images", "mjpeg"
- special camera SDKs, including stereo: other special SDKs: FIREWIRE/1394, XIMEA/ARAVIS/GIGANETIX/PVAPI(GigE)
- other: XINE, gphoto2, etc
......@@ -88,16 +87,12 @@ static const struct VideoBackendInfo builtin_backends[] =
// RGB-D universal
#ifdef HAVE_OPENNI
DECLARE_BACKEND(CAP_OPENNI, "OPENNI", MODE_CAPTURE_ALL),
#endif
#ifdef HAVE_OPENNI2
DECLARE_BACKEND(CAP_OPENNI2, "OPENNI2", MODE_CAPTURE_ALL),
#endif
#ifdef HAVE_INTELPERC
DECLARE_BACKEND(CAP_INTELPERC, "INTEL_PERC", MODE_CAPTURE_BY_INDEX),
#elif defined(HAVE_LIBREALSENSE)
DECLARE_BACKEND(CAP_INTELPERC, "INTEL_REALSENSE", MODE_CAPTURE_BY_INDEX),
#ifdef HAVE_LIBREALSENSE
DECLARE_BACKEND(CAP_REALSENSE, "INTEL_REALSENSE", MODE_CAPTURE_BY_INDEX),
#endif
// OpenCV file-based only
......@@ -115,9 +110,6 @@ static const struct VideoBackendInfo builtin_backends[] =
#ifdef HAVE_XIMEA
DECLARE_BACKEND(CAP_XIAPI, "XIMEA", MODE_CAPTURE_ALL),
#endif
#ifdef HAVE_GIGE_API
DECLARE_BACKEND(CAP_GIGANETIX, "GIGANETIX", MODE_CAPTURE_BY_INDEX),
#endif
#ifdef HAVE_ARAVIS_API
DECLARE_BACKEND(CAP_ARAVIS, "ARAVIS", MODE_CAPTURE_BY_INDEX),
#endif
......@@ -415,12 +407,8 @@ void VideoCapture_create(CvCapture*& capture, Ptr<IVideoCapture>& icap, VideoCap
TRY_OPEN(makePtr<VideoCapture_DShow>(index));
break;
#endif
#ifdef HAVE_INTELPERC
case CAP_INTELPERC:
TRY_OPEN(makePtr<VideoCapture_IntelPerC>());
break;
#elif defined(HAVE_LIBREALSENSE)
case CAP_INTELPERC:
#ifdef HAVE_LIBREALSENSE
case CAP_REALSENSE:
TRY_OPEN(makePtr<VideoCapture_LibRealsense>(index));
break;
#endif
......@@ -454,11 +442,6 @@ void VideoCapture_create(CvCapture*& capture, Ptr<IVideoCapture>& icap, VideoCap
TRY_OPEN_LEGACY(cvCreateCameraCapture_PvAPI(index))
break;
#endif
#ifdef HAVE_OPENNI
case CAP_OPENNI:
TRY_OPEN_LEGACY(cvCreateCameraCapture_OpenNI(index))
break;
#endif
#ifdef HAVE_OPENNI2
case CAP_OPENNI2:
TRY_OPEN_LEGACY(cvCreateCameraCapture_OpenNI2(index))
......@@ -476,12 +459,6 @@ void VideoCapture_create(CvCapture*& capture, Ptr<IVideoCapture>& icap, VideoCap
break;
#endif
#ifdef HAVE_GIGE_API
case CAP_GIGANETIX:
TRY_OPEN_LEGACY(cvCreateCameraCapture_Giganetix(index))
break;
#endif
#ifdef HAVE_ARAVIS_API
case CAP_ARAVIS:
TRY_OPEN_LEGACY(cvCreateCameraCapture_Aravis(index))
......@@ -510,12 +487,6 @@ void VideoCapture_create(CvCapture*& capture, Ptr<IVideoCapture>& icap, VideoCap
break;
#endif
#ifdef HAVE_OPENNI
case CAP_OPENNI:
TRY_OPEN_LEGACY(cvCreateFileCapture_OpenNI(filename.c_str()))
break;
#endif
#ifdef HAVE_OPENNI2
case CAP_OPENNI2:
TRY_OPEN_LEGACY(cvCreateFileCapture_OpenNI2(filename.c_str()))
......
......@@ -303,10 +303,6 @@ public:
//==================================================================================================
static const VideoCaptureAPIs backend_params[] = {
#ifdef HAVE_QUICKTIME
CAP_QT,
#endif
// TODO: Broken?
//#ifdef HAVE_AVFOUNDATION
// CAP_AVFOUNDATION,
......@@ -333,7 +329,6 @@ static const VideoCaptureAPIs backend_params[] = {
};
static const string bunny_params[] = {
#ifdef HAVE_VIDEO_INPUT
string("wmv"),
string("mov"),
string("mp4"),
......@@ -341,7 +336,6 @@ static const string bunny_params[] = {
string("avi"),
string("h264"),
string("h265"),
#endif
string("mjpg.avi")
};
......@@ -384,18 +378,6 @@ static Ext_Fourcc_PSNR synthetic_params[] = {
makeParam("mov", "H264", 30.f, CAP_MSMF),
#endif
#ifdef HAVE_QUICKTIME
makeParam("mov", "mp4v", 30.f, CAP_QT),
makeParam("avi", "XVID", 30.f, CAP_QT),
makeParam("avi", "MPEG", 30.f, CAP_QT),
makeParam("avi", "IYUV", 30.f, CAP_QT),
makeParam("avi", "MJPG", 30.f, CAP_QT),
makeParam("mkv", "XVID", 30.f, CAP_QT),
makeParam("mkv", "MPEG", 30.f, CAP_QT),
makeParam("mkv", "MJPG", 30.f, CAP_QT),
#endif
// TODO: Broken?
//#ifdef HAVE_AVFOUNDATION
// makeParam("mov", "mp4v", 30.f, CAP_AVFOUNDATION),
......
......@@ -64,9 +64,6 @@ ocv_target_compile_definitions(${the_module} PRIVATE OPENCV_MODULE_IS_PART_OF_WO
if(BUILD_opencv_imgcodecs AND OPENCV_MODULE_opencv_imgcodecs_IS_PART_OF_WORLD)
ocv_imgcodecs_configure_target()
endif()
if(BUILD_opencv_videoio AND OPENCV_MODULE_opencv_videoio_IS_PART_OF_WORLD)
ocv_videoio_configure_target()
endif()
if(BUILD_opencv_highgui AND OPENCV_MODULE_opencv_highgui_IS_PART_OF_WORLD)
ocv_highgui_configure_target()
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment