NetBSD video(4) support, patch 3 of 3
xioctl() assumes that ioctl takes int request. Cope with int ioctl(int d, unsigned long request, ...) to avoid "invalid argument".
This commit is contained in:
parent
681ffd9a21
commit
1a84bcc565
@ -85,12 +85,18 @@ 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_IOCTL_ULONG)
|
||||||
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)
|
CHECK_INCLUDE_FILE(sys/videoio.h HAVE_VIDEOIO)
|
||||||
|
INCLUDE(CheckPrototypeDefinition)
|
||||||
|
CHECK_PROTOTYPE_DEFINITION(ioctl
|
||||||
|
"int ioctl(int d, unsigned long request, ...)"
|
||||||
|
"-1"
|
||||||
|
"sys/ioctl.h"
|
||||||
|
HAVE_IOCTL_ULONG)
|
||||||
endif(WITH_V4L)
|
endif(WITH_V4L)
|
||||||
|
|
||||||
# --- OpenNI ---
|
# --- OpenNI ---
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
/* V4L/V4L2 capturing support via libv4l */
|
/* V4L/V4L2 capturing support via libv4l */
|
||||||
#cmakedefine HAVE_LIBV4L
|
#cmakedefine HAVE_LIBV4L
|
||||||
|
|
||||||
|
/* ioctl takes unsigned long request rather than int */
|
||||||
|
#cmakedefine HAVE_IOCTL_ULONG
|
||||||
|
|
||||||
/* Carbon windowing environment */
|
/* Carbon windowing environment */
|
||||||
#cmakedefine HAVE_CARBON
|
#cmakedefine HAVE_CARBON
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -354,17 +354,18 @@ static int icvSetVideoSize( CvCaptureCAM_V4L* capture, int w, int h);
|
|||||||
static int numCameras = 0;
|
static int numCameras = 0;
|
||||||
static int indexList = 0;
|
static int indexList = 0;
|
||||||
|
|
||||||
|
#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;
|
||||||
|
|
||||||
|
|
||||||
do r = ioctl (fd, request, arg);
|
do r = ioctl (fd, request, arg);
|
||||||
while (-1 == r && EINTR == errno);
|
while (-1 == r && EINTR == errno);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Simple test program: Find number of Video Sources available.
|
/* Simple test program: Find number of Video Sources available.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user