View | Details | Raw Unified | Return to bug 245501 | Differences between
and this patch

Collapse All | Expand All

(-)multimedia/libv4l/Makefile (-35 / +82 lines)
Lines 3-15 Link Here
3
# Check v4l_compat and v4l-utils slave ports
3
# Check v4l_compat and v4l-utils slave ports
4
4
5
PORTNAME?=	libv4l
5
PORTNAME?=	libv4l
6
PORTVERSION=	1.6.3
6
PORTVERSION=	1.18.0
7
PORTREVISION?=	4
8
CATEGORIES=	multimedia
7
CATEGORIES=	multimedia
9
MASTER_SITES=	http://linuxtv.org/downloads/v4l-utils/:master \
8
MASTER_SITES=	http://linuxtv.org/downloads/v4l-utils/:master \
10
		LOCAL/kwm:local
9
		http://www.selasky.org/hans_petter/distfiles/:local \
11
DISTFILES+=	v4l-utils-${PORTVERSION}.tar.bz2:master \
10
		http://home.selasky.org/distfiles/:local
12
		linux-3.16.7-dvb-headers.tar.xz:local
11
WEBCAMDVERSION=	5.3.7.1
12
DISTFILES=	v4l-utils-${PORTVERSION}.tar.bz2:master \
13
		webcamd-${WEBCAMDVERSION}.tar.bz2:local
13
14
14
MAINTAINER=	multimedia@FreeBSD.org
15
MAINTAINER=	multimedia@FreeBSD.org
15
COMMENT?=	Video4Linux library
16
COMMENT?=	Video4Linux library
Lines 21-26 Link Here
21
WRKSRC=		${WRKDIR}/v4l-utils-${PORTVERSION}
22
WRKSRC=		${WRKDIR}/v4l-utils-${PORTVERSION}
22
23
23
.if ${PORTNAME} == v4l-utils || ${PORTNAME} == libv4l
24
.if ${PORTNAME} == v4l-utils || ${PORTNAME} == libv4l
25
LIB_DEPENDS+=	libargp.so:devel/argp-standalone \
26
		libudev.so:devel/libudev-devd
24
BUILD_DEPENDS+=	v4l_compat>=${PORTVERSION}:multimedia/v4l_compat
27
BUILD_DEPENDS+=	v4l_compat>=${PORTVERSION}:multimedia/v4l_compat
25
28
26
GNU_CONFIGURE=	yes
29
GNU_CONFIGURE=	yes
Lines 28-71 Link Here
28
LDFLAGS+=	-L${LOCALBASE}/lib
31
LDFLAGS+=	-L${LOCALBASE}/lib
29
USES+=		gmake iconv jpeg libtool pathfix pkgconfig
32
USES+=		gmake iconv jpeg libtool pathfix pkgconfig
30
USE_LDCONFIG=	yes
33
USE_LDCONFIG=	yes
31
CONFIGURE_ARGS=	--enable-libdvbv5 \
34
CONFIGURE_ARGS=	\
32
		--disable-qv4l2 \
35
	--disable-qv4l2 \
33
		--without-libudev
36
	--disable-qvidcap \
37
	--disable-nls
34
INSTALL_TARGET=	install-strip
38
INSTALL_TARGET=	install-strip
39
.endif
35
40
36
. if ${PORTNAME} == v4l-utils
41
.if ${PORTNAME} == v4l_compat
42
RUN_DEPENDS+=	evdev-proto>=5.3:devel/evdev-proto
43
.endif
44
45
.if ${PORTNAME} == v4l-utils
46
USES+=		perl5
37
BUILD_DEPENDS+=	libv4l>=${PORTVERSION}:multimedia/libv4l
47
BUILD_DEPENDS+=	libv4l>=${PORTVERSION}:multimedia/libv4l
38
LIB_DEPENDS+=	libargp.so:devel/argp-standalone \
48
LIB_DEPENDS+=	libepoll-shim.so:devel/libepoll-shim \
39
		libv4l2.so:multimedia/libv4l
49
		libv4l2.so:multimedia/libv4l
40
# Disabling building libv4l in the utils slave is too much hackery
50
LDFLAGS+=	-lepoll-shim
41
# Lets wait for subpackages
51
CONFIGURE_ARGS+= \
42
CONFIGURE_ARGS+=--enable-v4l-utils
52
	--enable-v4l-utils \
43
. else
53
	--without-v4l2-compliance
44
CONFIGURE_ARGS+=--disable-v4l-utils --enable-libv4l
45
EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-configure
46
. endif
47
.endif
54
.endif
48
55
49
HEADER_PATCHES=	extra-linux_dvb_ca.h \
56
.if ${PORTNAME} == libv4l
50
		extra-linux_dvb_osd.h \
57
CONFIGURE_ARGS+= \
51
		patch-include_linux_dvb_frontend.h \
58
	--disable-v4l-utils \
52
		patch-include_linux_dvb_video.h
59
	--enable-dyn-libv4l \
60
	--enable-libdvbv5
61
.endif
53
62
54
post-patch:
63
post-patch:
55
	@${REINPLACE_CMD} -e 's|$$libdir/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \
64
# Remove old FreeBSD include files (to be removed upstream)
56
		${WRKSRC}/configure
65
	@${RM} -r ${WRKDIR}/v4l-utils-${PORTVERSION}/contrib/freebsd/include/*
57
# fix weird types, except a few headers which have compat code for these types.
66
# Apply webcamd patches first
58
	@${FIND} ${WRKDIR} -type f \( -iname "*.h" ! -iname "input.h" ! -iname "videodev2.h" \) | \
67
	@(cd ${WRKDIR}/webcamd-${WEBCAMDVERSION}/patches && ${SH} ./do_patch.sh)
68
# Patch all source files
69
	@${FIND} ${WRKDIR} -type f \( -iname "*.[ch]" -or -iname "*.cpp" -or -iname "msg2ctl.pl" \) | \
59
		${XARGS} -n 10 ${REINPLACE_CMD} \
70
		${XARGS} -n 10 ${REINPLACE_CMD} \
60
		-e 's|linux/types.h|sys/types.h|g; s|__user||g; \
71
			-e 's|__inline__|inline|g' \
61
		s|__u8|uint8_t|g; s|__s8|int8_t|g; \
72
			-e 's|__u8|uint8_t|g' \
62
		s|__u16|uint16_t|g; s|__s16|int16_t|g; \
73
			-e 's|__s8|int8_t|g' \
63
		s|__u32|uint32_t|g; s|__s32|int32_t|g; \
74
			-e 's|__le16|uint16_t|g' \
64
		s|__u64|uint64_t|g; s|__s64|int64_t|g'
75
			-e 's|__be16|uint16_t|g' \
65
.if ${PORTNAME} == v4l_compat
76
			-e 's|__u16|uint16_t|g' \
66
.for patch in ${HEADER_PATCHES}
77
			-e 's|__s16|int16_t|g' \
67
	@cd ${WRKDIR}/linux && ${PATCH} -p2 < ${FILESDIR}/${patch}
78
			-e 's|__le32|uint32_t|g' \
68
.endfor
79
			-e 's|__be32|uint32_t|g' \
69
.endif
80
			-e 's|__u32|uint32_t|g' \
81
			-e 's|__s32|int32_t|g' \
82
			-e 's|__le64|uint64_t|g' \
83
			-e 's|__be64|uint64_t|g' \
84
			-e 's|__u64|uint64_t|g' \
85
			-e 's|__s64|int64_t|g' \
86
			-e 's|uint16_t_to_cpu|letoh16|g' \
87
			-e 's|uint32_t_to_cpu|letoh32|g' \
88
			-e 's|uint64_t_to_cpu|letoh64|g' \
89
			-e 's|error_t|int|g' \
90
			-e 's|"gettext.h"|<stdio.h>|g' \
91
			-e 's|MSG_MORE|0|g' \
92
			-e 's|EBADR|EFAULT|g' \
93
			-e 's|ENONET|EHOSTDOWN|g' \
94
			-e 's|_IOC_READ|IOC_OUT|g' \
95
			-e 's|_IOC_WRITE|IOC_IN|g' \
96
			-e 's|_IOC_NONE|IOC_VOID|g' \
97
			-e 's|V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM|0x0004|g' \
98
			-e 's|V4L2_FMT_FLAG_DYN_RESOLUTION|0x0008|g' \
99
			-e 's|<endian.h>|<sys/endian.h>|g' \
100
			-e 's|<linux/compiler.h>|<sys/cdefs.h>|g' \
101
			-e 's|<linux/errno.h>|<errno.h>|g' \
102
			-e 's|<linux/ioctl.h>|<sys/ioctl.h>|g' \
103
			-e 's|<linux/kernel.h>|<sys/sysinfo.h>|g' \
104
			-e 's|<linux/string.h>|<string.h>|g' \
105
			-e 's|<linux/sysmacros.h>|<sys/types.h>|g' \
106
			-e 's|<malloc.h>|<stdlib.h>|g' \
107
			-e 's|<sys/epoll.h>|<libepoll-shim/sys/epoll.h>|g' \
108
			-e 's|<sys/sysmacros.h>|<sys/types.h>|g' \
109
			-e 's|/usr/bin/perl|${PREFIX}/bin/perl|g' \
110
			-e 's|__user||g'
70
111
112
# Duplicate some files to avoid patching
113
	@${CP} ${WRKSRC}/utils/common/ir-encode.c ${WRKSRC}/utils/ir-ctl/ir-encode.c
114
	@${CP} ${WRKSRC}/utils/common/ir-encode.c ${WRKSRC}/utils/keytable/ir-encode.c
115
	@${CP} ${WRKSRC}/utils/common/keymap.h ${WRKSRC}/utils/ir-ctl/keymap.h
116
	@${CP} ${WRKSRC}/utils/common/keymap.h ${WRKSRC}/utils/keytable/keymap.h
117
71
.include <bsd.port.mk>
118
.include <bsd.port.mk>
(-)multimedia/libv4l/distinfo (-4 / +5 lines)
Lines 1-4 Link Here
1
SHA256 (v4l-utils-1.6.3.tar.bz2) = 164abf5c1befcd27e8e6ef824a82d4015bdfb5d99ae82daa00e77d895ff9864c
1
TIMESTAMP = 1586294935
2
SIZE (v4l-utils-1.6.3.tar.bz2) = 1151081
2
SHA256 (v4l-utils-1.18.0.tar.bz2) = 6cb60d822eeed20486a03cc23e0fc65956fbc1e85e0c1a7477f68bbd9802880d
3
SHA256 (linux-3.16.7-dvb-headers.tar.xz) = 0ee217b243d52b8104e6b61bbf009bf84155573317720f41930af0a9ef50cdaa
3
SIZE (v4l-utils-1.18.0.tar.bz2) = 1995506
4
SIZE (linux-3.16.7-dvb-headers.tar.xz) = 11712
4
SHA256 (webcamd-5.3.7.1.tar.bz2) = 75082bc48b6975f50ec4aaadc1ece874e132733dbbf8c23aff36bf92ed1e0b1c
5
SIZE (webcamd-5.3.7.1.tar.bz2) = 13905071
(-)multimedia/libv4l/files/extra-linux_dvb_ca.h (-20 lines)
Lines 1-20 Link Here
1
--- ../linux/dvb/ca.h.orig	2014-12-01 10:58:18.000000000 +0100
2
+++ ../linux/dvb/ca.h	2015-01-23 22:41:21.761540460 +0100
3
@@ -80,9 +80,17 @@
4
 
5
 #define CA_RESET          _IO('o', 128)
6
 #define CA_GET_CAP        _IOR('o', 129, ca_caps_t)
7
+
8
+/* At least CA_GET_SLOT_INFO and CA_GET_MSG need to be _IOWR not _IOR.
9
+ * This is wrong on Linux too but there the driver doesn't care.
10
+ *
11
 #define CA_GET_SLOT_INFO  _IOR('o', 130, ca_slot_info_t)
12
 #define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
13
 #define CA_GET_MSG        _IOR('o', 132, ca_msg_t)
14
+ */
15
+#define CA_GET_SLOT_INFO  _IOWR('o', 130, ca_slot_info_t)
16
+#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
17
+#define CA_GET_MSG        _IOWR('o', 132, ca_msg_t)
18
 #define CA_SEND_MSG       _IOW('o', 133, ca_msg_t)
19
 #define CA_SET_DESCR      _IOW('o', 134, ca_descr_t)
20
 #define CA_SET_PID        _IOW('o', 135, ca_pid_t)
(-)multimedia/libv4l/files/extra-linux_dvb_osd.h (-11 lines)
Lines 1-11 Link Here
1
--- ../linux/dvb/osd.h.bak	2014-12-01 10:58:18.000000000 +0100
2
+++ ../linux/dvb/osd.h	2015-01-24 00:12:54.252160592 +0100
3
@@ -24,7 +24,7 @@
4
 #ifndef _DVBOSD_H_
5
 #define _DVBOSD_H_
6
 
7
-#include <linux/compiler.h>
8
+#include <sys/types.h>
9
 
10
 typedef enum {
11
   // All functions return -2 on "not open"
(-)multimedia/libv4l/files/extra-patch-configure (-78 lines)
Lines 1-78 Link Here
1
--- configure.orig	2015-08-12 21:40:16 UTC
2
+++ configure
3
@@ -18563,75 +18563,6 @@ fi
4
 
5
 LIBS=$dl_saved_libs
6
 
7
-ac_fn_c_check_header_mongrel "$LINENO" "argp.h" "ac_cv_header_argp_h" "$ac_includes_default"
8
-if test "x$ac_cv_header_argp_h" = xyes; then :
9
-
10
-else
11
-  as_fn_error $? "Cannot continue: argp.h not found" "$LINENO" 5
12
-fi
13
-
14
-
15
-argp_saved_libs=$LIBS
16
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing argp_parse" >&5
17
-$as_echo_n "checking for library containing argp_parse... " >&6; }
18
-if ${ac_cv_search_argp_parse+:} false; then :
19
-  $as_echo_n "(cached) " >&6
20
-else
21
-  ac_func_search_save_LIBS=$LIBS
22
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23
-/* end confdefs.h.  */
24
-
25
-/* Override any GCC internal prototype to avoid an error.
26
-   Use char because int might match the return type of a GCC
27
-   builtin and then its argument prototype would still apply.  */
28
-#ifdef __cplusplus
29
-extern "C"
30
-#endif
31
-char argp_parse ();
32
-int
33
-main ()
34
-{
35
-return argp_parse ();
36
-  ;
37
-  return 0;
38
-}
39
-_ACEOF
40
-for ac_lib in '' argp; do
41
-  if test -z "$ac_lib"; then
42
-    ac_res="none required"
43
-  else
44
-    ac_res=-l$ac_lib
45
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
46
-  fi
47
-  if ac_fn_c_try_link "$LINENO"; then :
48
-  ac_cv_search_argp_parse=$ac_res
49
-fi
50
-rm -f core conftest.err conftest.$ac_objext \
51
-    conftest$ac_exeext
52
-  if ${ac_cv_search_argp_parse+:} false; then :
53
-  break
54
-fi
55
-done
56
-if ${ac_cv_search_argp_parse+:} false; then :
57
-
58
-else
59
-  ac_cv_search_argp_parse=no
60
-fi
61
-rm conftest.$ac_ext
62
-LIBS=$ac_func_search_save_LIBS
63
-fi
64
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_argp_parse" >&5
65
-$as_echo "$ac_cv_search_argp_parse" >&6; }
66
-ac_res=$ac_cv_search_argp_parse
67
-if test "$ac_res" != no; then :
68
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
69
-  test "$ac_cv_search_argp_parse" = "none required" || ARGP_LIBS=$ac_cv_search_argp_parse
70
-else
71
-  as_fn_error $? "unable to find the argp_parse() function" "$LINENO" 5
72
-fi
73
-
74
-
75
-LIBS=$argp_saved_libs
76
 
77
 ac_fn_c_check_header_mongrel "$LINENO" "linux/i2c-dev.h" "ac_cv_header_linux_i2c_dev_h" "$ac_includes_default"
78
 if test "x$ac_cv_header_linux_i2c_dev_h" = xyes; then :
(-)multimedia/libv4l/files/patch-configure (-11 lines)
Lines 1-11 Link Here
1
--- configure.orig	2015-01-25 19:42:02.248041140 +0100
2
+++ configure	2015-01-25 19:42:14.503036421 +0100
3
@@ -19876,7 +19876,7 @@
4
   WITH_LIBV4L_FALSE=
5
 fi
6
 
7
- if test x$enable_v4l_utils != xno -a x$linux_os = xyes; then
8
+ if test x$enable_v4l_utils != xno; then
9
   WITH_V4LUTILS_TRUE=
10
   WITH_V4LUTILS_FALSE='#'
11
 else
(-)multimedia/libv4l/files/patch-contrib_freebsd_include_linux_videodev2.h (-662 lines)
Lines 1-662 Link Here
1
--- contrib/freebsd/include/linux/videodev2.h.orig	2015-05-06 19:24:59 UTC
2
+++ contrib/freebsd/include/linux/videodev2.h
3
@@ -46,7 +46,7 @@
4
  * All kernel-specific stuff were moved to media/v4l2-dev.h, so
5
  * no #if __KERNEL tests are allowed here
6
  *
7
- *	See http://linuxtv.org for more info
8
+ *	See https://linuxtv.org for more info
9
  *
10
  *	Author: Bill Dirks <bill@thedirks.org>
11
  *		Justin Schoeman
12
@@ -170,13 +170,12 @@ enum v4l2_buf_type {
13
 	V4L2_BUF_TYPE_VBI_OUTPUT           = 5,
14
 	V4L2_BUF_TYPE_SLICED_VBI_CAPTURE   = 6,
15
 	V4L2_BUF_TYPE_SLICED_VBI_OUTPUT    = 7,
16
-#if 1
17
-	/* Experimental */
18
 	V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
19
-#endif
20
 	V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
21
 	V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
22
 	V4L2_BUF_TYPE_SDR_CAPTURE          = 11,
23
+	V4L2_BUF_TYPE_SDR_OUTPUT           = 12,
24
+	V4L2_BUF_TYPE_META_CAPTURE         = 13,
25
 	/* Deprecated, do not use */
26
 	V4L2_BUF_TYPE_PRIVATE              = 0x80,
27
 };
28
@@ -191,16 +190,20 @@ enum v4l2_buf_type {
29
 	 || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY		\
30
 	 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY	\
31
 	 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT			\
32
-	 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
33
+	 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT		\
34
+	 || (type) == V4L2_BUF_TYPE_SDR_OUTPUT)
35
 
36
 enum v4l2_tuner_type {
37
 	V4L2_TUNER_RADIO	     = 1,
38
 	V4L2_TUNER_ANALOG_TV	     = 2,
39
 	V4L2_TUNER_DIGITAL_TV	     = 3,
40
-	V4L2_TUNER_ADC               = 4,
41
+	V4L2_TUNER_SDR               = 4,
42
 	V4L2_TUNER_RF                = 5,
43
 };
44
 
45
+/* Deprecated, do not use */
46
+#define V4L2_TUNER_ADC  V4L2_TUNER_SDR
47
+
48
 enum v4l2_memory {
49
 	V4L2_MEMORY_MMAP             = 1,
50
 	V4L2_MEMORY_USERPTR          = 2,
51
@@ -210,32 +213,206 @@ enum v4l2_memory {
52
 
53
 /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
54
 enum v4l2_colorspace {
55
-	/* ITU-R 601 -- broadcast NTSC/PAL */
56
+	/*
57
+	 * Default colorspace, i.e. let the driver figure it out.
58
+	 * Can only be used with video capture.
59
+	 */
60
+	V4L2_COLORSPACE_DEFAULT       = 0,
61
+
62
+	/* SMPTE 170M: used for broadcast NTSC/PAL SDTV */
63
 	V4L2_COLORSPACE_SMPTE170M     = 1,
64
 
65
-	/* 1125-Line (US) HDTV */
66
+	/* Obsolete pre-1998 SMPTE 240M HDTV standard, superseded by Rec 709 */
67
 	V4L2_COLORSPACE_SMPTE240M     = 2,
68
 
69
-	/* HD and modern captures. */
70
+	/* Rec.709: used for HDTV */
71
 	V4L2_COLORSPACE_REC709        = 3,
72
 
73
-	/* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
74
+	/*
75
+	 * Deprecated, do not use. No driver will ever return this. This was
76
+	 * based on a misunderstanding of the bt878 datasheet.
77
+	 */
78
 	V4L2_COLORSPACE_BT878         = 4,
79
 
80
-	/* These should be useful.  Assume 601 extents. */
81
+	/*
82
+	 * NTSC 1953 colorspace. This only makes sense when dealing with
83
+	 * really, really old NTSC recordings. Superseded by SMPTE 170M.
84
+	 */
85
 	V4L2_COLORSPACE_470_SYSTEM_M  = 5,
86
+
87
+	/*
88
+	 * EBU Tech 3213 PAL/SECAM colorspace. This only makes sense when
89
+	 * dealing with really old PAL/SECAM recordings. Superseded by
90
+	 * SMPTE 170M.
91
+	 */
92
 	V4L2_COLORSPACE_470_SYSTEM_BG = 6,
93
 
94
-	/* I know there will be cameras that send this.  So, this is
95
-	 * unspecified chromaticities and full 0-255 on each of the
96
-	 * Y'CbCr components
97
+	/*
98
+	 * Effectively shorthand for V4L2_COLORSPACE_SRGB, V4L2_YCBCR_ENC_601
99
+	 * and V4L2_QUANTIZATION_FULL_RANGE. To be used for (Motion-)JPEG.
100
 	 */
101
 	V4L2_COLORSPACE_JPEG          = 7,
102
 
103
-	/* For RGB colourspaces, this is probably a good start. */
104
+	/* For RGB colorspaces such as produces by most webcams. */
105
 	V4L2_COLORSPACE_SRGB          = 8,
106
+
107
+	/* AdobeRGB colorspace */
108
+	V4L2_COLORSPACE_ADOBERGB      = 9,
109
+
110
+	/* BT.2020 colorspace, used for UHDTV. */
111
+	V4L2_COLORSPACE_BT2020        = 10,
112
+
113
+	/* Raw colorspace: for RAW unprocessed images */
114
+	V4L2_COLORSPACE_RAW           = 11,
115
+
116
+	/* DCI-P3 colorspace, used by cinema projectors */
117
+	V4L2_COLORSPACE_DCI_P3        = 12,
118
 };
119
 
120
+/*
121
+ * Determine how COLORSPACE_DEFAULT should map to a proper colorspace.
122
+ * This depends on whether this is a SDTV image (use SMPTE 170M), an
123
+ * HDTV image (use Rec. 709), or something else (use sRGB).
124
+ */
125
+#define V4L2_MAP_COLORSPACE_DEFAULT(is_sdtv, is_hdtv) \
126
+	((is_sdtv) ? V4L2_COLORSPACE_SMPTE170M : \
127
+	 ((is_hdtv) ? V4L2_COLORSPACE_REC709 : V4L2_COLORSPACE_SRGB))
128
+
129
+enum v4l2_xfer_func {
130
+	/*
131
+	 * Mapping of V4L2_XFER_FUNC_DEFAULT to actual transfer functions
132
+	 * for the various colorspaces:
133
+	 *
134
+	 * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M,
135
+	 * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_REC709 and
136
+	 * V4L2_COLORSPACE_BT2020: V4L2_XFER_FUNC_709
137
+	 *
138
+	 * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB
139
+	 *
140
+	 * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB
141
+	 *
142
+	 * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M
143
+	 *
144
+	 * V4L2_COLORSPACE_RAW: V4L2_XFER_FUNC_NONE
145
+	 *
146
+	 * V4L2_COLORSPACE_DCI_P3: V4L2_XFER_FUNC_DCI_P3
147
+	 */
148
+	V4L2_XFER_FUNC_DEFAULT     = 0,
149
+	V4L2_XFER_FUNC_709         = 1,
150
+	V4L2_XFER_FUNC_SRGB        = 2,
151
+	V4L2_XFER_FUNC_ADOBERGB    = 3,
152
+	V4L2_XFER_FUNC_SMPTE240M   = 4,
153
+	V4L2_XFER_FUNC_NONE        = 5,
154
+	V4L2_XFER_FUNC_DCI_P3      = 6,
155
+	V4L2_XFER_FUNC_SMPTE2084   = 7,
156
+};
157
+
158
+/*
159
+ * Determine how XFER_FUNC_DEFAULT should map to a proper transfer function.
160
+ * This depends on the colorspace.
161
+ */
162
+#define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \
163
+	((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \
164
+	 ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \
165
+	  ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \
166
+	   ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \
167
+	    ((colsp) == V4L2_COLORSPACE_SRGB || (colsp) == V4L2_COLORSPACE_JPEG ? \
168
+	     V4L2_XFER_FUNC_SRGB : V4L2_XFER_FUNC_709)))))
169
+
170
+enum v4l2_ycbcr_encoding {
171
+	/*
172
+	 * Mapping of V4L2_YCBCR_ENC_DEFAULT to actual encodings for the
173
+	 * various colorspaces:
174
+	 *
175
+	 * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M,
176
+	 * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB,
177
+	 * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601
178
+	 *
179
+	 * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709
180
+	 *
181
+	 * V4L2_COLORSPACE_BT2020: V4L2_YCBCR_ENC_BT2020
182
+	 *
183
+	 * V4L2_COLORSPACE_SMPTE240M: V4L2_YCBCR_ENC_SMPTE240M
184
+	 */
185
+	V4L2_YCBCR_ENC_DEFAULT        = 0,
186
+
187
+	/* ITU-R 601 -- SDTV */
188
+	V4L2_YCBCR_ENC_601            = 1,
189
+
190
+	/* Rec. 709 -- HDTV */
191
+	V4L2_YCBCR_ENC_709            = 2,
192
+
193
+	/* ITU-R 601/EN 61966-2-4 Extended Gamut -- SDTV */
194
+	V4L2_YCBCR_ENC_XV601          = 3,
195
+
196
+	/* Rec. 709/EN 61966-2-4 Extended Gamut -- HDTV */
197
+	V4L2_YCBCR_ENC_XV709          = 4,
198
+
199
+#ifndef __KERNEL__
200
+	/*
201
+	 * sYCC (Y'CbCr encoding of sRGB), identical to ENC_601. It was added
202
+	 * originally due to a misunderstanding of the sYCC standard. It should
203
+	 * not be used, instead use V4L2_YCBCR_ENC_601.
204
+	 */
205
+	V4L2_YCBCR_ENC_SYCC           = 5,
206
+#endif
207
+
208
+	/* BT.2020 Non-constant Luminance Y'CbCr */
209
+	V4L2_YCBCR_ENC_BT2020         = 6,
210
+
211
+	/* BT.2020 Constant Luminance Y'CbcCrc */
212
+	V4L2_YCBCR_ENC_BT2020_CONST_LUM = 7,
213
+
214
+	/* SMPTE 240M -- Obsolete HDTV */
215
+	V4L2_YCBCR_ENC_SMPTE240M      = 8,
216
+};
217
+
218
+/*
219
+ * enum v4l2_hsv_encoding values should not collide with the ones from
220
+ * enum v4l2_ycbcr_encoding.
221
+ */
222
+enum v4l2_hsv_encoding {
223
+
224
+	/* Hue mapped to 0 - 179 */
225
+	V4L2_HSV_ENC_180		= 128,
226
+
227
+	/* Hue mapped to 0-255 */
228
+	V4L2_HSV_ENC_256		= 129,
229
+};
230
+
231
+/*
232
+ * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding.
233
+ * This depends on the colorspace.
234
+ */
235
+#define V4L2_MAP_YCBCR_ENC_DEFAULT(colsp) \
236
+	(((colsp) == V4L2_COLORSPACE_REC709 || \
237
+	  (colsp) == V4L2_COLORSPACE_DCI_P3) ? V4L2_YCBCR_ENC_709 : \
238
+	 ((colsp) == V4L2_COLORSPACE_BT2020 ? V4L2_YCBCR_ENC_BT2020 : \
239
+	  ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_YCBCR_ENC_SMPTE240M : \
240
+	   V4L2_YCBCR_ENC_601)))
241
+
242
+enum v4l2_quantization {
243
+	/*
244
+	 * The default for R'G'B' quantization is always full range, except
245
+	 * for the BT2020 colorspace. For Y'CbCr the quantization is always
246
+	 * limited range, except for COLORSPACE_JPEG: this is full range.
247
+	 */
248
+	V4L2_QUANTIZATION_DEFAULT     = 0,
249
+	V4L2_QUANTIZATION_FULL_RANGE  = 1,
250
+	V4L2_QUANTIZATION_LIM_RANGE   = 2,
251
+};
252
+
253
+/*
254
+ * Determine how QUANTIZATION_DEFAULT should map to a proper quantization.
255
+ * This depends on whether the image is RGB or not, the colorspace and the
256
+ * Y'CbCr encoding.
257
+ */
258
+#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv, colsp, ycbcr_enc) \
259
+	(((is_rgb_or_hsv) && (colsp) == V4L2_COLORSPACE_BT2020) ? \
260
+	 V4L2_QUANTIZATION_LIM_RANGE : \
261
+	 (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \
262
+	 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
263
+
264
 enum v4l2_priority {
265
 	V4L2_PRIORITY_UNSET       = 0,  /* not initialized */
266
 	V4L2_PRIORITY_BACKGROUND  = 1,
267
@@ -306,11 +483,15 @@ struct v4l2_capability {
268
 
269
 #define V4L2_CAP_SDR_CAPTURE		0x00100000  /* Is a SDR capture device */
270
 #define V4L2_CAP_EXT_PIX_FORMAT		0x00200000  /* Supports the extended pixel format */
271
+#define V4L2_CAP_SDR_OUTPUT		0x00400000  /* Is a SDR output device */
272
+#define V4L2_CAP_META_CAPTURE		0x00800000  /* Is a metadata capture device */
273
 
274
 #define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */
275
 #define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
276
 #define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */
277
 
278
+#define V4L2_CAP_TOUCH                  0x10000000  /* Is a touch device */
279
+
280
 #define V4L2_CAP_DEVICE_CAPS            0x80000000  /* sets device capabilities field */
281
 
282
 /*
283
@@ -326,6 +507,12 @@ struct v4l2_pix_format {
284
 	uint32_t			colorspace;	/* enum v4l2_colorspace */
285
 	uint32_t			priv;		/* private data, depends on pixelformat */
286
 	uint32_t			flags;		/* format flags (V4L2_PIX_FMT_FLAG_*) */
287
+	union {
288
+		uint32_t		ycbcr_enc;
289
+		uint32_t		hsv_enc;
290
+	};
291
+	uint32_t			quantization;
292
+	uint32_t			xfer_func;
293
 };
294
 
295
 /*      Pixel format         FOURCC                          depth  Description  */
296
@@ -360,6 +547,7 @@ struct v4l2_pix_format {
297
 #define V4L2_PIX_FMT_Y10     v4l2_fourcc('Y', '1', '0', ' ') /* 10  Greyscale     */
298
 #define V4L2_PIX_FMT_Y12     v4l2_fourcc('Y', '1', '2', ' ') /* 12  Greyscale     */
299
 #define V4L2_PIX_FMT_Y16     v4l2_fourcc('Y', '1', '6', ' ') /* 16  Greyscale     */
300
+#define V4L2_PIX_FMT_Y16_BE  v4l2_fourcc_be('Y', '1', '6', ' ') /* 16  Greyscale BE  */
301
 
302
 /* Grey bit-packed formats */
303
 #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
304
@@ -371,22 +559,16 @@ struct v4l2_pix_format {
305
 #define V4L2_PIX_FMT_UV8     v4l2_fourcc('U', 'V', '8', ' ') /*  8  UV 4:4 */
306
 
307
 /* Luminance+Chrominance formats */
308
-#define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0     */
309
-#define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0     */
310
 #define V4L2_PIX_FMT_YUYV    v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16  YUV 4:2:2     */
311
 #define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16  YUV 4:2:2     */
312
 #define V4L2_PIX_FMT_YVYU    v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
313
 #define V4L2_PIX_FMT_UYVY    v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16  YUV 4:2:2     */
314
 #define V4L2_PIX_FMT_VYUY    v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16  YUV 4:2:2     */
315
-#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16  YVU422 planar */
316
-#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16  YVU411 planar */
317
 #define V4L2_PIX_FMT_Y41P    v4l2_fourcc('Y', '4', '1', 'P') /* 12  YUV 4:1:1     */
318
 #define V4L2_PIX_FMT_YUV444  v4l2_fourcc('Y', '4', '4', '4') /* 16  xxxxyyyy uuuuvvvv */
319
 #define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */
320
 #define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */
321
 #define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */
322
-#define V4L2_PIX_FMT_YUV410  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */
323
-#define V4L2_PIX_FMT_YUV420  v4l2_fourcc('Y', 'U', '1', '2') /* 12  YUV 4:2:0     */
324
 #define V4L2_PIX_FMT_HI240   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */
325
 #define V4L2_PIX_FMT_HM12    v4l2_fourcc('H', 'M', '1', '2') /*  8  YUV 4:2:0 16x16 macroblocks */
326
 #define V4L2_PIX_FMT_M420    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */
327
@@ -407,9 +589,21 @@ struct v4l2_pix_format {
328
 #define V4L2_PIX_FMT_NV12MT  v4l2_fourcc('T', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
329
 #define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 16x16 macroblocks */
330
 
331
+/* three planes - Y Cb, Cr */
332
+#define V4L2_PIX_FMT_YUV410  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */
333
+#define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0     */
334
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 12  YVU411 planar */
335
+#define V4L2_PIX_FMT_YUV420  v4l2_fourcc('Y', 'U', '1', '2') /* 12  YUV 4:2:0     */
336
+#define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0     */
337
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16  YVU422 planar */
338
+
339
 /* three non contiguous planes - Y, Cb, Cr */
340
 #define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12  YUV420 planar */
341
 #define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12  YVU420 planar */
342
+#define V4L2_PIX_FMT_YUV422M v4l2_fourcc('Y', 'M', '1', '6') /* 16  YUV422 planar */
343
+#define V4L2_PIX_FMT_YVU422M v4l2_fourcc('Y', 'M', '6', '1') /* 16  YVU422 planar */
344
+#define V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4') /* 24  YUV444 planar */
345
+#define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2') /* 24  YVU444 planar */
346
 
347
 /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
348
 #define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
349
@@ -420,10 +614,11 @@ struct v4l2_pix_format {
350
 #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. RGRG.. */
351
 #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. BGBG.. */
352
 #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10  RGRG.. GBGB.. */
353
-#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12  BGBG.. GRGR.. */
354
-#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12  GBGB.. RGRG.. */
355
-#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12  GRGR.. BGBG.. */
356
-#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12  RGRG.. GBGB.. */
357
+	/* 10bit raw bayer packed, 5 bytes for every 4 pixels */
358
+#define V4L2_PIX_FMT_SBGGR10P v4l2_fourcc('p', 'B', 'A', 'A')
359
+#define V4L2_PIX_FMT_SGBRG10P v4l2_fourcc('p', 'G', 'A', 'A')
360
+#define V4L2_PIX_FMT_SGRBG10P v4l2_fourcc('p', 'g', 'A', 'A')
361
+#define V4L2_PIX_FMT_SRGGB10P v4l2_fourcc('p', 'R', 'A', 'A')
362
 	/* 10bit raw bayer a-law compressed to 8 bits */
363
 #define V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8')
364
 #define V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8')
365
@@ -434,11 +629,23 @@ struct v4l2_pix_format {
366
 #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
367
 #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
368
 #define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
369
-	/*
370
-	 * 10bit raw bayer, expanded to 16 bits
371
-	 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
372
-	 */
373
+#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12  BGBG.. GRGR.. */
374
+#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12  GBGB.. RGRG.. */
375
+#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12  GRGR.. BGBG.. */
376
+#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12  RGRG.. GBGB.. */
377
+	/* 12bit raw bayer packed, 6 bytes for every 4 pixels */
378
+#define V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C')
379
+#define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
380
+#define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
381
+#define V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C')
382
 #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. GRGR.. */
383
+#define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16  GBGB.. RGRG.. */
384
+#define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16  GRGR.. BGBG.. */
385
+#define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16  RGRG.. GBGB.. */
386
+
387
+/* HSV formats */
388
+#define V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3')
389
+#define V4L2_PIX_FMT_HSV32 v4l2_fourcc('H', 'S', 'V', '4')
390
 
391
 /* compressed formats */
392
 #define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
393
@@ -456,6 +663,8 @@ struct v4l2_pix_format {
394
 #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
395
 #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
396
 #define V4L2_PIX_FMT_VP8      v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
397
+#define V4L2_PIX_FMT_VP9      v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
398
+#define V4L2_PIX_FMT_HEVC     v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */
399
 
400
 /*  Vendor-specific formats   */
401
 #define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
402
@@ -484,6 +693,17 @@ struct v4l2_pix_format {
403
 #define V4L2_PIX_FMT_JPGL	v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
404
 #define V4L2_PIX_FMT_SE401      v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
405
 #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
406
+#define V4L2_PIX_FMT_Y8I      v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */
407
+#define V4L2_PIX_FMT_Y12I     v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
408
+#define V4L2_PIX_FMT_Z16      v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
409
+#define V4L2_PIX_FMT_MT21C    v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode  */
410
+#define V4L2_PIX_FMT_INZI     v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
411
+
412
+/* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */
413
+#define V4L2_PIX_FMT_IPU3_SBGGR10	v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
414
+#define V4L2_PIX_FMT_IPU3_SGBRG10	v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */
415
+#define V4L2_PIX_FMT_IPU3_SGRBG10	v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */
416
+#define V4L2_PIX_FMT_IPU3_SRGGB10	v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */
417
 
418
 /* SDR formats - used only for Software Defined Radio devices */
419
 #define V4L2_SDR_FMT_CU8          v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
420
@@ -491,6 +711,20 @@ struct v4l2_pix_format {
421
 #define V4L2_SDR_FMT_CS8          v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
422
 #define V4L2_SDR_FMT_CS14LE       v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
423
 #define V4L2_SDR_FMT_RU12LE       v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
424
+#define V4L2_SDR_FMT_PCU16BE	  v4l2_fourcc('P', 'C', '1', '6') /* planar complex u16be */
425
+#define V4L2_SDR_FMT_PCU18BE	  v4l2_fourcc('P', 'C', '1', '8') /* planar complex u18be */
426
+#define V4L2_SDR_FMT_PCU20BE	  v4l2_fourcc('P', 'C', '2', '0') /* planar complex u20be */
427
+
428
+/* Touch formats - used for Touch devices */
429
+#define V4L2_TCH_FMT_DELTA_TD16	v4l2_fourcc('T', 'D', '1', '6') /* 16-bit signed deltas */
430
+#define V4L2_TCH_FMT_DELTA_TD08	v4l2_fourcc('T', 'D', '0', '8') /* 8-bit signed deltas */
431
+#define V4L2_TCH_FMT_TU16	v4l2_fourcc('T', 'U', '1', '6') /* 16-bit unsigned touch data */
432
+#define V4L2_TCH_FMT_TU08	v4l2_fourcc('T', 'U', '0', '8') /* 8-bit unsigned touch data */
433
+
434
+/* Meta-data formats */
435
+#define V4L2_META_FMT_VSP1_HGO    v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */
436
+#define V4L2_META_FMT_VSP1_HGT    v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */
437
+#define V4L2_META_FMT_UVC         v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */
438
 
439
 /* priv field value to indicates that subsequent fields are valid. */
440
 #define V4L2_PIX_FMT_PRIV_MAGIC		0xfeedcafe
441
@@ -513,8 +747,7 @@ struct v4l2_fmtdesc {
442
 #define V4L2_FMT_FLAG_COMPRESSED 0x0001
443
 #define V4L2_FMT_FLAG_EMULATED   0x0002
444
 
445
-#if 1
446
-	/* Experimental Frame Size and frame rate enumeration */
447
+	/* Frame Size and frame rate enumeration */
448
 /*
449
  *	F R A M E   S I Z E   E N U M E R A T I O N
450
  */
451
@@ -580,7 +813,6 @@ struct v4l2_frmivalenum {
452
 
453
 	uint32_t	reserved[2];			/* Reserved space for future use */
454
 };
455
-#endif
456
 
457
 /*
458
  *	T I M E C O D E
459
@@ -765,6 +997,8 @@ struct v4l2_buffer {
460
 #define V4L2_BUF_FLAG_TSTAMP_SRC_MASK		0x00070000
461
 #define V4L2_BUF_FLAG_TSTAMP_SRC_EOF		0x00000000
462
 #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE		0x00010000
463
+/* mem2mem encoder/decoder */
464
+#define V4L2_BUF_FLAG_LAST			0x00100000
465
 
466
 /**
467
  * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
468
@@ -1073,6 +1307,9 @@ struct v4l2_standard {
469
  *		(aka field 2) of interlaced field formats
470
  * @standards:	Standards the timing belongs to
471
  * @flags:	Flags
472
+ * @picture_aspect: The picture aspect ratio (hor/vert).
473
+ * @cea861_vic:	VIC code as per the CEA-861 standard.
474
+ * @hdmi_vic:	VIC code as per the HDMI standard.
475
  * @reserved:	Reserved fields, must be zeroed.
476
  *
477
  * A note regarding vertical interlaced timings: height refers to the total
478
@@ -1102,7 +1339,10 @@ struct v4l2_bt_timings {
479
 	uint32_t	il_vbackporch;
480
 	uint32_t	standards;
481
 	uint32_t	flags;
482
-	uint32_t	reserved[14];
483
+	struct v4l2_fract picture_aspect;
484
+	uint8_t	cea861_vic;
485
+	uint8_t	hdmi_vic;
486
+	uint8_t	reserved[46];
487
 } __attribute__ ((packed));
488
 
489
 /* Interlaced or progressive format */
490
@@ -1118,6 +1358,7 @@ struct v4l2_bt_timings {
491
 #define V4L2_DV_BT_STD_DMT	(1 << 1)  /* VESA Discrete Monitor Timings */
492
 #define V4L2_DV_BT_STD_CVT	(1 << 2)  /* VESA Coordinated Video Timings */
493
 #define V4L2_DV_BT_STD_GTF	(1 << 3)  /* VESA Generalized Timings Formula */
494
+#define V4L2_DV_BT_STD_SDI	(1 << 4)  /* SDI Timings */
495
 
496
 /* Flags */
497
 
498
@@ -1143,6 +1384,36 @@ struct v4l2_bt_timings {
499
    exactly the same number of half-lines. Whether half-lines can be detected
500
    or used depends on the hardware. */
501
 #define V4L2_DV_FL_HALF_LINE			(1 << 3)
502
+/*
503
+ * If set, then this is a Consumer Electronics (CE) video format. Such formats
504
+ * differ from other formats (commonly called IT formats) in that if RGB
505
+ * encoding is used then by default the RGB values use limited range (i.e.
506
+ * use the range 16-235) as opposed to 0-255. All formats defined in CEA-861
507
+ * except for the 640x480 format are CE formats.
508
+ */
509
+#define V4L2_DV_FL_IS_CE_VIDEO			(1 << 4)
510
+/* Some formats like SMPTE-125M have an interlaced signal with a odd
511
+ * total height. For these formats, if this flag is set, the first
512
+ * field has the extra line. If not, it is the second field.
513
+ */
514
+#define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE	(1 << 5)
515
+/*
516
+ * If set, then the picture_aspect field is valid. Otherwise assume that the
517
+ * pixels are square, so the picture aspect ratio is the same as the width to
518
+ * height ratio.
519
+ */
520
+#define V4L2_DV_FL_HAS_PICTURE_ASPECT		(1 << 6)
521
+/*
522
+ * If set, then the cea861_vic field is valid and contains the Video
523
+ * Identification Code as per the CEA-861 standard.
524
+ */
525
+#define V4L2_DV_FL_HAS_CEA861_VIC		(1 << 7)
526
+/*
527
+ * If set, then the hdmi_vic field is valid and contains the Video
528
+ * Identification Code as per the HDMI standard (HDMI Vendor Specific
529
+ * InfoFrame).
530
+ */
531
+#define V4L2_DV_FL_HAS_HDMI_VIC			(1 << 8)
532
 
533
 /* A few useful defines to calculate the total blanking and frame sizes */
534
 #define V4L2_DV_BT_BLANKING_WIDTH(bt) \
535
@@ -1252,6 +1523,7 @@ struct v4l2_input {
536
 /*  Values for the 'type' field */
537
 #define V4L2_INPUT_TYPE_TUNER		1
538
 #define V4L2_INPUT_TYPE_CAMERA		2
539
+#define V4L2_INPUT_TYPE_TOUCH		3
540
 
541
 /* field 'status' - general */
542
 #define V4L2_IN_ST_NO_POWER    0x00000001  /* Attached device is off */
543
@@ -1266,6 +1538,8 @@ struct v4l2_input {
544
 /* field 'status' - analog */
545
 #define V4L2_IN_ST_NO_H_LOCK   0x00000100  /* No horizontal sync lock */
546
 #define V4L2_IN_ST_COLOR_KILL  0x00000200  /* Color killer is active */
547
+#define V4L2_IN_ST_NO_V_LOCK   0x00000400  /* No vertical sync lock */
548
+#define V4L2_IN_ST_NO_STD_LOCK 0x00000800  /* No standard format lock */
549
 
550
 /* field 'status' - digital */
551
 #define V4L2_IN_ST_NO_SYNC     0x00010000  /* No synchronization lock */
552
@@ -1281,6 +1555,7 @@ struct v4l2_input {
553
 #define V4L2_IN_CAP_DV_TIMINGS		0x00000002 /* Supports S_DV_TIMINGS */
554
 #define V4L2_IN_CAP_CUSTOM_TIMINGS	V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
555
 #define V4L2_IN_CAP_STD			0x00000004 /* Supports S_STD */
556
+#define V4L2_IN_CAP_NATIVE_SIZE		0x00000008 /* Supports setting native size */
557
 
558
 /*
559
  *	V I D E O   O U T P U T S
560
@@ -1340,6 +1615,8 @@ struct v4l2_ext_controls {
561
 #define V4L2_CTRL_ID2CLASS(id)    ((id) & 0x0fff0000UL)
562
 #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
563
 #define V4L2_CTRL_MAX_DIMS	  (4)
564
+#define V4L2_CTRL_WHICH_CUR_VAL   0
565
+#define V4L2_CTRL_WHICH_DEF_VAL   0x0f000000
566
 
567
 enum v4l2_ctrl_type {
568
 	V4L2_CTRL_TYPE_INTEGER	     = 1,
569
@@ -1410,6 +1687,8 @@ struct v4l2_querymenu {
570
 #define V4L2_CTRL_FLAG_WRITE_ONLY 	0x0040
571
 #define V4L2_CTRL_FLAG_VOLATILE		0x0080
572
 #define V4L2_CTRL_FLAG_HAS_PAYLOAD	0x0100
573
+#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE	0x0200
574
+#define V4L2_CTRL_FLAG_MODIFY_LAYOUT	0x0400
575
 
576
 /*  Query flags, to be ORed with the control ID */
577
 #define V4L2_CTRL_FLAG_NEXT_CTRL	0x80000000
578
@@ -1562,8 +1841,6 @@ struct v4l2_audioout {
579
 
580
 /*
581
  *	M P E G   S E R V I C E S
582
- *
583
- *	NOTE: EXPERIMENTAL API
584
  */
585
 #if 1
586
 #define V4L2_ENC_IDX_FRAME_I    (0)
587
@@ -1809,6 +2086,9 @@ struct v4l2_plane_pix_format {
588
  * @plane_fmt:		per-plane information
589
  * @num_planes:		number of planes for this format
590
  * @flags:		format flags (V4L2_PIX_FMT_FLAG_*)
591
+ * @ycbcr_enc:		enum v4l2_ycbcr_encoding, Y'CbCr encoding
592
+ * @quantization:	enum v4l2_quantization, colorspace quantization
593
+ * @xfer_func:		enum v4l2_xfer_func, colorspace transfer function
594
  */
595
 struct v4l2_pix_format_mplane {
596
 	uint32_t				width;
597
@@ -1820,7 +2100,13 @@ struct v4l2_pix_format_mplane {
598
 	struct v4l2_plane_pix_format	plane_fmt[VIDEO_MAX_PLANES];
599
 	uint8_t				num_planes;
600
 	uint8_t				flags;
601
-	uint8_t				reserved[10];
602
+	union {
603
+		uint8_t				ycbcr_enc;
604
+		uint8_t				hsv_enc;
605
+	};
606
+	uint8_t				quantization;
607
+	uint8_t				xfer_func;
608
+	uint8_t				reserved[7];
609
 } __attribute__ ((packed));
610
 
611
 /**
612
@@ -2094,45 +2380,32 @@ struct v4l2_create_buffers {
613
 #define	VIDIOC_DBG_G_REGISTER 	_IOWR('V', 80, struct v4l2_dbg_register)
614
 
615
 #define VIDIOC_S_HW_FREQ_SEEK	 _IOW('V', 82, struct v4l2_hw_freq_seek)
616
-
617
 #define	VIDIOC_S_DV_TIMINGS	_IOWR('V', 87, struct v4l2_dv_timings)
618
 #define	VIDIOC_G_DV_TIMINGS	_IOWR('V', 88, struct v4l2_dv_timings)
619
 #define	VIDIOC_DQEVENT		 _IOR('V', 89, struct v4l2_event)
620
 #define	VIDIOC_SUBSCRIBE_EVENT	 _IOW('V', 90, struct v4l2_event_subscription)
621
 #define	VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
622
-
623
-/* Experimental, the below two ioctls may change over the next couple of kernel
624
-   versions */
625
 #define VIDIOC_CREATE_BUFS	_IOWR('V', 92, struct v4l2_create_buffers)
626
 #define VIDIOC_PREPARE_BUF	_IOWR('V', 93, struct v4l2_buffer)
627
-
628
-/* Experimental selection API */
629
 #define VIDIOC_G_SELECTION	_IOWR('V', 94, struct v4l2_selection)
630
 #define VIDIOC_S_SELECTION	_IOWR('V', 95, struct v4l2_selection)
631
-
632
-/* Experimental, these two ioctls may change over the next couple of kernel
633
-   versions. */
634
 #define VIDIOC_DECODER_CMD	_IOWR('V', 96, struct v4l2_decoder_cmd)
635
 #define VIDIOC_TRY_DECODER_CMD	_IOWR('V', 97, struct v4l2_decoder_cmd)
636
-
637
-/* Experimental, these three ioctls may change over the next couple of kernel
638
-   versions. */
639
 #define VIDIOC_ENUM_DV_TIMINGS  _IOWR('V', 98, struct v4l2_enum_dv_timings)
640
 #define VIDIOC_QUERY_DV_TIMINGS  _IOR('V', 99, struct v4l2_dv_timings)
641
 #define VIDIOC_DV_TIMINGS_CAP   _IOWR('V', 100, struct v4l2_dv_timings_cap)
642
-
643
-/* Experimental, this ioctl may change over the next couple of kernel
644
-   versions. */
645
 #define VIDIOC_ENUM_FREQ_BANDS	_IOWR('V', 101, struct v4l2_frequency_band)
646
 
647
-/* Experimental, meant for debugging, testing and internal use.
648
-   Never use these in applications! */
649
+/*
650
+ * Experimental, meant for debugging, testing and internal use.
651
+ * Never use this in applications!
652
+ */
653
 #define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct v4l2_dbg_chip_info)
654
 
655
 #define VIDIOC_QUERY_EXT_CTRL	_IOWR('V', 103, struct v4l2_query_ext_ctrl)
656
 
657
 /* Reminder: when adding new ioctls please add support for them to
658
-   drivers/media/video/v4l2-compat-ioctl32.c as well! */
659
+   drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */
660
 
661
 #define BASE_VIDIOC_PRIVATE	192		/* 192-255 are private */
662
 
(-)multimedia/libv4l/files/patch-include_linux_dvb_frontend.h (-17 lines)
Lines 1-17 Link Here
1
--- include/linux/dvb/frontend.h.orig	2015-01-10 15:04:07.446370686 +0100
2
+++ include/linux/dvb/frontend.h	2015-01-10 15:05:20.367365809 +0100
3
@@ -549,7 +549,13 @@
4
 };
5
 
6
 #define FE_SET_PROPERTY		   _IOW('o', 82, struct dtv_properties)
7
-#define FE_GET_PROPERTY		   _IOR('o', 83, struct dtv_properties)
8
+/* 
9
+ * This is broken on linux as well but they workaround it in the driver.
10
+ * Since this is impossible to do on FreeBSD fix the header instead.
11
+ * Detailed and discussion :
12
+ * http://lists.freebsd.org/pipermail/freebsd-multimedia/2010-April/010958.html
13
+ */
14
+#define FE_GET_PROPERTY		   _IOW('o', 83, struct dtv_properties)
15
 
16
 
17
 /**
(-)multimedia/libv4l/files/patch-include_linux_dvb_video.h (-11 lines)
Lines 1-11 Link Here
1
--- include/linux/dvb/video.h.orig	2015-01-10 15:05:58.438363362 +0100
2
+++ include/linux/dvb/video.h	2015-01-10 15:06:25.350361374 +0100
3
@@ -133,7 +133,7 @@
4
 #define VIDEO_EVENT_FRAME_RATE_CHANGED	2
5
 #define VIDEO_EVENT_DECODER_STOPPED 	3
6
 #define VIDEO_EVENT_VSYNC 		4
7
-	__kernel_time_t timestamp;
8
+	struct timespec timestamp;
9
 	union {
10
 		video_size_t size;
11
 		unsigned int frame_rate;	/* in frames per 1000sec */
(-)multimedia/libv4l/files/patch-lib_Makefile.in (-13 lines)
Lines 1-13 Link Here
1
--- lib/Makefile.in.orig	2015-01-12 10:51:50.193906738 +0100
2
+++ lib/Makefile.in	2015-01-12 10:52:04.848018891 +0100
3
@@ -77,8 +77,8 @@
4
 POST_UNINSTALL = :
5
 build_triplet = @build@
6
 host_triplet = @host@
7
-@LINUX_OS_TRUE@am__append_1 = \
8
-@LINUX_OS_TRUE@	libdvbv5
9
+am__append_1 = \
10
+	libdvbv5
11
 
12
 subdir = lib
13
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
(-)multimedia/libv4l/files/patch-lib_include_libdvbv5_descriptors.h (+20 lines)
Line 0 Link Here
1
--- lib/include/libdvbv5/descriptors.h.orig	2020-04-09 16:29:54 UTC
2
+++ lib/include/libdvbv5/descriptors.h
3
@@ -87,6 +87,9 @@ typedef void (*dvb_table_init_func)(struct dvb_v5_fe_p
4
 extern const dvb_table_init_func dvb_table_initializers[256];
5
 
6
 #ifndef _DOXYGEN
7
+#ifdef __FreeBSD__
8
+#include <sys/endian.h>
9
+#else
10
 #define bswap16(b) do {\
11
 	b = ntohs(b); \
12
 } while (0)
13
@@ -94,6 +97,7 @@ extern const dvb_table_init_func dvb_table_initializer
14
 #define bswap32(b) do {\
15
 	b = ntohl(b); \
16
 } while (0)
17
+#endif
18
 
19
 /* Deprecated */
20
 #define DVB_DESC_HEADER() \
(-)multimedia/libv4l/files/patch-lib_include_libdvbv5_dvb-frontend.h (-8 / +11 lines)
Lines 1-17 Link Here
1
--- ./lib/include/libdvbv5/dvb-frontend.h.orig	2016-09-13 19:57:29.863954000 +0200
1
--- lib/include/libdvbv5/dvb-frontend.h.orig	2020-04-09 16:29:54 UTC
2
+++ ./lib/include/libdvbv5/dvb-frontend.h	2016-09-13 19:58:07.703108000 +0200
2
+++ lib/include/libdvbv5/dvb-frontend.h
3
@@ -553,7 +553,13 @@
3
@@ -908,7 +908,17 @@ struct dtv_properties {
4
 };
4
 #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
5
 
5
 
6
 #define FE_SET_PROPERTY		   _IOW('o', 82, struct dtv_properties)
6
 #define FE_SET_PROPERTY		   _IOW('o', 82, struct dtv_properties)
7
-#define FE_GET_PROPERTY		   _IOR('o', 83, struct dtv_properties)
7
+#ifdef __linux__
8
+/* 
8
 #define FE_GET_PROPERTY		   _IOR('o', 83, struct dtv_properties)
9
+ * This is broken on linux as well but they workaround it in the driver.
9
+#else
10
+/*
11
+ * This is broken on Linux as well but they workaround it in the driver.
10
+ * Since this is impossible to do on FreeBSD fix the header instead.
12
+ * Since this is impossible to do on FreeBSD fix the header instead.
11
+ * Detailed and discussion :
13
+ * Detailed and discussion :
12
+ * http://lists.freebsd.org/pipermail/freebsd-multimedia/2010-April/010958.html
14
+ * http://lists.freebsd.org/pipermail/freebsd-multimedia/2010-April/010958.html
13
+ */
15
+ */
14
+#define FE_GET_PROPERTY		   _IOW('o', 83, struct dtv_properties)
16
+#define FE_GET_PROPERTY		   _IOW('o', 83, struct dtv_properties)
17
+#endif
15
 
18
 
16
 
19
 
17
 /**
20
 /*
(-)multimedia/libv4l/files/patch-lib_libdvbv5_dvb-dev-remote.c (+14 lines)
Line 0 Link Here
1
--- lib/libdvbv5/dvb-dev-remote.c.orig	2020-04-09 16:29:54 UTC
2
+++ lib/libdvbv5/dvb-dev-remote.c
3
@@ -32,9 +32,11 @@
4
 #include <libudev.h>
5
 #include <stdio.h>
6
 #include <stdlib.h>
7
+#include <stdarg.h>
8
 #include <locale.h>
9
 #include <pthread.h>
10
 #include <unistd.h>
11
+#include <netinet/in.h>
12
 #include <resolv.h>
13
 #include <string.h>
14
 #include <sys/socket.h>
(-)multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c (-5 / +5 lines)
Lines 1-6 Link Here
1
--- lib/libv4lconvert/control/libv4lcontrol.c.orig	2014-07-26 21:33:00.000000000 +0200
1
--- lib/libv4lconvert/control/libv4lcontrol.c.orig	2020-04-09 16:29:54 UTC
2
+++ lib/libv4lconvert/control/libv4lcontrol.c	2015-01-11 09:40:05.521158993 +0100
2
+++ lib/libv4lconvert/control/libv4lcontrol.c
3
@@ -361,6 +361,16 @@
3
@@ -360,6 +360,16 @@ static int v4lcontrol_get_usb_info(struct v4lcontrol_d
4
 		unsigned short *vendor_id, unsigned short *product_id,
4
 		unsigned short *vendor_id, unsigned short *product_id,
5
 		int *speed)
5
 		int *speed)
6
 {
6
 {
Lines 15-23 Link Here
15
+	return (0);
15
+	return (0);
16
+#else
16
+#else
17
 	FILE *f;
17
 	FILE *f;
18
 	int i, minor;
18
 	int i, minor_dev;
19
 	struct stat st;
19
 	struct stat st;
20
@@ -457,6 +467,7 @@
20
@@ -456,6 +466,7 @@ static int v4lcontrol_get_usb_info(struct v4lcontrol_d
21
 		return 0; /* Should never happen */
21
 		return 0; /* Should never happen */
22
 
22
 
23
 	return 1;
23
 	return 1;
(-)multimedia/libv4l/files/patch-lib_libv4lconvert_jpeg__memsrcdest.h (-16 lines)
Lines 1-16 Link Here
1
--- lib/libv4lconvert/jpeg_memsrcdest.h.orig	2012-05-10 18:10:34 UTC
2
+++ lib/libv4lconvert/jpeg_memsrcdest.h
3
@@ -1,5 +1,7 @@
4
 #include <jpeglib.h>
5
 
6
+#if JPEG_LIB_VERSION < 80
7
+
8
 void
9
 jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
10
 	unsigned long bufsize);
11
@@ -7,3 +9,5 @@ jpeg_mem_src (j_decompress_ptr cinfo, un
12
 void
13
 jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer,
14
 	unsigned long * outsize);
15
+
16
+#endif
(-)multimedia/libv4l/files/patch-lib_libv4lconvert_rgbyuv.c (+11 lines)
Line 0 Link Here
1
--- lib/libv4lconvert/rgbyuv.c.orig	2020-04-09 16:29:54 UTC
2
+++ lib/libv4lconvert/rgbyuv.c
3
@@ -893,7 +893,7 @@ void v4lconvert_nv12_to_yuv420(const unsigned char *sr
4
 	}
5
 
6
 	for (i = 0; i < height; i++)
7
-		for (j = 0; i < width; j++) {
8
+		for (j = 0; j < width; j++) {
9
 			*ydst++ = *ysrc++;
10
 			if (((i % 2) == 0) && ((j % 2) == 0)) {
11
 				*udst++ = *uvsrc++;
(-)multimedia/libv4l/files/patch-utils_Makefile.in (-11 lines)
Lines 1-11 Link Here
1
--- utils/Makefile.in.orig	2015-01-25 19:52:31.619994565 +0100
2
+++ utils/Makefile.in	2015-01-25 19:53:34.975249497 +0100
3
@@ -374,7 +374,7 @@
4
 top_srcdir = @top_srcdir@
5
 udevrulesdir = @udevrulesdir@
6
 SUBDIRS = dvb libv4l2util libmedia_dev decode_tm6000 keytable \
7
-	media-ctl v4l2-compliance v4l2-ctl v4l2-dbg v4l2-sysfs-path \
8
+	v4l2-compliance v4l2-dbg v4l2-sysfs-path \
9
 	rds-ctl $(am__append_1) $(am__append_2) $(am__append_3)
10
 all: all-recursive
11
 
(-)multimedia/libv4l/files/patch-utils_cec-ctl_msg2ctl.pl (+11 lines)
Line 0 Link Here
1
--- utils/cec-ctl/msg2ctl.pl.orig	2020-04-09 16:29:54 UTC
2
+++ utils/cec-ctl/msg2ctl.pl
3
@@ -49,7 +49,7 @@ sub process_func
4
 	}
5
 	my @args = split(/, */, $func_args);
6
 	my $has_struct = $func_args =~ /struct/;
7
-	return if ($func_args =~ /__u\d+\s*\*/);
8
+	return if ($func_args =~ /__u\d+\s*\*/ || $func_args =~ /uint\d+_t\s*\*/);
9
 
10
 	my $cec_msg = $msg;
11
 	while ($cec_msg ne "" && !exists($msgs{$cec_msg})) {
(-)multimedia/libv4l/files/patch-utils_common_ir-encode.c (+322 lines)
Line 0 Link Here
1
--- utils/common/ir-encode.c.orig	2020-04-09 16:29:54 UTC
2
+++ utils/common/ir-encode.c
3
@@ -34,17 +34,18 @@ static int nec_encode(enum rc_proto proto, unsigned sc
4
 	const int nec_unit = 562500;
5
 	int n = 0;
6
 
7
-	void add_byte(unsigned bits)
8
-	{
9
-		int i;
10
-		for (i=0; i<8; i++) {
11
-			buf[n++] = NS_TO_US(nec_unit);
12
-			if (bits & (1 << i))
13
-				buf[n++] = NS_TO_US(nec_unit * 3);
14
-			else
15
-				buf[n++] = NS_TO_US(nec_unit);
16
-		}
17
-	}
18
+#define	add_byte(__bits)						\
19
+	do {								\
20
+		const unsigned bits = (__bits);				\
21
+		int i;							\
22
+		for (i=0; i<8; i++) {					\
23
+			buf[n++] = NS_TO_US(nec_unit);			\
24
+			if (bits & (1U << i))				\
25
+				buf[n++] = NS_TO_US(nec_unit * 3);	\
26
+			else						\
27
+				buf[n++] = NS_TO_US(nec_unit);		\
28
+		}							\
29
+	} while (0)
30
 
31
 	buf[n++] = NS_TO_US(nec_unit * 16);
32
 	buf[n++] = NS_TO_US(nec_unit * 8);
33
@@ -73,7 +74,7 @@ static int nec_encode(enum rc_proto proto, unsigned sc
34
 	}
35
 
36
 	buf[n++] = NS_TO_US(nec_unit);
37
-
38
+#undef add_bits
39
 	return n;
40
 }
41
 
42
@@ -108,19 +109,21 @@ static int sanyo_encode(enum rc_proto proto, unsigned 
43
 {
44
 	const int sanyo_unit = 562500;
45
 
46
-	void add_bits(int bits, int count)
47
-	{
48
-		int i;
49
-		for (i=0; i<count; i++) {
50
-			*buf++ = NS_TO_US(sanyo_unit);
51
+#define	add_bits(__bits, __count)					\
52
+	do {								\
53
+		const unsigned bits = (__bits);				\
54
+		const int count = (__count);				\
55
+		int i;							\
56
+		for (i=0; i<count; i++) {				\
57
+			*buf++ = NS_TO_US(sanyo_unit);			\
58
+									\
59
+			if (bits & (1U << i))				\
60
+				*buf++ = NS_TO_US(sanyo_unit * 3);	\
61
+			else						\
62
+				*buf++ = NS_TO_US(sanyo_unit);		\
63
+		}							\
64
+	} while (0)
65
 
66
-			if (bits & (1 << i))
67
-				*buf++ = NS_TO_US(sanyo_unit * 3);
68
-			else
69
-				*buf++ = NS_TO_US(sanyo_unit);
70
-		}
71
-	}
72
-
73
 	*buf++ = NS_TO_US(sanyo_unit * 16);
74
 	*buf++ = NS_TO_US(sanyo_unit * 8);
75
 
76
@@ -130,7 +133,7 @@ static int sanyo_encode(enum rc_proto proto, unsigned 
77
 	add_bits(~scancode, 8);
78
 
79
 	*buf = NS_TO_US(sanyo_unit);
80
-
81
+#undef add_bits
82
 	return 87;
83
 }
84
 
85
@@ -138,19 +141,21 @@ static int sharp_encode(enum rc_proto proto, unsigned 
86
 {
87
 	const int sharp_unit = 40000;
88
 
89
-	void add_bits(int bits, int count)
90
-	{
91
-		int i;
92
-		for (i=0; i<count; i++) {
93
-			*buf++ = NS_TO_US(sharp_unit * 8);
94
+#define	add_bits(__bits, __count)					\
95
+	do {								\
96
+		const unsigned bits = (__bits);				\
97
+		const int count = (__count);				\
98
+		int i;							\
99
+		for (i=0; i<count; i++) {				\
100
+			*buf++ = NS_TO_US(sharp_unit * 8);		\
101
+									\
102
+			if (bits & (1U << i))				\
103
+				*buf++ = NS_TO_US(sharp_unit * 50);	\
104
+			else						\
105
+				*buf++ = NS_TO_US(sharp_unit * 25);	\
106
+		}							\
107
+	} while (0)
108
 
109
-			if (bits & (1 << i))
110
-				*buf++ = NS_TO_US(sharp_unit * 50);
111
-			else
112
-				*buf++ = NS_TO_US(sharp_unit * 25);
113
-		}
114
-	}
115
-
116
 	add_bits(scancode >> 8, 5);
117
 	add_bits(scancode, 8);
118
 	add_bits(1, 2);
119
@@ -162,7 +167,7 @@ static int sharp_encode(enum rc_proto proto, unsigned 
120
 	add_bits(~scancode, 8);
121
 	add_bits(~1, 2);
122
 	*buf++ = NS_TO_US(sharp_unit * 8);
123
-
124
+#undef add_bits
125
 	return (13 + 2) * 4 + 3;
126
 }
127
 
128
@@ -171,19 +176,21 @@ static int sony_encode(enum rc_proto proto, unsigned s
129
 	const int sony_unit = 600000;
130
 	int n = 0;
131
 
132
-	void add_bits(int bits, int count)
133
-	{
134
-		int i;
135
-		for (i=0; i<count; i++) {
136
-			if (bits & (1 << i))
137
-				buf[n++] = NS_TO_US(sony_unit * 2);
138
-			else
139
-				buf[n++] = NS_TO_US(sony_unit);
140
+#define	add_bits(__bits, __count)					\
141
+	do {								\
142
+		const unsigned bits = (__bits);				\
143
+		const int count = (__count);				\
144
+		int i;							\
145
+		for (i=0; i<count; i++) {				\
146
+			if (bits & (1U << i))				\
147
+				buf[n++] = NS_TO_US(sony_unit * 2);	\
148
+			else						\
149
+				buf[n++] = NS_TO_US(sony_unit);		\
150
+									\
151
+			buf[n++] = NS_TO_US(sony_unit);			\
152
+		}							\
153
+	} while (0)
154
 
155
-			buf[n++] = NS_TO_US(sony_unit);
156
-		}
157
-	}
158
-
159
 	buf[n++] = NS_TO_US(sony_unit * 4);
160
 	buf[n++] = NS_TO_US(sony_unit);
161
 
162
@@ -204,7 +211,7 @@ static int sony_encode(enum rc_proto proto, unsigned s
163
 	default:
164
 		return 0;
165
 	}
166
-
167
+#undef add_bits
168
 	/* ignore last space */
169
 	return n - 1;
170
 }
171
@@ -214,34 +221,38 @@ static int rc5_encode(enum rc_proto proto, unsigned sc
172
 	const unsigned int rc5_unit = 888888;
173
 	unsigned n = 0;
174
 
175
-	void advance_space(unsigned length)
176
-	{
177
-		if (n % 2)
178
-			buf[n] += length;
179
-		else
180
-			buf[++n] = length;
181
-	}
182
+#define	advance_space(__length)				\
183
+	do {						\
184
+		const unsigned length = (__length);	\
185
+		if (n % 2)				\
186
+			buf[n] += length;		\
187
+		else					\
188
+			buf[++n] = length;		\
189
+	} while (0)
190
 
191
-	void advance_pulse(unsigned length)
192
-	{
193
-		if (n % 2)
194
-			buf[++n] = length;
195
-		else
196
-			buf[n] += length;
197
-	}
198
+#define	advance_pulse(__length)				\
199
+	do {						\
200
+		const unsigned length = (__length);	\
201
+		if (n % 2)				\
202
+			buf[++n] = length;		\
203
+		else					\
204
+			buf[n] += length;		\
205
+	} while (0)
206
 
207
-	void add_bits(int bits, int count)
208
-	{
209
-		while (count--) {
210
-			if (bits & (1 << count)) {
211
-				advance_space(NS_TO_US(rc5_unit));
212
-				advance_pulse(NS_TO_US(rc5_unit));
213
-			} else {
214
-				advance_pulse(NS_TO_US(rc5_unit));
215
-				advance_space(NS_TO_US(rc5_unit));
216
-			}
217
-		}
218
-	}
219
+#define	add_bits(__bits, __count)					\
220
+	do {								\
221
+		const unsigned bits = (__bits);				\
222
+		int count = (__count);					\
223
+		while (count--) {					\
224
+			if (bits & (1U << count)) {			\
225
+				advance_space(NS_TO_US(rc5_unit));	\
226
+				advance_pulse(NS_TO_US(rc5_unit));	\
227
+			} else {					\
228
+				advance_pulse(NS_TO_US(rc5_unit));	\
229
+				advance_space(NS_TO_US(rc5_unit));	\
230
+			}						\
231
+		}							\
232
+	} while (0)
233
 
234
 	buf[n] = NS_TO_US(rc5_unit);
235
 
236
@@ -269,7 +280,9 @@ static int rc5_encode(enum rc_proto proto, unsigned sc
237
 		add_bits(scancode, 6);
238
 		break;
239
 	}
240
-
241
+#undef advance_space
242
+#undef advance_pulse
243
+#undef add_bits
244
 	/* drop any trailing pulse */
245
 	return (n % 2) ? n : n + 1;
246
 }
247
@@ -279,34 +292,38 @@ static int rc6_encode(enum rc_proto proto, unsigned sc
248
 	const unsigned int rc6_unit = 444444;
249
 	unsigned n = 0;
250
 
251
-	void advance_space(unsigned length)
252
-	{
253
-		if (n % 2)
254
-			buf[n] += length;
255
-		else
256
-			buf[++n] = length;
257
-	}
258
+#define	advance_space(__length)				\
259
+	do {						\
260
+		const unsigned length = (__length);	\
261
+		if (n % 2)				\
262
+			buf[n] += length;		\
263
+		else					\
264
+			buf[++n] = length;		\
265
+	} while (0)
266
 
267
-	void advance_pulse(unsigned length)
268
-	{
269
-		if (n % 2)
270
-			buf[++n] = length;
271
-		else
272
-			buf[n] += length;
273
-	}
274
+#define	advance_pulse(__length)				\
275
+	do {						\
276
+		const unsigned length = (__length);	\
277
+		if (n % 2)				\
278
+			buf[++n] = length;		\
279
+		else					\
280
+			buf[n] += length;		\
281
+	} while (0)
282
 
283
-	void add_bits(unsigned bits, unsigned count, unsigned length)
284
-	{
285
-		while (count--) {
286
-			if (bits & (1 << count)) {
287
-				advance_pulse(length);
288
-				advance_space(length);
289
-			} else {
290
-				advance_space(length);
291
-				advance_pulse(length);
292
-			}
293
-		}
294
-	}
295
+#define	add_bits(__bits, __count, length)		\
296
+	do {						\
297
+		const unsigned bits = (__bits);		\
298
+		int count = (__count);			\
299
+		while (count--) {			\
300
+			if (bits & (1U << count)) {	\
301
+				advance_pulse(length);	\
302
+				advance_space(length);	\
303
+			} else {			\
304
+				advance_space(length);	\
305
+				advance_pulse(length);	\
306
+			}				\
307
+		}					\
308
+	} while (0)
309
 
310
 	buf[n++] = NS_TO_US(rc6_unit * 6);
311
 	buf[n++] = NS_TO_US(rc6_unit * 2);
312
@@ -337,7 +354,9 @@ static int rc6_encode(enum rc_proto proto, unsigned sc
313
 		add_bits(scancode, 32, NS_TO_US(rc6_unit));
314
 		break;
315
 	}
316
-
317
+#undef advance_space
318
+#undef advance_pulse
319
+#undef add_bits
320
 	/* drop any trailing pulse */
321
 	return (n % 2) ? n : n + 1;
322
 }
(-)multimedia/libv4l/files/patch-utils_common_keymap.h (+32 lines)
Line 0 Link Here
1
--- utils/common/keymap.h.orig	2020-04-09 16:29:54 UTC
2
+++ utils/common/keymap.h
3
@@ -2,6 +2,8 @@
4
 #ifndef __KEYMAP_H
5
 #define __KEYMAP_H
6
 
7
+#include <stdint.h>
8
+
9
 struct keymap {
10
 	struct keymap *next;
11
 	char *name;
12
@@ -20,16 +22,16 @@ struct protocol_param {
13
 
14
 struct scancode_entry {
15
 	struct scancode_entry *next;
16
-	u_int32_t scancode;
17
+	uint32_t scancode;
18
 	char *keycode;
19
 };
20
 
21
 struct raw_entry {
22
 	struct raw_entry *next;
23
-	u_int32_t scancode;
24
-	u_int32_t raw_length;
25
+	uint32_t scancode;
26
+	uint32_t raw_length;
27
 	char *keycode;
28
-	u_int32_t raw[1];
29
+	uint32_t raw[1];
30
 };
31
 
32
 void free_keymap(struct keymap *map);
(-)multimedia/libv4l/files/patch-utils_common_v4l2-tpg.h (+12 lines)
Line 0 Link Here
1
--- utils/common/v4l2-tpg.h.orig	2020-04-09 16:29:54 UTC
2
+++ utils/common/v4l2-tpg.h
3
@@ -22,7 +22,9 @@ typedef int16_t s16;
4
 typedef uint8_t u8;
5
 typedef int8_t s8;
6
 
7
+#ifndef __packed
8
 #define __packed __attribute__((packed))
9
+#endif
10
 #define pr_info printf
11
 #define noinline
12
 
(-)multimedia/libv4l/files/patch-utils_dvb_dvbv5-daemon.c (+14 lines)
Line 0 Link Here
1
--- utils/dvb/dvbv5-daemon.c.orig	2020-04-09 16:29:54 UTC
2
+++ utils/dvb/dvbv5-daemon.c
3
@@ -18,7 +18,11 @@
4
  *
5
  */
6
 
7
+#ifndef __FreeBSD__
8
 #define _XOPEN_SOURCE 600
9
+#else
10
+#define	tdestroy(...) do {} while (0)
11
+#endif
12
 
13
 #define _FILE_OFFSET_BITS 64
14
 #define _LARGEFILE_SOURCE 1
(-)multimedia/libv4l/files/patch-utils_ir-ctl_bpf__encoder.c (+50 lines)
Line 0 Link Here
1
--- utils/ir-ctl/bpf_encoder.c.orig	2020-04-09 16:29:54 UTC
2
+++ utils/ir-ctl/bpf_encoder.c
3
@@ -84,21 +84,23 @@ static void encode_manchester(struct keymap *map, uint
4
 {
5
 	int len = 0, bits, i;
6
 
7
-	void advance_space(unsigned length)
8
-	{
9
-		if (len % 2)
10
-			buf[len] += length;
11
-		else
12
-			buf[++len] = length;
13
-	}
14
+#define	advance_space(__length)				\
15
+	do {						\
16
+		const unsigned length = (__length);	\
17
+		if (len % 2)				\
18
+			buf[len] += length;		\
19
+		else					\
20
+			buf[++len] = length;		\
21
+	} while (0)
22
 
23
-	void advance_pulse(unsigned length)
24
-	{
25
-		if (len % 2)
26
-			buf[++len] = length;
27
-		else
28
-			buf[len] += length;
29
-	}
30
+#define	advance_pulse(__length)				\
31
+	do {						\
32
+		const unsigned length = (__length);	\
33
+		if (len % 2)				\
34
+			buf[++len] = length;		\
35
+		else					\
36
+			buf[len] += length;		\
37
+	} while (0)
38
 
39
 	bits = keymap_param(map, "bits", 14);
40
 
41
@@ -111,7 +113,8 @@ static void encode_manchester(struct keymap *map, uint
42
 			advance_pulse(keymap_param(map, "zero_pulse", 888));
43
 		}
44
 	}
45
-
46
+#undef advance_space
47
+#undef advance_pulse
48
 	/* drop any trailing pulse */
49
         *length = (len % 2) ? len : len + 1;
50
 }
(-)multimedia/libv4l/files/patch-utils_ir-ctl_ir-ctl.c (+10 lines)
Line 0 Link Here
1
--- utils/ir-ctl/ir-ctl.c.orig	2020-04-09 16:29:54 UTC
2
+++ utils/ir-ctl/ir-ctl.c
3
@@ -18,6 +18,7 @@
4
 #include <stdlib.h>
5
 #include <stdbool.h>
6
 #include <stdint.h>
7
+#include <string.h>
8
 #include <sys/types.h>
9
 #include <sys/stat.h>
10
 #include <sys/ioctl.h>
(-)multimedia/libv4l/files/patch-utils_media-ctl_media-ctl.c (+11 lines)
Line 0 Link Here
1
--- utils/media-ctl/media-ctl.c.orig	2020-04-09 16:29:54 UTC
2
+++ utils/media-ctl/media-ctl.c
3
@@ -213,7 +213,7 @@ static void v4l2_subdev_print_dv_timings(const struct 
4
 
5
 		printf(" %ux%u%s%llu (%ux%u)",
6
 		       bt->width, bt->height, bt->interlaced ? "i" : "p",
7
-		       (htotal * vtotal) > 0 ? (bt->pixelclock / (htotal * vtotal)) : 0,
8
+		       ((htotal * vtotal) > 0 ? (bt->pixelclock / (htotal * vtotal)) : 0ULL),
9
 		       htotal, vtotal);
10
 
11
 		printf(" stds:");
(-)multimedia/libv4l/files/patch-utils_v4l2-compliance_v4l2-test-buffers.cpp (+30 lines)
Line 0 Link Here
1
--- utils/v4l2-compliance/v4l2-test-buffers.cpp.orig	2020-04-09 16:29:54 UTC
2
+++ utils/v4l2-compliance/v4l2-test-buffers.cpp
3
@@ -22,6 +22,7 @@
4
 #include <stdlib.h>
5
 #include <stdio.h>
6
 #include <string.h>
7
+#include <signal.h>
8
 #include <inttypes.h>
9
 #include <sys/types.h>
10
 #include <sys/stat.h>
11
@@ -48,8 +49,8 @@
12
 #define VIVID_CID_QUEUE_ERROR		(VIVID_CID_VIVID_BASE + 70)
13
 #define VIVID_CID_REQ_VALIDATE_ERROR	(VIVID_CID_VIVID_BASE + 72)
14
 
15
-static struct cv4l_fmt cur_fmt;
16
-static struct cv4l_fmt cur_m2m_fmt;
17
+static cv4l_fmt cur_fmt;
18
+static cv4l_fmt cur_m2m_fmt;
19
 static int stream_from_fd = -1;
20
 static bool stream_use_hdr;
21
 
22
@@ -354,7 +355,7 @@ int buffer::check(unsigned type, unsigned memory, unsi
23
 	unsigned timestamp_src = g_timestamp_src();
24
 	unsigned frame_types = 0;
25
 	unsigned buf_states = 0;
26
-	const struct cv4l_fmt &fmt = is_m2m ? cur_m2m_fmt : cur_fmt;
27
+	const cv4l_fmt &fmt = is_m2m ? cur_m2m_fmt : cur_fmt;
28
 
29
 	fail_on_test(g_type() != type);
30
 	fail_on_test(g_memory() == 0);
(-)multimedia/libv4l/files/patch-utils_v4l2-ctl_v4l2-ctl-overlay.cpp (+42 lines)
Line 0 Link Here
1
--- utils/v4l2-ctl/v4l2-ctl-overlay.cpp.orig	2020-04-09 16:29:54 UTC
2
+++ utils/v4l2-ctl/v4l2-ctl-overlay.cpp
3
@@ -14,11 +14,12 @@
4
 #include <dirent.h>
5
 #include <math.h>
6
 
7
+#include "v4l2-ctl.h"
8
+
9
+#ifndef __FreeBSD__
10
 #include <linux/fb.h>
11
 #include <vector>
12
 
13
-#include "v4l2-ctl.h"
14
-
15
 static unsigned int set_fbuf;
16
 static unsigned int set_overlay_fmt;
17
 static struct v4l2_format overlay_fmt;	/* set_format/get_format video overlay */
18
@@ -546,3 +547,24 @@ void overlay_list(cv4l_fd &fd)
19
 	if (options[OptFindFb])
20
 		find_fb(fd.g_fd());
21
 }
22
+#else
23
+void overlay_usage(void)
24
+{
25
+}
26
+
27
+void overlay_cmd(int ch, char *optarg)
28
+{
29
+}
30
+
31
+void overlay_set(cv4l_fd &_fd)
32
+{
33
+}
34
+
35
+void overlay_get(cv4l_fd &_fd)
36
+{
37
+}
38
+
39
+void overlay_list(cv4l_fd &fd)
40
+{
41
+}
42
+#endif
(-)multimedia/libv4l/files/patch-utils_v4l2-ctl_v4l2-ctl.cpp (-54 lines)
Lines 1-54 Link Here
1
--- utils/v4l2-ctl/v4l2-ctl.cpp.orig	2015-06-14 00:23:03.316457000 -0400
2
+++ utils/v4l2-ctl/v4l2-ctl.cpp	2015-06-14 00:28:46.421843000 -0400
3
@@ -614,9 +614,50 @@ static std::string cap2s(unsigned cap)
4
 	return s;
5
 }
6
 
7
+#if __FreeBSD_version < 1000000
8
+/* from FreeBSD src/lib/libc/string/strchrnul.c: */
9
+
10
+char *strchrnul(const char *p, int ch);
11
+
12
+char *
13
+strchrnul(const char *p, int ch)
14
+{
15
+	char c;
16
+
17
+	c = ch;
18
+	for (;; ++p) {
19
+		if (*p == c || *p == '\0')
20
+			return ((char *)p);
21
+	}
22
+	/* NOTREACHED */
23
+}
24
+#endif
25
+
26
+int
27
+my_getsubopt(char **optionp, char *const *tokens, char **valuep)
28
+{
29
+	char *endp, *vstart;
30
+	int cnt;
31
+
32
+	if (**optionp == '\0')
33
+	  return -1;
34
+
35
+	/* Find end of next token. */
36
+	endp = strchrnul (*optionp, ',');
37
+
38
+	/* The current suboption does not match any option. */
39
+	*valuep = *optionp;
40
+
41
+	if (*endp != '\0')
42
+		*endp++ = '\0';
43
+	*optionp = endp;
44
+
45
+	return -1;
46
+}
47
+
48
 int parse_subopt(char **subs, const char * const *subopts, char **value)
49
 {
50
-	int opt = getsubopt(subs, (char * const *)subopts, value);
51
+	int opt = my_getsubopt(subs, (char * const *)subopts, value);
52
 
53
 	if (opt == -1) {
54
 		fprintf(stderr, "Invalid suboptions specified\n");
(-)multimedia/libv4l/files/types.h (+35 lines)
Line 0 Link Here
1
#ifndef _LINUX_TYPES_H
2
#define	_LINUX_TYPES_H
3
4
#include <stdint.h>
5
6
#ifndef HAVE_LINUX_INTEGER_TYPES
7
/* XXX remove when depending software has been updated */
8
#ifndef __u64
9
typedef uint64_t __u64;
10
#endif
11
#ifndef __u32
12
typedef uint32_t __u32;
13
#endif
14
#ifndef __u16
15
typedef uint16_t __u16;
16
#endif
17
#ifndef __u8
18
typedef uint8_t __u8;
19
#endif
20
21
#ifndef __s64
22
typedef int64_t __s64;
23
#endif
24
#ifndef __s32
25
typedef int32_t __s32;
26
#endif
27
#ifndef __s16
28
typedef int16_t __s16;
29
#endif
30
#ifndef __s8
31
typedef int8_t __s8;
32
#endif
33
#endif
34
35
#endif
(-)multimedia/libv4l/pkg-plist (+3 lines)
Lines 1-6 Link Here
1
include/libdvbv5/atsc_eit.h
1
include/libdvbv5/atsc_eit.h
2
include/libdvbv5/atsc_header.h
2
include/libdvbv5/atsc_header.h
3
include/libdvbv5/cat.h
3
include/libdvbv5/cat.h
4
include/libdvbv5/countries.h
4
include/libdvbv5/crc32.h
5
include/libdvbv5/crc32.h
5
include/libdvbv5/desc_atsc_service_location.h
6
include/libdvbv5/desc_atsc_service_location.h
6
include/libdvbv5/desc_ca.h
7
include/libdvbv5/desc_ca.h
Lines 23-28 Link Here
23
include/libdvbv5/desc_ts_info.h
24
include/libdvbv5/desc_ts_info.h
24
include/libdvbv5/descriptors.h
25
include/libdvbv5/descriptors.h
25
include/libdvbv5/dvb-demux.h
26
include/libdvbv5/dvb-demux.h
27
include/libdvbv5/dvb-dev.h
26
include/libdvbv5/dvb-fe.h
28
include/libdvbv5/dvb-fe.h
27
include/libdvbv5/dvb-file.h
29
include/libdvbv5/dvb-file.h
28
include/libdvbv5/dvb-frontend.h
30
include/libdvbv5/dvb-frontend.h
Lines 32-37 Link Here
32
include/libdvbv5/dvb-v5-std.h
34
include/libdvbv5/dvb-v5-std.h
33
include/libdvbv5/eit.h
35
include/libdvbv5/eit.h
34
include/libdvbv5/header.h
36
include/libdvbv5/header.h
37
include/libdvbv5/libdvb-version.h
35
include/libdvbv5/mgt.h
38
include/libdvbv5/mgt.h
36
include/libdvbv5/mpeg_es.h
39
include/libdvbv5/mpeg_es.h
37
include/libdvbv5/mpeg_pes.h
40
include/libdvbv5/mpeg_pes.h
(-)multimedia/v4l-utils/Makefile (-1 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME?=	v4l-utils
4
PORTNAME?=	v4l-utils
5
PORTREVISION=	0
6
5
7
COMMENT=	Video4Linux utilities
6
COMMENT=	Video4Linux utilities
8
7
(-)multimedia/v4l-utils/pkg-plist (-8 / +23 lines)
Lines 1-17 Link Here
1
bin/decode_tm6000
1
bin/ivtv-ctl
2
bin/ir-ctl
3
bin/cx18-ctl
4
bin/ir-keytable
5
bin/media-ctl
6
bin/v4l2-ctl
7
@comment bin/v4l2-sysfs-path
8
bin/cec-ctl
9
bin/cec-compliance
10
bin/cec-follower
11
bin/rds-ctl
2
bin/dvb-fe-tool
12
bin/dvb-fe-tool
13
bin/dvbv5-zap
14
bin/dvbv5-scan
3
bin/dvb-format-convert
15
bin/dvb-format-convert
4
bin/dvbv5-scan
16
bin/dvbv5-daemon
5
bin/dvbv5-zap
6
bin/ir-keytable
7
bin/rds-ctl
8
bin/v4l2-compliance
17
bin/v4l2-compliance
9
@comment bin/v4l2-sysfs-path
10
etc/rc_maps.cfg
18
etc/rc_maps.cfg
19
man/man1/v4l2-ctl.1.gz
20
man/man1/cec-ctl.1.gz
21
man/man1/cec-compliance.1.gz
22
man/man1/cec-follower.1.gz
11
man/man1/dvb-fe-tool.1.gz
23
man/man1/dvb-fe-tool.1.gz
12
man/man1/dvb-format-convert.1.gz
24
man/man1/dvbv5-zap.1.gz
13
man/man1/dvbv5-scan.1.gz
25
man/man1/dvbv5-scan.1.gz
14
man/man1/dvbv5-zap.1.gz
26
man/man1/v4l2-compliance.1.gz
27
man/man1/ir-ctl.1.gz
15
man/man1/ir-keytable.1.gz
28
man/man1/ir-keytable.1.gz
29
man/man1/dvb-format-convert.1.gz
30
man/man5/rc_keymap.5.gz
16
sbin/v4l2-dbg
31
sbin/v4l2-dbg
17
@dir etc/rc_keymaps
32
@dir etc/rc_keymaps
(-)multimedia/v4l_compat/Makefile (-22 / +35 lines)
Lines 1-7 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	v4l_compat
3
PORTNAME=	v4l_compat
4
PORTREVISION=	3
5
4
6
COMMENT=	Video4Linux IOCTL header files
5
COMMENT=	Video4Linux IOCTL header files
7
6
Lines 9-41 Link Here
9
NO_ARCH=	yes
8
NO_ARCH=	yes
10
9
11
MASTERDIR=	${.CURDIR}/../libv4l
10
MASTERDIR=	${.CURDIR}/../libv4l
12
EXTRADIR=	${WRKSRC}/../linux
13
DESCR=		${.CURDIR}/pkg-descr
11
DESCR=		${.CURDIR}/pkg-descr
14
PLIST=		${.CURDIR}/pkg-plist
12
PLIST=		${.CURDIR}/pkg-plist
15
13
16
BASE_HEADERS=	ivtv.h v4l2-controls.h \
14
BASE_HEADERS= \
17
		v4l2-common.h videodev2.h
15
	linux/cec.h \
18
DVB_HEADERS=	audio.h dmx.h frontend.h video.h
16
	linux/cec-funcs.h \
19
EXTRA_HEADERS=	ca.h net.h osd.h version.h
17
	linux/dvb/audio.h \
18
	linux/dvb/ca.h \
19
	linux/dvb/dmx.h \
20
	linux/dvb/frontend.h \
21
	linux/dvb/net.h \
22
	linux/dvb/osd.h \
23
	linux/dvb/version.h \
24
	linux/dvb/video.h \
25
	linux/ivtv.h \
26
	linux/lirc.h \
27
	linux/media.h \
28
	linux/media-bus-format.h \
29
	linux/v4l2-common.h \
30
	linux/v4l2-controls.h \
31
	linux/v4l2-mediabus.h \
32
	linux/v4l2-subdev.h \
33
	linux/videodev2.h
20
34
21
do-install:
35
do-install:
22
	@${MKDIR} ${STAGEDIR}${PREFIX}/include/linux/dvb/
36
	@${MKDIR} ${STAGEDIR}${PREFIX}/include/linux/dvb
23
.for i in ${BASE_HEADERS}
37
24
	${INSTALL_DATA} ${WRKSRC}/contrib/freebsd/include/linux/${i} \
38
.for F in ${BASE_HEADERS}
25
		${STAGEDIR}${PREFIX}/include/linux/
39
	${INSTALL_DATA} \
40
		${WRKDIR}/webcamd-${WEBCAMDVERSION}/media_tree/include/uapi/${F} \
41
		${STAGEDIR}${PREFIX}/include/${F}
26
.endfor
42
.endfor
27
.for i in ${DVB_HEADERS}
43
28
	${INSTALL_DATA} ${WRKSRC}/include/linux/dvb/${i} \
44
# V4L1 is dead in upstream Linux, however libv4l still supports it.
29
		${STAGEDIR}${PREFIX}/include/linux/dvb
45
	${INSTALL_DATA} \
30
.endfor
46
		${FILESDIR}/videodev.h \
31
# V4L1 is dead in linux, however webcamd still supports it.
32
	${INSTALL_DATA} ${FILESDIR}/videodev.h \
33
		${STAGEDIR}${PREFIX}/include/linux/
47
		${STAGEDIR}${PREFIX}/include/linux/
34
# Extra dvb headers supplied taken from the linux kernel distfile.
35
# vdr and the gst dvb plugin need them at least
36
.for i in ${EXTRA_HEADERS}
37
	${INSTALL_DATA} ${EXTRADIR}/dvb/${i} \
38
		${STAGEDIR}${PREFIX}/include/linux/dvb/
39
.endfor
40
48
49
# Install types header file
50
	${INSTALL_DATA} \
51
		${FILESDIR}/types.h \
52
		${STAGEDIR}${PREFIX}/include/linux/
53
41
.include "${MASTERDIR}/Makefile"
54
.include "${MASTERDIR}/Makefile"
(-)multimedia/v4l_compat/pkg-plist (-1 / +9 lines)
Lines 1-13 Link Here
1
include/linux/cec.h
2
include/linux/cec-funcs.h
1
include/linux/dvb/audio.h
3
include/linux/dvb/audio.h
2
include/linux/dvb/ca.h
4
include/linux/dvb/ca.h
3
include/linux/dvb/dmx.h
5
include/linux/dvb/dmx.h
6
include/linux/dvb/frontend.h
4
include/linux/dvb/net.h
7
include/linux/dvb/net.h
5
include/linux/dvb/frontend.h
6
include/linux/dvb/osd.h
8
include/linux/dvb/osd.h
7
include/linux/dvb/version.h
9
include/linux/dvb/version.h
8
include/linux/dvb/video.h
10
include/linux/dvb/video.h
9
include/linux/ivtv.h
11
include/linux/ivtv.h
12
include/linux/lirc.h
13
include/linux/media.h
14
include/linux/media-bus-format.h
15
include/linux/types.h
10
include/linux/v4l2-common.h
16
include/linux/v4l2-common.h
11
include/linux/v4l2-controls.h
17
include/linux/v4l2-controls.h
18
include/linux/v4l2-mediabus.h
19
include/linux/v4l2-subdev.h
12
include/linux/videodev.h
20
include/linux/videodev.h
13
include/linux/videodev2.h
21
include/linux/videodev2.h

Return to bug 245501