55 lines
1.7 KiB
Text
55 lines
1.7 KiB
Text
$NetBSD: patch-ae,v 1.4 2012/04/18 17:47:22 hans Exp $
|
|
|
|
--- libv4l2/log.c.orig 2008-09-08 14:45:43.000000000 -0400
|
|
+++ libv4l2/log.c 2008-09-08 14:47:53.000000000 -0400
|
|
@@ -18,6 +18,7 @@
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
+#ifdef __linux__
|
|
#include <linux/ioctl.h>
|
|
/* These headers are not needed by us, but by linux/videodev2.h,
|
|
which is broken on some systems and doesn't include them itself :( */
|
|
@@ -25,9 +26,28 @@
|
|
#include <asm/types.h>
|
|
/* end broken header workaround includes */
|
|
#include <linux/videodev2.h>
|
|
+#else
|
|
+#include <sys/types.h>
|
|
+#include <sys/ioctl.h>
|
|
+#include <sys/time.h>
|
|
+#ifdef __sun
|
|
+#include <sys/videodev2.h>
|
|
+#else
|
|
+#include <sys/videoio.h>
|
|
+#endif
|
|
+#endif
|
|
#include "libv4l2.h"
|
|
#include "libv4l2-priv.h"
|
|
|
|
+#if defined(__sun)
|
|
+#define IOCGROUP(x) (((x) >> 8) & 0xff)
|
|
+#endif
|
|
+
|
|
+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__sun)
|
|
+#define _IOC_NR(x) ((x) & 0xff)
|
|
+#define _IOC_TYPE IOCGROUP
|
|
+#endif
|
|
+
|
|
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
|
|
|
|
FILE *v4l2_log_file = NULL;
|
|
@@ -84,11 +104,13 @@ static const char *v4l2_ioctls[] = {
|
|
[_IOC_NR(VIDIOC_ENUMAUDOUT)] = "VIDIOC_ENUMAUDOUT",
|
|
[_IOC_NR(VIDIOC_G_PRIORITY)] = "VIDIOC_G_PRIORITY",
|
|
[_IOC_NR(VIDIOC_S_PRIORITY)] = "VIDIOC_S_PRIORITY",
|
|
+#ifdef VIDIOC_G_SLICED_VBI_CAP
|
|
[_IOC_NR(VIDIOC_G_SLICED_VBI_CAP)] = "VIDIOC_G_SLICED_VBI_CAP",
|
|
[_IOC_NR(VIDIOC_LOG_STATUS)] = "VIDIOC_LOG_STATUS",
|
|
[_IOC_NR(VIDIOC_G_EXT_CTRLS)] = "VIDIOC_G_EXT_CTRLS",
|
|
[_IOC_NR(VIDIOC_S_EXT_CTRLS)] = "VIDIOC_S_EXT_CTRLS",
|
|
[_IOC_NR(VIDIOC_TRY_EXT_CTRLS)] = "VIDIOC_TRY_EXT_CTRLS",
|
|
+#endif
|
|
};
|
|
|
|
void v4l2_log_ioctl(unsigned long int request, void *arg, int result)
|