Commit c78cb219 authored by Andrey Kamaev's avatar Andrey Kamaev Committed by OpenCV Buildbot

Merge pull request #346 from taka-no-me:decouple_V4L2

parents ab8d92e1 287fb2c6
...@@ -137,7 +137,7 @@ OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF ...@@ -137,7 +137,7 @@ OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 ) OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 )
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) ) 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_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_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON IF WIN32 ) 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_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_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
...@@ -725,11 +725,13 @@ if(DEFINED WITH_V4L) ...@@ -725,11 +725,13 @@ if(DEFINED WITH_V4L)
endif() endif()
if(HAVE_CAMV4L2) if(HAVE_CAMV4L2)
set(HAVE_CAMV4L2_STR "YES") set(HAVE_CAMV4L2_STR "YES")
elseif(HAVE_VIDEOIO)
set(HAVE_CAMV4L2_STR "YES(videoio)")
else() else()
set(HAVE_CAMV4L2_STR "NO") set(HAVE_CAMV4L2_STR "NO")
endif() endif()
status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})" status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})"
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}") ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
endif(DEFINED WITH_V4L) endif(DEFINED WITH_V4L)
if(DEFINED WITH_VIDEOINPUT) if(DEFINED WITH_VIDEOINPUT)
......
...@@ -85,11 +85,12 @@ if(WITH_XINE) ...@@ -85,11 +85,12 @@ if(WITH_XINE)
endif(WITH_XINE) endif(WITH_XINE)
# --- V4L --- # --- V4L ---
ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2) ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_VIDEOIO)
if(WITH_V4L) if(WITH_V4L)
CHECK_MODULE(libv4l1 HAVE_LIBV4L) CHECK_MODULE(libv4l1 HAVE_LIBV4L)
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L) CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L)
CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2) CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2)
CHECK_INCLUDE_FILE(sys/videoio.h HAVE_VIDEOIO)
endif(WITH_V4L) endif(WITH_V4L)
# --- OpenNI --- # --- OpenNI ---
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
/* V4L2 capturing support */ /* V4L2 capturing support */
#cmakedefine HAVE_CAMV4L2 #cmakedefine HAVE_CAMV4L2
/* V4L2 capturing support in videoio.h */
#cmakedefine HAVE_VIDEOIO
/* V4L/V4L2 capturing support via libv4l */ /* V4L/V4L2 capturing support via libv4l */
#cmakedefine HAVE_LIBV4L #cmakedefine HAVE_LIBV4L
......
...@@ -131,7 +131,7 @@ endif(HAVE_UNICAP) ...@@ -131,7 +131,7 @@ endif(HAVE_UNICAP)
if(HAVE_LIBV4L) if(HAVE_LIBV4L)
list(APPEND highgui_srcs src/cap_libv4l.cpp) list(APPEND highgui_srcs src/cap_libv4l.cpp)
elseif(HAVE_CAMV4L OR HAVE_CAMV4L2) elseif(HAVE_CAMV4L OR HAVE_CAMV4L2 OR HAVE_VIDEOIO)
list(APPEND highgui_srcs src/cap_v4l.cpp) list(APPEND highgui_srcs src/cap_v4l.cpp)
endif() endif()
......
...@@ -172,7 +172,9 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index) ...@@ -172,7 +172,9 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
defined(HAVE_TYZX) || \ defined(HAVE_TYZX) || \
defined(HAVE_VFW) || \ defined(HAVE_VFW) || \
defined(HAVE_LIBV4L) || \ defined(HAVE_LIBV4L) || \
(defined(HAVE_CAMV4L) && defined(HAVE_CAMV4L2)) || \ defined(HAVE_CAMV4L) || \
defined(HAVE_CAMV4L2) || \
defined(HAVE_VIDEOIO) || \
defined(HAVE_GSTREAMER) || \ defined(HAVE_GSTREAMER) || \
defined(HAVE_DC1394_2) || \ defined(HAVE_DC1394_2) || \
defined(HAVE_DC1394) || \ defined(HAVE_DC1394) || \
...@@ -216,7 +218,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index) ...@@ -216,7 +218,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
return capture; return capture;
#endif #endif
#if defined HAVE_LIBV4L || (defined (HAVE_CAMV4L) && defined (HAVE_CAMV4L2)) #if defined HAVE_LIBV4L || defined HAVE_CAMV4L || defined HAVE_CAMV4L2 || defined HAVE_VIDEOIO
capture = cvCreateCameraCapture_V4L (index); capture = cvCreateCameraCapture_V4L (index);
if (capture) if (capture)
return capture; return capture;
......
...@@ -346,7 +346,11 @@ static int numCameras = 0; ...@@ -346,7 +346,11 @@ static int numCameras = 0;
static int indexList = 0; static int indexList = 0;
// IOCTL handling for V4L2 // IOCTL handling for V4L2
#ifdef HAVE_IOCTL_ULONG
static int xioctl( int fd, unsigned long request, void *arg)
#else
static int xioctl( int fd, int request, void *arg) static int xioctl( int fd, int request, void *arg)
#endif
{ {
int r; int r;
......
This diff is collapsed.
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