NetBSD video(4) support, patch 1 of 3

The video(4) driver provides a Video4Linux2 compatible API for
various video peripherals. This patch propagates HAVE_VIDEOIO if
the sys/videoio.h include file is found, which is the signature of
video(4).
This commit is contained in:
Patrick Welche 2012-09-17 11:08:37 +02:00 committed by Andrey Kamaev
parent 8521ac5d21
commit d90b8d615c
6 changed files with 14 additions and 4 deletions

View File

@ -722,7 +722,7 @@ if(DEFINED WITH_V4L)
else() else()
set(HAVE_CAMV4L_STR "NO") set(HAVE_CAMV4L_STR "NO")
endif() endif()
if(HAVE_CAMV4L2) if(HAVE_CAMV4L2 OR HAVE_VIDEOIO)
set(HAVE_CAMV4L2_STR "YES") set(HAVE_CAMV4L2_STR "YES")
else() else()
set(HAVE_CAMV4L2_STR "NO") set(HAVE_CAMV4L2_STR "NO")

View File

@ -90,6 +90,7 @@ 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 ---

View File

@ -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

View File

@ -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()

View File

@ -173,6 +173,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
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 +217,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;

View File

@ -202,7 +202,7 @@ make & enjoy!
#include "precomp.hpp" #include "precomp.hpp"
#if !defined WIN32 && defined HAVE_CAMV4L && defined HAVE_CAMV4L2 #if !defined WIN32 && ((defined HAVE_CAMV4L && defined HAVE_CAMV4L2) || defined HAVE_VIDEOIO)
#define CLEAR(x) memset (&(x), 0, sizeof (x)) #define CLEAR(x) memset (&(x), 0, sizeof (x))
@ -227,6 +227,11 @@ make & enjoy!
#include <linux/videodev2.h> #include <linux/videodev2.h>
#endif #endif
#ifdef HAVE_VIDEOIO
#include <sys/videoio.h>
#define HAVE_CAMV4L2
#endif
/* Defaults - If your board can do better, set it here. Set for the most common type inputs. */ /* Defaults - If your board can do better, set it here. Set for the most common type inputs. */
#define DEFAULT_V4L_WIDTH 640 #define DEFAULT_V4L_WIDTH 640
#define DEFAULT_V4L_HEIGHT 480 #define DEFAULT_V4L_HEIGHT 480