summaryrefslogtreecommitdiff
path: root/graphics/libv4l/patches/patch-ae
blob: 4612fa4926ce4ceedb5f971ae664a1473512f2c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$NetBSD: patch-ae,v 1.3 2010/12/27 04:58:10 obache 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,20 @@
 #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>
+#include <sys/videoio.h>
+#endif
 #include "libv4l2.h"
 #include "libv4l2-priv.h"
 
+#if defined(__NetBSD__) || defined(__DragonFly__)
+#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 +96,13 @@
 	[_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)