Date: Fri, 17 Apr 2020 08:34:50 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r531911 - in head/multimedia: libv4l libv4l/files v4l-utils v4l_compat Message-ID: <202004170834.03H8YoK4060398@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri Apr 17 08:34:50 2020 New Revision: 531911 URL: https://svnweb.freebsd.org/changeset/ports/531911 Log: Upgrade v4l_compat, libv4l and v4l-utils to v1.18.0. The most important change is that up-to-date V4L header files are now sourced from the webcamd distribution tarball. Refer to the ChangeLog file in the v4l-utils tarball for a comprehensive list of changes. PR: 245501 Approved by: pi (implicit) Added: head/multimedia/libv4l/files/patch-lib_include_libdvbv5_descriptors.h (contents, props changed) head/multimedia/libv4l/files/patch-lib_libdvbv5_dvb-dev-remote.c (contents, props changed) head/multimedia/libv4l/files/patch-lib_libv4lconvert_rgbyuv.c (contents, props changed) head/multimedia/libv4l/files/patch-utils_cec-ctl_msg2ctl.pl (contents, props changed) head/multimedia/libv4l/files/patch-utils_common_ir-encode.c (contents, props changed) head/multimedia/libv4l/files/patch-utils_common_keymap.h (contents, props changed) head/multimedia/libv4l/files/patch-utils_common_v4l2-tpg.h (contents, props changed) head/multimedia/libv4l/files/patch-utils_dvb_dvbv5-daemon.c (contents, props changed) head/multimedia/libv4l/files/patch-utils_ir-ctl_bpf__encoder.c (contents, props changed) head/multimedia/libv4l/files/patch-utils_ir-ctl_ir-ctl.c (contents, props changed) head/multimedia/libv4l/files/patch-utils_media-ctl_media-ctl.c (contents, props changed) head/multimedia/libv4l/files/patch-utils_v4l2-compliance_v4l2-test-buffers.cpp (contents, props changed) head/multimedia/libv4l/files/patch-utils_v4l2-ctl_v4l2-ctl-overlay.cpp (contents, props changed) head/multimedia/libv4l/files/types.h (contents, props changed) Deleted: head/multimedia/libv4l/files/extra-linux_dvb_ca.h head/multimedia/libv4l/files/extra-linux_dvb_osd.h head/multimedia/libv4l/files/extra-patch-configure head/multimedia/libv4l/files/patch-configure head/multimedia/libv4l/files/patch-contrib_freebsd_include_linux_videodev2.h head/multimedia/libv4l/files/patch-include_linux_dvb_frontend.h head/multimedia/libv4l/files/patch-include_linux_dvb_video.h head/multimedia/libv4l/files/patch-lib_Makefile.in head/multimedia/libv4l/files/patch-lib_libv4lconvert_jpeg__memsrcdest.h head/multimedia/libv4l/files/patch-utils_Makefile.in head/multimedia/libv4l/files/patch-utils_v4l2-ctl_v4l2-ctl.cpp Modified: head/multimedia/libv4l/Makefile head/multimedia/libv4l/distinfo head/multimedia/libv4l/files/patch-lib_include_libdvbv5_dvb-frontend.h head/multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c head/multimedia/libv4l/pkg-plist head/multimedia/v4l-utils/Makefile head/multimedia/v4l-utils/pkg-plist head/multimedia/v4l_compat/Makefile head/multimedia/v4l_compat/pkg-plist Directory Properties: head/multimedia/libv4l/files/videodev.h (props changed) Modified: head/multimedia/libv4l/Makefile ============================================================================== --- head/multimedia/libv4l/Makefile Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/libv4l/Makefile Fri Apr 17 08:34:50 2020 (r531911) @@ -3,13 +3,14 @@ # Check v4l_compat and v4l-utils slave ports PORTNAME?= libv4l -PORTVERSION= 1.6.3 -PORTREVISION?= 4 +PORTVERSION= 1.18.0 CATEGORIES= multimedia MASTER_SITES= http://linuxtv.org/downloads/v4l-utils/:master \ - LOCAL/kwm:local -DISTFILES+= v4l-utils-${PORTVERSION}.tar.bz2:master \ - linux-3.16.7-dvb-headers.tar.xz:local + http://www.selasky.org/hans_petter/distfiles/:local \ + http://home.selasky.org/distfiles/:local +WEBCAMDVERSION= 5.7.1.1 +DISTFILES= v4l-utils-${PORTVERSION}.tar.bz2:master \ + webcamd-${WEBCAMDVERSION}.tar.bz2:local MAINTAINER= multimedia@FreeBSD.org COMMENT?= Video4Linux library @@ -21,51 +22,100 @@ USES= tar:bzip2 WRKSRC= ${WRKDIR}/v4l-utils-${PORTVERSION} .if ${PORTNAME} == v4l-utils || ${PORTNAME} == libv4l -BUILD_DEPENDS+= v4l_compat>=${PORTVERSION}:multimedia/v4l_compat +LIB_DEPENDS+= libargp.so:devel/argp-standalone \ + libudev.so:devel/libudev-devd +BUILD_DEPENDS+= gsed>0:textproc/gsed \ + v4l_compat>=${PORTVERSION}:multimedia/v4l_compat GNU_CONFIGURE= yes CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib USES+= gmake iconv jpeg libtool pathfix pkgconfig USE_LDCONFIG= yes -CONFIGURE_ARGS= --enable-libdvbv5 \ - --disable-qv4l2 \ - --without-libudev +CONFIGURE_ARGS= \ + --disable-qv4l2 \ + --disable-qvidcap \ + --disable-nls INSTALL_TARGET= install-strip +.endif -. if ${PORTNAME} == v4l-utils +.if ${PORTNAME} == v4l_compat +RUN_DEPENDS+= evdev-proto>=5.3:devel/evdev-proto +.endif + +.if ${PORTNAME} == v4l-utils +USES+= perl5 BUILD_DEPENDS+= libv4l>=${PORTVERSION}:multimedia/libv4l -LIB_DEPENDS+= libargp.so:devel/argp-standalone \ +LIB_DEPENDS+= libepoll-shim.so:devel/libepoll-shim \ libv4l2.so:multimedia/libv4l -# Disabling building libv4l in the utils slave is too much hackery -# Lets wait for subpackages -CONFIGURE_ARGS+=--enable-v4l-utils -. else -CONFIGURE_ARGS+=--disable-v4l-utils --enable-libv4l -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure -. endif +LDFLAGS+= -lepoll-shim +CONFIGURE_ARGS+= \ + --enable-v4l-utils \ + --without-v4l2-compliance .endif -HEADER_PATCHES= extra-linux_dvb_ca.h \ - extra-linux_dvb_osd.h \ - patch-include_linux_dvb_frontend.h \ - patch-include_linux_dvb_video.h +.if ${PORTNAME} == libv4l +CONFIGURE_ARGS+= \ + --disable-v4l-utils \ + --enable-dyn-libv4l \ + --enable-libdvbv5 +.endif post-patch: - @${REINPLACE_CMD} -e 's|$$libdir/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \ - ${WRKSRC}/configure -# fix weird types, except a few headers which have compat code for these types. - @${FIND} ${WRKDIR} -type f \( -iname "*.h" ! -iname "input.h" ! -iname "videodev2.h" \) | \ +# Remove old FreeBSD include files (to be removed upstream) + @${RM} -r ${WRKDIR}/v4l-utils-${PORTVERSION}/contrib/freebsd/include/* +# Apply webcamd patches first + @(cd ${WRKDIR}/webcamd-${WEBCAMDVERSION}/patches && ${SH} ./do_patch.sh) +# Patch Makefiles to use GNU-sed + @${FIND} ${WRKDIR}/v4l-utils-${PORTVERSION} -type f \( -iname "Makefile*" \) | \ ${XARGS} -n 10 ${REINPLACE_CMD} \ - -e 's|linux/types.h|sys/types.h|g; s|__user||g; \ - s|__u8|uint8_t|g; s|__s8|int8_t|g; \ - s|__u16|uint16_t|g; s|__s16|int16_t|g; \ - s|__u32|uint32_t|g; s|__s32|int32_t|g; \ - s|__u64|uint64_t|g; s|__s64|int64_t|g' -.if ${PORTNAME} == v4l_compat -.for patch in ${HEADER_PATCHES} - @cd ${WRKDIR}/linux && ${PATCH} -p2 < ${FILESDIR}/${patch} -.endfor -.endif + -e 's|^\([[:space:]]*\)sed |\1${LOCALBASE}/bin/gsed |' +# Patch all source files + @${FIND} ${WRKDIR} -type f \( -iname "*.[ch]" -or -iname "*.cpp" -or -iname "msg2ctl.pl" \) | \ + ${XARGS} -n 10 ${REINPLACE_CMD} \ + -e 's|__inline__|inline|g' \ + -e 's|__u8|uint8_t|g' \ + -e 's|__s8|int8_t|g' \ + -e 's|__le16|uint16_t|g' \ + -e 's|__be16|uint16_t|g' \ + -e 's|__u16|uint16_t|g' \ + -e 's|__s16|int16_t|g' \ + -e 's|__le32|uint32_t|g' \ + -e 's|__be32|uint32_t|g' \ + -e 's|__u32|uint32_t|g' \ + -e 's|__s32|int32_t|g' \ + -e 's|__le64|uint64_t|g' \ + -e 's|__be64|uint64_t|g' \ + -e 's|__u64|uint64_t|g' \ + -e 's|__s64|int64_t|g' \ + -e 's|uint16_t_to_cpu|letoh16|g' \ + -e 's|uint32_t_to_cpu|letoh32|g' \ + -e 's|uint64_t_to_cpu|letoh64|g' \ + -e 's|error_t|int|g' \ + -e 's|"gettext.h"|<stdio.h>|g' \ + -e 's|MSG_MORE|0|g' \ + -e 's|EBADR|EFAULT|g' \ + -e 's|ENONET|EHOSTDOWN|g' \ + -e 's|_IOC_READ|IOC_OUT|g' \ + -e 's|_IOC_WRITE|IOC_IN|g' \ + -e 's|_IOC_NONE|IOC_VOID|g' \ + -e 's|<endian.h>|<sys/endian.h>|g' \ + -e 's|<linux/compiler.h>|<sys/cdefs.h>|g' \ + -e 's|<linux/errno.h>|<errno.h>|g' \ + -e 's|<linux/ioctl.h>|<sys/ioctl.h>|g' \ + -e 's|<linux/kernel.h>|<sys/sysinfo.h>|g' \ + -e 's|<linux/string.h>|<string.h>|g' \ + -e 's|<linux/sysmacros.h>|<sys/types.h>|g' \ + -e 's|<malloc.h>|<stdlib.h>|g' \ + -e 's|<sys/epoll.h>|<libepoll-shim/sys/epoll.h>|g' \ + -e 's|<sys/sysmacros.h>|<sys/types.h>|g' \ + -e 's|/usr/bin/perl|${LOCALBASE}/bin/perl|g' \ + -e 's|__user||g' + +# Duplicate some files to avoid patching + @${CP} ${WRKSRC}/utils/common/ir-encode.c ${WRKSRC}/utils/ir-ctl/ir-encode.c + @${CP} ${WRKSRC}/utils/common/ir-encode.c ${WRKSRC}/utils/keytable/ir-encode.c + @${CP} ${WRKSRC}/utils/common/keymap.h ${WRKSRC}/utils/ir-ctl/keymap.h + @${CP} ${WRKSRC}/utils/common/keymap.h ${WRKSRC}/utils/keytable/keymap.h .include <bsd.port.mk> Modified: head/multimedia/libv4l/distinfo ============================================================================== --- head/multimedia/libv4l/distinfo Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/libv4l/distinfo Fri Apr 17 08:34:50 2020 (r531911) @@ -1,4 +1,5 @@ -SHA256 (v4l-utils-1.6.3.tar.bz2) = 164abf5c1befcd27e8e6ef824a82d4015bdfb5d99ae82daa00e77d895ff9864c -SIZE (v4l-utils-1.6.3.tar.bz2) = 1151081 -SHA256 (linux-3.16.7-dvb-headers.tar.xz) = 0ee217b243d52b8104e6b61bbf009bf84155573317720f41930af0a9ef50cdaa -SIZE (linux-3.16.7-dvb-headers.tar.xz) = 11712 +TIMESTAMP = 1587021105 +SHA256 (v4l-utils-1.18.0.tar.bz2) = 6cb60d822eeed20486a03cc23e0fc65956fbc1e85e0c1a7477f68bbd9802880d +SIZE (v4l-utils-1.18.0.tar.bz2) = 1995506 +SHA256 (webcamd-5.7.1.1.tar.bz2) = e803b245d0e1ecaf5ff07c5a9700f0951d065827d4907c4615369afab3c102c2 +SIZE (webcamd-5.7.1.1.tar.bz2) = 14370502 Added: head/multimedia/libv4l/files/patch-lib_include_libdvbv5_descriptors.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-lib_include_libdvbv5_descriptors.h Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,20 @@ +--- lib/include/libdvbv5/descriptors.h.orig 2020-04-09 16:29:54 UTC ++++ lib/include/libdvbv5/descriptors.h +@@ -87,6 +87,9 @@ typedef void (*dvb_table_init_func)(struct dvb_v5_fe_p + extern const dvb_table_init_func dvb_table_initializers[256]; + + #ifndef _DOXYGEN ++#ifdef __FreeBSD__ ++#include <sys/endian.h> ++#else + #define bswap16(b) do {\ + b = ntohs(b); \ + } while (0) +@@ -94,6 +97,7 @@ extern const dvb_table_init_func dvb_table_initializer + #define bswap32(b) do {\ + b = ntohl(b); \ + } while (0) ++#endif + + /* Deprecated */ + #define DVB_DESC_HEADER() \ Modified: head/multimedia/libv4l/files/patch-lib_include_libdvbv5_dvb-frontend.h ============================================================================== --- head/multimedia/libv4l/files/patch-lib_include_libdvbv5_dvb-frontend.h Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/libv4l/files/patch-lib_include_libdvbv5_dvb-frontend.h Fri Apr 17 08:34:50 2020 (r531911) @@ -1,17 +1,20 @@ ---- ./lib/include/libdvbv5/dvb-frontend.h.orig 2016-09-13 19:57:29.863954000 +0200 -+++ ./lib/include/libdvbv5/dvb-frontend.h 2016-09-13 19:58:07.703108000 +0200 -@@ -553,7 +553,13 @@ - }; +--- lib/include/libdvbv5/dvb-frontend.h.orig 2020-04-09 16:29:54 UTC ++++ lib/include/libdvbv5/dvb-frontend.h +@@ -908,7 +908,17 @@ struct dtv_properties { + #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ #define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties) --#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties) -+/* -+ * This is broken on linux as well but they workaround it in the driver. ++#ifdef __linux__ + #define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties) ++#else ++/* ++ * This is broken on Linux as well but they workaround it in the driver. + * Since this is impossible to do on FreeBSD fix the header instead. + * Detailed and discussion : + * http://lists.freebsd.org/pipermail/freebsd-multimedia/2010-April/010958.html + */ +#define FE_GET_PROPERTY _IOW('o', 83, struct dtv_properties) ++#endif - /** + /* Added: head/multimedia/libv4l/files/patch-lib_libdvbv5_dvb-dev-remote.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-lib_libdvbv5_dvb-dev-remote.c Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,14 @@ +--- lib/libdvbv5/dvb-dev-remote.c.orig 2020-04-09 16:29:54 UTC ++++ lib/libdvbv5/dvb-dev-remote.c +@@ -32,9 +32,11 @@ + #include <libudev.h> + #include <stdio.h> + #include <stdlib.h> ++#include <stdarg.h> + #include <locale.h> + #include <pthread.h> + #include <unistd.h> ++#include <netinet/in.h> + #include <resolv.h> + #include <string.h> + #include <sys/socket.h> Modified: head/multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c ============================================================================== --- head/multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c Fri Apr 17 08:34:50 2020 (r531911) @@ -1,6 +1,6 @@ ---- lib/libv4lconvert/control/libv4lcontrol.c.orig 2014-07-26 21:33:00.000000000 +0200 -+++ lib/libv4lconvert/control/libv4lcontrol.c 2015-01-11 09:40:05.521158993 +0100 -@@ -361,6 +361,16 @@ +--- lib/libv4lconvert/control/libv4lcontrol.c.orig 2020-04-09 16:29:54 UTC ++++ lib/libv4lconvert/control/libv4lcontrol.c +@@ -360,6 +360,16 @@ static int v4lcontrol_get_usb_info(struct v4lcontrol_d unsigned short *vendor_id, unsigned short *product_id, int *speed) { @@ -15,9 +15,9 @@ + return (0); +#else FILE *f; - int i, minor; + int i, minor_dev; struct stat st; -@@ -457,6 +467,7 @@ +@@ -456,6 +466,7 @@ static int v4lcontrol_get_usb_info(struct v4lcontrol_d return 0; /* Should never happen */ return 1; Added: head/multimedia/libv4l/files/patch-lib_libv4lconvert_rgbyuv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-lib_libv4lconvert_rgbyuv.c Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,11 @@ +--- lib/libv4lconvert/rgbyuv.c.orig 2020-04-09 16:29:54 UTC ++++ lib/libv4lconvert/rgbyuv.c +@@ -893,7 +893,7 @@ void v4lconvert_nv12_to_yuv420(const unsigned char *sr + } + + for (i = 0; i < height; i++) +- for (j = 0; i < width; j++) { ++ for (j = 0; j < width; j++) { + *ydst++ = *ysrc++; + if (((i % 2) == 0) && ((j % 2) == 0)) { + *udst++ = *uvsrc++; Added: head/multimedia/libv4l/files/patch-utils_cec-ctl_msg2ctl.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_cec-ctl_msg2ctl.pl Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,11 @@ +--- utils/cec-ctl/msg2ctl.pl.orig 2020-04-09 16:29:54 UTC ++++ utils/cec-ctl/msg2ctl.pl +@@ -49,7 +49,7 @@ sub process_func + } + my @args = split(/, */, $func_args); + my $has_struct = $func_args =~ /struct/; +- return if ($func_args =~ /__u\d+\s*\*/); ++ return if ($func_args =~ /__u\d+\s*\*/ || $func_args =~ /uint\d+_t\s*\*/); + + my $cec_msg = $msg; + while ($cec_msg ne "" && !exists($msgs{$cec_msg})) { Added: head/multimedia/libv4l/files/patch-utils_common_ir-encode.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_common_ir-encode.c Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,322 @@ +--- utils/common/ir-encode.c.orig 2020-04-09 16:29:54 UTC ++++ utils/common/ir-encode.c +@@ -34,17 +34,18 @@ static int nec_encode(enum rc_proto proto, unsigned sc + const int nec_unit = 562500; + int n = 0; + +- void add_byte(unsigned bits) +- { +- int i; +- for (i=0; i<8; i++) { +- buf[n++] = NS_TO_US(nec_unit); +- if (bits & (1 << i)) +- buf[n++] = NS_TO_US(nec_unit * 3); +- else +- buf[n++] = NS_TO_US(nec_unit); +- } +- } ++#define add_byte(__bits) \ ++ do { \ ++ const unsigned bits = (__bits); \ ++ int i; \ ++ for (i=0; i<8; i++) { \ ++ buf[n++] = NS_TO_US(nec_unit); \ ++ if (bits & (1U << i)) \ ++ buf[n++] = NS_TO_US(nec_unit * 3); \ ++ else \ ++ buf[n++] = NS_TO_US(nec_unit); \ ++ } \ ++ } while (0) + + buf[n++] = NS_TO_US(nec_unit * 16); + buf[n++] = NS_TO_US(nec_unit * 8); +@@ -73,7 +74,7 @@ static int nec_encode(enum rc_proto proto, unsigned sc + } + + buf[n++] = NS_TO_US(nec_unit); +- ++#undef add_bits + return n; + } + +@@ -108,19 +109,21 @@ static int sanyo_encode(enum rc_proto proto, unsigned + { + const int sanyo_unit = 562500; + +- void add_bits(int bits, int count) +- { +- int i; +- for (i=0; i<count; i++) { +- *buf++ = NS_TO_US(sanyo_unit); ++#define add_bits(__bits, __count) \ ++ do { \ ++ const unsigned bits = (__bits); \ ++ const int count = (__count); \ ++ int i; \ ++ for (i=0; i<count; i++) { \ ++ *buf++ = NS_TO_US(sanyo_unit); \ ++ \ ++ if (bits & (1U << i)) \ ++ *buf++ = NS_TO_US(sanyo_unit * 3); \ ++ else \ ++ *buf++ = NS_TO_US(sanyo_unit); \ ++ } \ ++ } while (0) + +- if (bits & (1 << i)) +- *buf++ = NS_TO_US(sanyo_unit * 3); +- else +- *buf++ = NS_TO_US(sanyo_unit); +- } +- } +- + *buf++ = NS_TO_US(sanyo_unit * 16); + *buf++ = NS_TO_US(sanyo_unit * 8); + +@@ -130,7 +133,7 @@ static int sanyo_encode(enum rc_proto proto, unsigned + add_bits(~scancode, 8); + + *buf = NS_TO_US(sanyo_unit); +- ++#undef add_bits + return 87; + } + +@@ -138,19 +141,21 @@ static int sharp_encode(enum rc_proto proto, unsigned + { + const int sharp_unit = 40000; + +- void add_bits(int bits, int count) +- { +- int i; +- for (i=0; i<count; i++) { +- *buf++ = NS_TO_US(sharp_unit * 8); ++#define add_bits(__bits, __count) \ ++ do { \ ++ const unsigned bits = (__bits); \ ++ const int count = (__count); \ ++ int i; \ ++ for (i=0; i<count; i++) { \ ++ *buf++ = NS_TO_US(sharp_unit * 8); \ ++ \ ++ if (bits & (1U << i)) \ ++ *buf++ = NS_TO_US(sharp_unit * 50); \ ++ else \ ++ *buf++ = NS_TO_US(sharp_unit * 25); \ ++ } \ ++ } while (0) + +- if (bits & (1 << i)) +- *buf++ = NS_TO_US(sharp_unit * 50); +- else +- *buf++ = NS_TO_US(sharp_unit * 25); +- } +- } +- + add_bits(scancode >> 8, 5); + add_bits(scancode, 8); + add_bits(1, 2); +@@ -162,7 +167,7 @@ static int sharp_encode(enum rc_proto proto, unsigned + add_bits(~scancode, 8); + add_bits(~1, 2); + *buf++ = NS_TO_US(sharp_unit * 8); +- ++#undef add_bits + return (13 + 2) * 4 + 3; + } + +@@ -171,19 +176,21 @@ static int sony_encode(enum rc_proto proto, unsigned s + const int sony_unit = 600000; + int n = 0; + +- void add_bits(int bits, int count) +- { +- int i; +- for (i=0; i<count; i++) { +- if (bits & (1 << i)) +- buf[n++] = NS_TO_US(sony_unit * 2); +- else +- buf[n++] = NS_TO_US(sony_unit); ++#define add_bits(__bits, __count) \ ++ do { \ ++ const unsigned bits = (__bits); \ ++ const int count = (__count); \ ++ int i; \ ++ for (i=0; i<count; i++) { \ ++ if (bits & (1U << i)) \ ++ buf[n++] = NS_TO_US(sony_unit * 2); \ ++ else \ ++ buf[n++] = NS_TO_US(sony_unit); \ ++ \ ++ buf[n++] = NS_TO_US(sony_unit); \ ++ } \ ++ } while (0) + +- buf[n++] = NS_TO_US(sony_unit); +- } +- } +- + buf[n++] = NS_TO_US(sony_unit * 4); + buf[n++] = NS_TO_US(sony_unit); + +@@ -204,7 +211,7 @@ static int sony_encode(enum rc_proto proto, unsigned s + default: + return 0; + } +- ++#undef add_bits + /* ignore last space */ + return n - 1; + } +@@ -214,34 +221,38 @@ static int rc5_encode(enum rc_proto proto, unsigned sc + const unsigned int rc5_unit = 888888; + unsigned n = 0; + +- void advance_space(unsigned length) +- { +- if (n % 2) +- buf[n] += length; +- else +- buf[++n] = length; +- } ++#define advance_space(__length) \ ++ do { \ ++ const unsigned length = (__length); \ ++ if (n % 2) \ ++ buf[n] += length; \ ++ else \ ++ buf[++n] = length; \ ++ } while (0) + +- void advance_pulse(unsigned length) +- { +- if (n % 2) +- buf[++n] = length; +- else +- buf[n] += length; +- } ++#define advance_pulse(__length) \ ++ do { \ ++ const unsigned length = (__length); \ ++ if (n % 2) \ ++ buf[++n] = length; \ ++ else \ ++ buf[n] += length; \ ++ } while (0) + +- void add_bits(int bits, int count) +- { +- while (count--) { +- if (bits & (1 << count)) { +- advance_space(NS_TO_US(rc5_unit)); +- advance_pulse(NS_TO_US(rc5_unit)); +- } else { +- advance_pulse(NS_TO_US(rc5_unit)); +- advance_space(NS_TO_US(rc5_unit)); +- } +- } +- } ++#define add_bits(__bits, __count) \ ++ do { \ ++ const unsigned bits = (__bits); \ ++ int count = (__count); \ ++ while (count--) { \ ++ if (bits & (1U << count)) { \ ++ advance_space(NS_TO_US(rc5_unit)); \ ++ advance_pulse(NS_TO_US(rc5_unit)); \ ++ } else { \ ++ advance_pulse(NS_TO_US(rc5_unit)); \ ++ advance_space(NS_TO_US(rc5_unit)); \ ++ } \ ++ } \ ++ } while (0) + + buf[n] = NS_TO_US(rc5_unit); + +@@ -269,7 +280,9 @@ static int rc5_encode(enum rc_proto proto, unsigned sc + add_bits(scancode, 6); + break; + } +- ++#undef advance_space ++#undef advance_pulse ++#undef add_bits + /* drop any trailing pulse */ + return (n % 2) ? n : n + 1; + } +@@ -279,34 +292,38 @@ static int rc6_encode(enum rc_proto proto, unsigned sc + const unsigned int rc6_unit = 444444; + unsigned n = 0; + +- void advance_space(unsigned length) +- { +- if (n % 2) +- buf[n] += length; +- else +- buf[++n] = length; +- } ++#define advance_space(__length) \ ++ do { \ ++ const unsigned length = (__length); \ ++ if (n % 2) \ ++ buf[n] += length; \ ++ else \ ++ buf[++n] = length; \ ++ } while (0) + +- void advance_pulse(unsigned length) +- { +- if (n % 2) +- buf[++n] = length; +- else +- buf[n] += length; +- } ++#define advance_pulse(__length) \ ++ do { \ ++ const unsigned length = (__length); \ ++ if (n % 2) \ ++ buf[++n] = length; \ ++ else \ ++ buf[n] += length; \ ++ } while (0) + +- void add_bits(unsigned bits, unsigned count, unsigned length) +- { +- while (count--) { +- if (bits & (1 << count)) { +- advance_pulse(length); +- advance_space(length); +- } else { +- advance_space(length); +- advance_pulse(length); +- } +- } +- } ++#define add_bits(__bits, __count, length) \ ++ do { \ ++ const unsigned bits = (__bits); \ ++ int count = (__count); \ ++ while (count--) { \ ++ if (bits & (1U << count)) { \ ++ advance_pulse(length); \ ++ advance_space(length); \ ++ } else { \ ++ advance_space(length); \ ++ advance_pulse(length); \ ++ } \ ++ } \ ++ } while (0) + + buf[n++] = NS_TO_US(rc6_unit * 6); + buf[n++] = NS_TO_US(rc6_unit * 2); +@@ -337,7 +354,9 @@ static int rc6_encode(enum rc_proto proto, unsigned sc + add_bits(scancode, 32, NS_TO_US(rc6_unit)); + break; + } +- ++#undef advance_space ++#undef advance_pulse ++#undef add_bits + /* drop any trailing pulse */ + return (n % 2) ? n : n + 1; + } Added: head/multimedia/libv4l/files/patch-utils_common_keymap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_common_keymap.h Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,32 @@ +--- utils/common/keymap.h.orig 2020-04-09 16:29:54 UTC ++++ utils/common/keymap.h +@@ -2,6 +2,8 @@ + #ifndef __KEYMAP_H + #define __KEYMAP_H + ++#include <stdint.h> ++ + struct keymap { + struct keymap *next; + char *name; +@@ -20,16 +22,16 @@ struct protocol_param { + + struct scancode_entry { + struct scancode_entry *next; +- u_int32_t scancode; ++ uint32_t scancode; + char *keycode; + }; + + struct raw_entry { + struct raw_entry *next; +- u_int32_t scancode; +- u_int32_t raw_length; ++ uint32_t scancode; ++ uint32_t raw_length; + char *keycode; +- u_int32_t raw[1]; ++ uint32_t raw[1]; + }; + + void free_keymap(struct keymap *map); Added: head/multimedia/libv4l/files/patch-utils_common_v4l2-tpg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_common_v4l2-tpg.h Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,12 @@ +--- utils/common/v4l2-tpg.h.orig 2020-04-09 16:29:54 UTC ++++ utils/common/v4l2-tpg.h +@@ -22,7 +22,9 @@ typedef int16_t s16; + typedef uint8_t u8; + typedef int8_t s8; + ++#ifndef __packed + #define __packed __attribute__((packed)) ++#endif + #define pr_info printf + #define noinline + Added: head/multimedia/libv4l/files/patch-utils_dvb_dvbv5-daemon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_dvb_dvbv5-daemon.c Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,14 @@ +--- utils/dvb/dvbv5-daemon.c.orig 2020-04-09 16:29:54 UTC ++++ utils/dvb/dvbv5-daemon.c +@@ -18,7 +18,11 @@ + * + */ + ++#ifndef __FreeBSD__ + #define _XOPEN_SOURCE 600 ++#else ++#define tdestroy(...) do {} while (0) ++#endif + + #define _FILE_OFFSET_BITS 64 + #define _LARGEFILE_SOURCE 1 Added: head/multimedia/libv4l/files/patch-utils_ir-ctl_bpf__encoder.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_ir-ctl_bpf__encoder.c Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,50 @@ +--- utils/ir-ctl/bpf_encoder.c.orig 2020-04-09 16:29:54 UTC ++++ utils/ir-ctl/bpf_encoder.c +@@ -84,21 +84,23 @@ static void encode_manchester(struct keymap *map, uint + { + int len = 0, bits, i; + +- void advance_space(unsigned length) +- { +- if (len % 2) +- buf[len] += length; +- else +- buf[++len] = length; +- } ++#define advance_space(__length) \ ++ do { \ ++ const unsigned length = (__length); \ ++ if (len % 2) \ ++ buf[len] += length; \ ++ else \ ++ buf[++len] = length; \ ++ } while (0) + +- void advance_pulse(unsigned length) +- { +- if (len % 2) +- buf[++len] = length; +- else +- buf[len] += length; +- } ++#define advance_pulse(__length) \ ++ do { \ ++ const unsigned length = (__length); \ ++ if (len % 2) \ ++ buf[++len] = length; \ ++ else \ ++ buf[len] += length; \ ++ } while (0) + + bits = keymap_param(map, "bits", 14); + +@@ -111,7 +113,8 @@ static void encode_manchester(struct keymap *map, uint + advance_pulse(keymap_param(map, "zero_pulse", 888)); + } + } +- ++#undef advance_space ++#undef advance_pulse + /* drop any trailing pulse */ + *length = (len % 2) ? len : len + 1; + } Added: head/multimedia/libv4l/files/patch-utils_ir-ctl_ir-ctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_ir-ctl_ir-ctl.c Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,10 @@ +--- utils/ir-ctl/ir-ctl.c.orig 2020-04-09 16:29:54 UTC ++++ utils/ir-ctl/ir-ctl.c +@@ -18,6 +18,7 @@ + #include <stdlib.h> + #include <stdbool.h> + #include <stdint.h> ++#include <string.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/ioctl.h> Added: head/multimedia/libv4l/files/patch-utils_media-ctl_media-ctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_media-ctl_media-ctl.c Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,11 @@ +--- utils/media-ctl/media-ctl.c.orig 2020-04-09 16:29:54 UTC ++++ utils/media-ctl/media-ctl.c +@@ -213,7 +213,7 @@ static void v4l2_subdev_print_dv_timings(const struct + + printf(" %ux%u%s%llu (%ux%u)", + bt->width, bt->height, bt->interlaced ? "i" : "p", +- (htotal * vtotal) > 0 ? (bt->pixelclock / (htotal * vtotal)) : 0, ++ ((htotal * vtotal) > 0 ? (bt->pixelclock / (htotal * vtotal)) : 0ULL), + htotal, vtotal); + + printf(" stds:"); Added: head/multimedia/libv4l/files/patch-utils_v4l2-compliance_v4l2-test-buffers.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_v4l2-compliance_v4l2-test-buffers.cpp Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,30 @@ +--- utils/v4l2-compliance/v4l2-test-buffers.cpp.orig 2020-04-09 16:29:54 UTC ++++ utils/v4l2-compliance/v4l2-test-buffers.cpp +@@ -22,6 +22,7 @@ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> ++#include <signal.h> + #include <inttypes.h> + #include <sys/types.h> + #include <sys/stat.h> +@@ -48,8 +49,8 @@ + #define VIVID_CID_QUEUE_ERROR (VIVID_CID_VIVID_BASE + 70) + #define VIVID_CID_REQ_VALIDATE_ERROR (VIVID_CID_VIVID_BASE + 72) + +-static struct cv4l_fmt cur_fmt; +-static struct cv4l_fmt cur_m2m_fmt; ++static cv4l_fmt cur_fmt; ++static cv4l_fmt cur_m2m_fmt; + static int stream_from_fd = -1; + static bool stream_use_hdr; + +@@ -354,7 +355,7 @@ int buffer::check(unsigned type, unsigned memory, unsi + unsigned timestamp_src = g_timestamp_src(); + unsigned frame_types = 0; + unsigned buf_states = 0; +- const struct cv4l_fmt &fmt = is_m2m ? cur_m2m_fmt : cur_fmt; ++ const cv4l_fmt &fmt = is_m2m ? cur_m2m_fmt : cur_fmt; + + fail_on_test(g_type() != type); + fail_on_test(g_memory() == 0); Added: head/multimedia/libv4l/files/patch-utils_v4l2-ctl_v4l2-ctl-overlay.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/patch-utils_v4l2-ctl_v4l2-ctl-overlay.cpp Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,42 @@ +--- utils/v4l2-ctl/v4l2-ctl-overlay.cpp.orig 2020-04-09 16:29:54 UTC ++++ utils/v4l2-ctl/v4l2-ctl-overlay.cpp +@@ -14,11 +14,12 @@ + #include <dirent.h> + #include <math.h> + ++#include "v4l2-ctl.h" ++ ++#ifndef __FreeBSD__ + #include <linux/fb.h> + #include <vector> + +-#include "v4l2-ctl.h" +- + static unsigned int set_fbuf; + static unsigned int set_overlay_fmt; + static struct v4l2_format overlay_fmt; /* set_format/get_format video overlay */ +@@ -546,3 +547,24 @@ void overlay_list(cv4l_fd &fd) + if (options[OptFindFb]) + find_fb(fd.g_fd()); + } ++#else ++void overlay_usage(void) ++{ ++} ++ ++void overlay_cmd(int ch, char *optarg) ++{ ++} ++ ++void overlay_set(cv4l_fd &_fd) ++{ ++} ++ ++void overlay_get(cv4l_fd &_fd) ++{ ++} ++ ++void overlay_list(cv4l_fd &fd) ++{ ++} ++#endif Added: head/multimedia/libv4l/files/types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/libv4l/files/types.h Fri Apr 17 08:34:50 2020 (r531911) @@ -0,0 +1,35 @@ +#ifndef _LINUX_TYPES_H +#define _LINUX_TYPES_H + +#include <stdint.h> + +#ifndef HAVE_LINUX_INTEGER_TYPES +/* XXX remove when depending software has been updated */ +#ifndef __u64 +typedef uint64_t __u64; +#endif +#ifndef __u32 +typedef uint32_t __u32; +#endif +#ifndef __u16 +typedef uint16_t __u16; +#endif +#ifndef __u8 +typedef uint8_t __u8; +#endif + +#ifndef __s64 +typedef int64_t __s64; +#endif +#ifndef __s32 +typedef int32_t __s32; +#endif +#ifndef __s16 +typedef int16_t __s16; +#endif +#ifndef __s8 +typedef int8_t __s8; +#endif +#endif + +#endif Modified: head/multimedia/libv4l/pkg-plist ============================================================================== --- head/multimedia/libv4l/pkg-plist Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/libv4l/pkg-plist Fri Apr 17 08:34:50 2020 (r531911) @@ -1,6 +1,7 @@ include/libdvbv5/atsc_eit.h include/libdvbv5/atsc_header.h include/libdvbv5/cat.h +include/libdvbv5/countries.h include/libdvbv5/crc32.h include/libdvbv5/desc_atsc_service_location.h include/libdvbv5/desc_ca.h @@ -23,6 +24,7 @@ include/libdvbv5/desc_terrestrial_delivery.h include/libdvbv5/desc_ts_info.h include/libdvbv5/descriptors.h include/libdvbv5/dvb-demux.h +include/libdvbv5/dvb-dev.h include/libdvbv5/dvb-fe.h include/libdvbv5/dvb-file.h include/libdvbv5/dvb-frontend.h @@ -32,6 +34,7 @@ include/libdvbv5/dvb-scan.h include/libdvbv5/dvb-v5-std.h include/libdvbv5/eit.h include/libdvbv5/header.h +include/libdvbv5/libdvb-version.h include/libdvbv5/mgt.h include/libdvbv5/mpeg_es.h include/libdvbv5/mpeg_pes.h Modified: head/multimedia/v4l-utils/Makefile ============================================================================== --- head/multimedia/v4l-utils/Makefile Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/v4l-utils/Makefile Fri Apr 17 08:34:50 2020 (r531911) @@ -2,7 +2,6 @@ # $FreeBSD$ PORTNAME?= v4l-utils -PORTREVISION= 0 COMMENT= Video4Linux utilities Modified: head/multimedia/v4l-utils/pkg-plist ============================================================================== --- head/multimedia/v4l-utils/pkg-plist Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/v4l-utils/pkg-plist Fri Apr 17 08:34:50 2020 (r531911) @@ -1,17 +1,32 @@ -bin/decode_tm6000 -bin/dvb-fe-tool -bin/dvb-format-convert -bin/dvbv5-scan -bin/dvbv5-zap +bin/ivtv-ctl +bin/ir-ctl +bin/cx18-ctl bin/ir-keytable +bin/media-ctl +bin/v4l2-ctl +@comment bin/v4l2-sysfs-path +bin/cec-ctl +bin/cec-compliance +bin/cec-follower bin/rds-ctl +bin/dvb-fe-tool +bin/dvbv5-zap +bin/dvbv5-scan +bin/dvb-format-convert +bin/dvbv5-daemon bin/v4l2-compliance -@comment bin/v4l2-sysfs-path etc/rc_maps.cfg +man/man1/v4l2-ctl.1.gz +man/man1/cec-ctl.1.gz +man/man1/cec-compliance.1.gz +man/man1/cec-follower.1.gz man/man1/dvb-fe-tool.1.gz -man/man1/dvb-format-convert.1.gz -man/man1/dvbv5-scan.1.gz man/man1/dvbv5-zap.1.gz +man/man1/dvbv5-scan.1.gz +man/man1/v4l2-compliance.1.gz +man/man1/ir-ctl.1.gz man/man1/ir-keytable.1.gz +man/man1/dvb-format-convert.1.gz +man/man5/rc_keymap.5.gz sbin/v4l2-dbg @dir etc/rc_keymaps Modified: head/multimedia/v4l_compat/Makefile ============================================================================== --- head/multimedia/v4l_compat/Makefile Fri Apr 17 07:40:28 2020 (r531910) +++ head/multimedia/v4l_compat/Makefile Fri Apr 17 08:34:50 2020 (r531911) @@ -1,7 +1,6 @@ # $FreeBSD$ PORTNAME= v4l_compat -PORTREVISION= 3 COMMENT= Video4Linux IOCTL header files @@ -9,33 +8,47 @@ NO_BUILD= yes NO_ARCH= yes MASTERDIR= ${.CURDIR}/../libv4l -EXTRADIR= ${WRKSRC}/../linux DESCR= ${.CURDIR}/pkg-descr PLIST= ${.CURDIR}/pkg-plist -BASE_HEADERS= ivtv.h v4l2-controls.h \ - v4l2-common.h videodev2.h -DVB_HEADERS= audio.h dmx.h frontend.h video.h -EXTRA_HEADERS= ca.h net.h osd.h version.h +BASE_HEADERS= \ + linux/cec.h \ + linux/cec-funcs.h \ + linux/dvb/audio.h \ + linux/dvb/ca.h \ + linux/dvb/dmx.h \ + linux/dvb/frontend.h \ + linux/dvb/net.h \ + linux/dvb/osd.h \ + linux/dvb/version.h \ + linux/dvb/video.h \ + linux/ivtv.h \ + linux/lirc.h \ + linux/media.h \ + linux/media-bus-format.h \ + linux/v4l2-common.h \ + linux/v4l2-controls.h \ + linux/v4l2-mediabus.h \ + linux/v4l2-subdev.h \ + linux/videodev2.h do-install: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004170834.03H8YoK4060398>