Index: multimedia/libv4l/Makefile =================================================================== --- multimedia/libv4l/Makefile +++ multimedia/libv4l/Makefile @@ -1,32 +1,46 @@ # Created by: Andrew Thompson # $FreeBSD$ -PORTNAME= libv4l -PORTVERSION= 0.8.8 -PORTREVISION= 2 +PORTNAME?= libv4l +PORTVERSION= 1.6.2 +PORTREVISION?= 0 CATEGORIES= multimedia MASTER_SITES= http://linuxtv.org/downloads/v4l-utils/ DISTNAME= v4l-utils-${PORTVERSION} -MAINTAINER= hselasky@FreeBSD.org -COMMENT= Video4Linux library +MAINTAINER?= hselasky@FreeBSD.org +COMMENT?= Video4Linux library -BUILD_DEPENDS= v4l_compat>=1.0.20120501:${PORTSDIR}/multimedia/v4l_compat -LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg +LIBV4L_SLAVE?= no -MAKE_ARGS= CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib" LIBDIR="${PREFIX}/lib" -USES= gmake tar:bzip2 +USES= tar:bzip2 + +.if ${LIBV4L_SLAVE} != compat +BUILD_DEPENDS+= v4l_compat>=${PORTVERSION}:${PORTSDIR}/multimedia/v4l_compat +LIB_DEPENDS+= libjpeg.so:${PORTSDIR}/graphics/jpeg \ + libargp.so:${PORTSDIR}/devel/argp-standalone + +GNU_CONFIGURE= yes +CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +USES+= gmake libtool pathfix pkgconfig USE_LDCONFIG= yes +CONFIGURE_ARGS= --disable-libdvbv5 \ + --disable-qv4l2 \ + --without-libudev +INSTALL_TARGET= install-strip -WRKSRC= ${WRKDIR}/${DISTNAME}/lib +. if ${LIBV4L_SLAVE} == utils +BUILD_DEPENDS+= libv4l>=${PORTVERSION}:${PORTSDIR}/multimedia/libv4l +LIB_DEPENDS+= libv4l2.so:${PORTSDIR}/multimedia/libv4l +CONFIGURE_ARGS+=--enable-v4l-utils --disable-libv4l +. else +CONFIGURE_ARGS+=--disable-v4l-utils --enable-libv4l +. endif post-patch: - @${REINPLACE_CMD} -e 's|$$(LIBDIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \ - -e 's|-lrt||g' \ - ${WRKSRC}/libv4l1/Makefile \ - ${WRKSRC}/libv4l2/Makefile \ - ${WRKSRC}/libv4lconvert/Makefile - @${RM} ${WRKSRC}/../include/linux/videodev2.h + @${REINPLACE_CMD} -e 's|$$libdir/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \ + ${WRKSRC}/configure +.endif .include Index: multimedia/libv4l/distinfo =================================================================== --- multimedia/libv4l/distinfo +++ multimedia/libv4l/distinfo @@ -1,2 +1,2 @@ -SHA256 (v4l-utils-0.8.8.tar.bz2) = 5fa4c6f4b6f5410de57271a03cc9a15f15195ef3fc05a8e42ecf507d6d70a87f -SIZE (v4l-utils-0.8.8.tar.bz2) = 420888 +SHA256 (v4l-utils-1.6.2.tar.bz2) = d3d6eb1f0204fb11f3d318bfca35d5f73cc077f88fac7665a47856a16496be7d +SIZE (v4l-utils-1.6.2.tar.bz2) = 1148309 Index: multimedia/libv4l/files/patch-Make.rules =================================================================== --- multimedia/libv4l/files/patch-Make.rules +++ multimedia/libv4l/files/patch-Make.rules @@ -1,26 +0,0 @@ ---- ../Make.rules.orig 2010-08-26 17:19:37.000000000 +0200 -+++ ../Make.rules 2010-11-04 20:26:22.000000000 +0100 -@@ -7,8 +7,8 @@ CFLAGS += -Wall -Wpointer-arith - CXXFLAGS := $(CFLAGS) - CFLAGS += -Wstrict-prototypes -Wmissing-prototypes - --PREFIX = /usr/local --LIBDIR = $(PREFIX)/lib -+PREFIX ?= /usr/local -+LIBDIR ?= $(PREFIX)/lib - # subdir below LIBDIR in which to install the libv4lx libc wrappers - LIBSUBDIR = libv4l - -@@ -22,10 +22,10 @@ LIB_RELEASE = 0 - # And last various rules - - %.o: %.c -- $(CC) -Wp,-MMD,"$*.d",-MQ,"$@",-MP -c $(CPPFLAGS) $(CFLAGS) -o $@ $< -+ $(CC) -MMD -MF "$*.d" -MQ "$@" -MP -c $(CPPFLAGS) $(CFLAGS) -o $@ $< - - %.o: %.cpp -- $(CXX) -Wp,-MMD,"$*.d",-MQ,"$@",-MP -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< -+ $(CXX) -MMD -MF "$*.d" -MQ "$@" -MP -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< - - %.so: - $(CC) -shared $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ $(LIBS_$*) Index: multimedia/libv4l/files/patch-include_libv4l1-videodev.h =================================================================== --- multimedia/libv4l/files/patch-include_libv4l1-videodev.h +++ multimedia/libv4l/files/patch-include_libv4l1-videodev.h @@ -1,18 +0,0 @@ -diff -ru v4l-utils-0.8.4.orig/lib/include/libv4l1-videodev.h v4l-utils-0.8.4/lib/include/libv4l1-videodev.h ---- include/libv4l1-videodev.h 2011-06-27 09:52:38.000000000 +0200 -+++ include/libv4l1-videodev.h 2011-06-27 09:55:51.000000000 +0200 -@@ -2,7 +2,14 @@ - #ifndef __LINUX_VIDEODEV_H - #define __LINUX_VIDEODEV_H - -+#ifdef linux - #include -+#endif -+ -+#ifdef __FreeBSD__ -+#include -+#endif -+ - #include - - #define VID_TYPE_CAPTURE 1 /* Can capture */ Index: multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c =================================================================== --- multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c +++ multimedia/libv4l/files/patch-lib_libv4lconvert_control_libv4lcontrol.c @@ -0,0 +1,27 @@ +--- 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 @@ + unsigned short *vendor_id, unsigned short *product_id, + int *speed) + { ++#ifdef __FreeBSD__ ++#define WEBCAMD_IOCTL_GET_USB_VENDOR_ID _IOR('q', 250, unsigned short) ++#define WEBCAMD_IOCTL_GET_USB_PRODUCT_ID _IOR('q', 251, unsigned short) ++#define WEBCAMD_IOCTL_GET_USB_SPEED _IOR('q', 252, unsigned int) ++ if (ioctl(data->fd, WEBCAMD_IOCTL_GET_USB_VENDOR_ID, vendor_id) == 0 && ++ ioctl(data->fd, WEBCAMD_IOCTL_GET_USB_PRODUCT_ID, product_id) == 0 && ++ ioctl(data->fd, WEBCAMD_IOCTL_GET_USB_SPEED, speed) == 0) ++ return (1); ++ return (0); ++#else + FILE *f; + int i, minor; + struct stat st; +@@ -457,6 +467,7 @@ + return 0; /* Should never happen */ + + return 1; ++#endif + } + + /* Index: multimedia/libv4l/files/patch-libv4lconvert_control_libv4lcontrol.c =================================================================== --- multimedia/libv4l/files/patch-libv4lconvert_control_libv4lcontrol.c +++ multimedia/libv4l/files/patch-libv4lconvert_control_libv4lcontrol.c @@ -1,40 +0,0 @@ ---- libv4lconvert/control/libv4lcontrol.c.orig 2012-05-02 21:17:37.000000000 +0200 -+++ libv4lconvert/control/libv4lcontrol.c 2012-05-06 08:52:42.000000000 +0200 -@@ -345,6 +345,16 @@ - unsigned short *vendor_id, unsigned short *product_id, - int *speed) - { -+#ifdef __FreeBSD__ -+#define WEBCAMD_IOCTL_GET_USB_VENDOR_ID _IOR('q', 250, unsigned short) -+#define WEBCAMD_IOCTL_GET_USB_PRODUCT_ID _IOR('q', 251, unsigned short) -+#define WEBCAMD_IOCTL_GET_USB_SPEED _IOR('q', 252, unsigned int) -+ if (ioctl(data->fd, WEBCAMD_IOCTL_GET_USB_VENDOR_ID, vendor_id) == 0 && -+ ioctl(data->fd, WEBCAMD_IOCTL_GET_USB_PRODUCT_ID, product_id) == 0 && -+ ioctl(data->fd, WEBCAMD_IOCTL_GET_USB_SPEED, speed) == 0) -+ return (1); -+ return (0); -+#else - FILE *f; - int i, minor; - struct stat st; -@@ -434,6 +444,7 @@ - return 0; /* Should never happen */ - - return 1; -+#endif - } - - /* -@@ -456,7 +456,12 @@ - while (isspace(*start)) start++; - n = strlen(start); - while (n > 0 && isspace(start[n-1])) --n; -+#ifndef __FreeBSD__ - trimmed_dmi = strndupa(start, n); -+#else -+ trimmed_dmi = (char *)alloca(n + 1); -+ strlcpy(trimmed_dmi, start, n + 1); -+#endif - - /* find trimmed value */ - for (entry_ptr = table_entries; *entry_ptr; entry_ptr++) { Index: multimedia/libv4l/pkg-plist =================================================================== --- multimedia/libv4l/pkg-plist +++ multimedia/libv4l/pkg-plist @@ -1,18 +1,33 @@ +include/libv4l-plugin.h include/libv4l1-videodev.h include/libv4l1.h include/libv4l2.h +include/libv4l2rds.h include/libv4lconvert.h lib/libv4l/ov511-decomp lib/libv4l/ov518-decomp +lib/libv4l/plugins/libv4l-mplane.so lib/libv4l/v4l1compat.so lib/libv4l/v4l2convert.so +lib/libv4l1.a lib/libv4l1.so lib/libv4l1.so.0 +lib/libv4l1.so.0.0.0 +lib/libv4l2.a lib/libv4l2.so lib/libv4l2.so.0 +lib/libv4l2.so.0.0.0 +lib/libv4l2rds.a +lib/libv4l2rds.so +lib/libv4l2rds.so.0 +lib/libv4l2rds.so.0.0.0 +lib/libv4lconvert.a lib/libv4lconvert.so lib/libv4lconvert.so.0 +lib/libv4lconvert.so.0.0.0 +lib/v4l1compat.so +lib/v4l2convert.so libdata/pkgconfig/libv4l1.pc libdata/pkgconfig/libv4l2.pc +libdata/pkgconfig/libv4l2rds.pc libdata/pkgconfig/libv4lconvert.pc -@dirrm lib/libv4l Index: multimedia/v4l_compat/Makefile =================================================================== --- multimedia/v4l_compat/Makefile +++ multimedia/v4l_compat/Makefile @@ -1,10 +1,7 @@ # $FreeBSD$ PORTNAME= v4l_compat -PORTVERSION= 1.0.${DUMMYDATE} -PORTREVISION= 1 -CATEGORIES= multimedia -MASTER_SITES= LOCAL/kwm +PORTREVISION= 0 MAINTAINER= multimedia@FreeBSD.org COMMENT= Video4Linux IOCTL header files @@ -11,16 +8,45 @@ LICENSE= GPLv2 -DUMMYDATE= 20120501 - NO_BUILD= yes NO_ARCH= yes -BASE_HEADERS= input.h uinput.h videodev.h videodev2.h -DVB_HEADERS= audio.h ca.h dmx.h frontend.h net.h osd.h version.h video.h +MASTERDIR= ${.CURDIR}/../../multimedia/libv4l +PATCHDIR= ${.CURDIR}/files +DESCR= ${.CURDIR}/pkg-descr +PLIST= ${.CURDIR}/pkg-plist +LIBV4L_SLAVE= compat + +EXTRA_HEADER= videodev.h +BASE_HEADERS= input.h uinput.h ivtv.h v4l2-controls.h \ + v4l2-common.h videodev2.h +DVB_HEADERS= audio.h dmx.h frontend.h video.h + +post-patch: + ${FIND} ${WRKSRC} -name \*.h | ${XARGS} -n 10 ${REINPLACE_CMD} \ + -e 's|linux/types.h|sys/types.h|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' + do-install: - ${MKDIR} ${STAGEDIR}${PREFIX}/include/linux/dvb - cd ${WRKSRC}; ${INSTALL_DATA} ${BASE_HEADERS} ${STAGEDIR}${PREFIX}/include/linux/ - cd ${WRKSRC}/dvb; ${INSTALL_DATA} ${DVB_HEADERS} ${STAGEDIR}${PREFIX}/include/linux/dvb/ + @${MKDIR} ${STAGEDIR}${PREFIX}/include/linux/dvb/ +.for i in ${BASE_HEADERS} + ${INSTALL_DATA} ${WRKSRC}/contrib/freebsd/include/linux/${i} \ + ${STAGEDIR}${PREFIX}/include/linux/ +.endfor +.for i in ${DVB_HEADERS} + ${INSTALL_DATA} ${WRKSRC}/include/linux/dvb/${i} \ + ${STAGEDIR}${PREFIX}/include/linux/dvb +.endfor +# V4L1 is dead in linux, however webcamd still supports it. + ${INSTALL_DATA} ${PATCHDIR}/videodev.h \ + ${STAGEDIR}${PREFIX}/include/linux/ +# gst-plugins1-bad dvb plugins still needs the version.h and ca.h header. +.for i in ca.h version.h + ${INSTALL_DATA} ${PATCHDIR}/${i} \ + ${STAGEDIR}${PREFIX}/include/linux/dvb/ +.endfor -.include +.include "${MASTERDIR}/Makefile" Index: multimedia/v4l_compat/distinfo =================================================================== --- multimedia/v4l_compat/distinfo +++ multimedia/v4l_compat/distinfo @@ -1,2 +0,0 @@ -SHA256 (v4l_compat-1.0.20120501.tar.gz) = 0bc375a36f450ad7f665996ca3d9efcffa63d9befcdf3214412f0a1e82d68b30 -SIZE (v4l_compat-1.0.20120501.tar.gz) = 63578 Index: multimedia/v4l_compat/files/ca.h =================================================================== --- multimedia/v4l_compat/files/ca.h +++ multimedia/v4l_compat/files/ca.h @@ -0,0 +1,90 @@ +/* + * ca.h + * + * Copyright (C) 2000 Ralph Metzler + * & Marcus Metzler + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Lesser Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DVBCA_H_ +#define _DVBCA_H_ + +/* slot interface types and info */ + +typedef struct ca_slot_info { + int num; /* slot number */ + + int type; /* CA interface this slot supports */ +#define CA_CI 1 /* CI high level interface */ +#define CA_CI_LINK 2 /* CI link layer level interface */ +#define CA_CI_PHYS 4 /* CI physical layer level interface */ +#define CA_DESCR 8 /* built-in descrambler */ +#define CA_SC 128 /* simple smart card interface */ + + unsigned int flags; +#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ +#define CA_CI_MODULE_READY 2 +} ca_slot_info_t; + + +/* descrambler types and info */ + +typedef struct ca_descr_info { + unsigned int num; /* number of available descramblers (keys) */ + unsigned int type; /* type of supported scrambling system */ +#define CA_ECD 1 +#define CA_NDS 2 +#define CA_DSS 4 +} ca_descr_info_t; + +typedef struct ca_caps { + unsigned int slot_num; /* total number of CA card and module slots */ + unsigned int slot_type; /* OR of all supported types */ + unsigned int descr_num; /* total number of descrambler slots (keys) */ + unsigned int descr_type; /* OR of all supported types */ +} ca_caps_t; + +/* a message to/from a CI-CAM */ +typedef struct ca_msg { + unsigned int index; + unsigned int type; + unsigned int length; + unsigned char msg[256]; +} ca_msg_t; + +typedef struct ca_descr { + unsigned int index; + unsigned int parity; /* 0 == even, 1 == odd */ + unsigned char cw[8]; +} ca_descr_t; + +typedef struct ca_pid { + unsigned int pid; + int index; /* -1 == disable*/ +} ca_pid_t; + +#define CA_RESET _IO('o', 128) +#define CA_GET_CAP _IOR('o', 129, ca_caps_t) +#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) +#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) +#define CA_GET_MSG _IOR('o', 132, ca_msg_t) +#define CA_SEND_MSG _IOW('o', 133, ca_msg_t) +#define CA_SET_DESCR _IOW('o', 134, ca_descr_t) +#define CA_SET_PID _IOW('o', 135, ca_pid_t) + +#endif Index: multimedia/v4l_compat/files/patch-dvb-ca.h =================================================================== --- multimedia/v4l_compat/files/patch-dvb-ca.h +++ multimedia/v4l_compat/files/patch-dvb-ca.h @@ -1,20 +0,0 @@ ---- dvb/ca.h.orig -+++ dvb/ca.h -@@ -80,9 +80,17 @@ typedef struct ca_pid { - - #define CA_RESET _IO('o', 128) - #define CA_GET_CAP _IOR('o', 129, ca_caps_t) -+ -+/* At least CA_GET_SLOT_INFO and CA_GET_MSG need to be _IOWR not _IOR. -+ * This is wrong on Linux too but there the driver doesn't care. -+ * - #define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) - #define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) - #define CA_GET_MSG _IOR('o', 132, ca_msg_t) -+ */ -+#define CA_GET_SLOT_INFO _IOWR('o', 130, ca_slot_info_t) -+#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) -+#define CA_GET_MSG _IOWR('o', 132, ca_msg_t) - #define CA_SEND_MSG _IOW('o', 133, ca_msg_t) - #define CA_SET_DESCR _IOW('o', 134, ca_descr_t) - #define CA_SET_PID _IOW('o', 135, ca_pid_t) Index: multimedia/v4l_compat/files/patch-include_linux_dvb_frontend.h =================================================================== --- multimedia/v4l_compat/files/patch-include_linux_dvb_frontend.h +++ multimedia/v4l_compat/files/patch-include_linux_dvb_frontend.h @@ -0,0 +1,17 @@ +--- include/linux/dvb/frontend.h.orig 2015-01-10 15:04:07.446370686 +0100 ++++ include/linux/dvb/frontend.h 2015-01-10 15:05:20.367365809 +0100 +@@ -549,7 +549,13 @@ + }; + + #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. ++ * 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) + + + /** Index: multimedia/v4l_compat/files/patch-include_linux_dvb_video.h =================================================================== --- multimedia/v4l_compat/files/patch-include_linux_dvb_video.h +++ multimedia/v4l_compat/files/patch-include_linux_dvb_video.h @@ -0,0 +1,11 @@ +--- include/linux/dvb/video.h.orig 2015-01-10 15:05:58.438363362 +0100 ++++ include/linux/dvb/video.h 2015-01-10 15:06:25.350361374 +0100 +@@ -133,7 +133,7 @@ + #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 + #define VIDEO_EVENT_DECODER_STOPPED 3 + #define VIDEO_EVENT_VSYNC 4 +- __kernel_time_t timestamp; ++ struct timespec timestamp; + union { + video_size_t size; + unsigned int frame_rate; /* in frames per 1000sec */ Index: multimedia/v4l_compat/files/version.h =================================================================== --- multimedia/v4l_compat/files/version.h +++ multimedia/v4l_compat/files/version.h @@ -0,0 +1,29 @@ +/* + * version.h + * + * Copyright (C) 2000 Holger Waechtler + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DVBVERSION_H_ +#define _DVBVERSION_H_ + +#define DVB_API_VERSION 5 +#define DVB_API_VERSION_MINOR 5 + +#endif /*_DVBVERSION_H_*/ Index: multimedia/v4l_compat/files/videodev.h =================================================================== --- multimedia/v4l_compat/files/videodev.h +++ multimedia/v4l_compat/files/videodev.h @@ -0,0 +1,340 @@ +/* + * Video for Linux version 1 - OBSOLETE + * + * Header file for v4l1 drivers and applications, for + * Linux kernels 2.2.x or 2.4.x. + * + * Provides header for legacy drivers and applications + * + * See http://linuxtv.org for more info + * + */ +#ifndef __LINUX_VIDEODEV_H +#define __LINUX_VIDEODEV_H + +#include +#include +#include + +#if defined(__MIN_V4L1) && defined (__KERNEL__) + +/* + * Used by those V4L2 core functions that need a minimum V4L1 support, + * in order to allow V4L1 Compatibilty code compilation. + */ + +struct video_mbuf +{ + int size; /* Total memory to map */ + int frames; /* Frames */ + int offsets[VIDEO_MAX_FRAME]; +}; + +#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ + +#else +#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) + +#define VID_TYPE_CAPTURE 1 /* Can capture */ +#define VID_TYPE_TUNER 2 /* Can tune */ +#define VID_TYPE_TELETEXT 4 /* Does teletext */ +#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ +#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ +#define VID_TYPE_CLIPPING 32 /* Can clip */ +#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ +#define VID_TYPE_SCALES 128 /* Scalable */ +#define VID_TYPE_MONOCHROME 256 /* Monochrome only */ +#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ +#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ +#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ +#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ +#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ + +struct video_capability +{ + char name[32]; + int type; + int channels; /* Num channels */ + int audios; /* Num audio devices */ + int maxwidth; /* Supported width */ + int maxheight; /* And height */ + int minwidth; /* Supported width */ + int minheight; /* And height */ +}; + + +struct video_channel +{ + int channel; + char name[32]; + int tuners; + uint32_t flags; +#define VIDEO_VC_TUNER 1 /* Channel has a tuner */ +#define VIDEO_VC_AUDIO 2 /* Channel has audio */ + uint16_t type; +#define VIDEO_TYPE_TV 1 +#define VIDEO_TYPE_CAMERA 2 + uint16_t norm; /* Norm set by channel */ +}; + +struct video_tuner +{ + int tuner; + char name[32]; + unsigned long rangelow, rangehigh; /* Tuner range */ + uint32_t flags; +#define VIDEO_TUNER_PAL 1 +#define VIDEO_TUNER_NTSC 2 +#define VIDEO_TUNER_SECAM 4 +#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ +#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ +#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ +#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ +#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ + uint16_t mode; /* PAL/NTSC/SECAM/OTHER */ +#define VIDEO_MODE_PAL 0 +#define VIDEO_MODE_NTSC 1 +#define VIDEO_MODE_SECAM 2 +#define VIDEO_MODE_AUTO 3 + uint16_t signal; /* Signal strength 16bit scale */ +}; + +struct video_picture +{ + uint16_t brightness; + uint16_t hue; + uint16_t colour; + uint16_t contrast; + uint16_t whiteness; /* Black and white only */ + uint16_t depth; /* Capture depth */ + uint16_t palette; /* Palette in use */ +#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ +#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ +#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ +#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ +#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ +#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ +#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ +#define VIDEO_PALETTE_YUYV 8 +#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ +#define VIDEO_PALETTE_YUV420 10 +#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ +#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ +#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ +#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ +#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ +#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ +#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ +#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ +}; + +struct video_audio +{ + int audio; /* Audio channel */ + uint16_t volume; /* If settable */ + uint16_t bass, treble; + uint32_t flags; +#define VIDEO_AUDIO_MUTE 1 +#define VIDEO_AUDIO_MUTABLE 2 +#define VIDEO_AUDIO_VOLUME 4 +#define VIDEO_AUDIO_BASS 8 +#define VIDEO_AUDIO_TREBLE 16 +#define VIDEO_AUDIO_BALANCE 32 + char name[16]; +#define VIDEO_SOUND_MONO 1 +#define VIDEO_SOUND_STEREO 2 +#define VIDEO_SOUND_LANG1 4 +#define VIDEO_SOUND_LANG2 8 + uint16_t mode; + uint16_t balance; /* Stereo balance */ + uint16_t step; /* Step actual volume uses */ +}; + +struct video_clip +{ + int32_t x,y; + int32_t width, height; + struct video_clip *next; /* For user use/driver use only */ +}; + +struct video_window +{ + uint32_t x,y; /* Position of window */ + uint32_t width,height; /* Its size */ + uint32_t chromakey; + uint32_t flags; + struct video_clip *clips; /* Set only */ + int clipcount; +#define VIDEO_WINDOW_INTERLACE 1 +#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ +#define VIDEO_CLIP_BITMAP -1 +/* bitmap is 1024x625, a '1' bit represents a clipped pixel */ +#define VIDEO_CLIPMAP_SIZE (128 * 625) +}; + +struct video_capture +{ + uint32_t x,y; /* Offsets into image */ + uint32_t width, height; /* Area to capture */ + uint16_t decimation; /* Decimation divider */ + uint16_t flags; /* Flags for capture */ +#define VIDEO_CAPTURE_ODD 0 /* Temporal */ +#define VIDEO_CAPTURE_EVEN 1 +}; + +struct video_buffer +{ + void *base; + int height,width; + int depth; + int bytesperline; +}; + +struct video_mmap +{ + unsigned int frame; /* Frame (0 - n) for double buffer */ + int height,width; + unsigned int format; /* should be VIDEO_PALETTE_* */ +}; + +struct video_key +{ + uint8_t key[8]; + uint32_t flags; +}; + +struct video_mbuf +{ + int size; /* Total memory to map */ + int frames; /* Frames */ + int offsets[VIDEO_MAX_FRAME]; +}; + +#define VIDEO_NO_UNIT (-1) + +struct video_unit +{ + int video; /* Video minor */ + int vbi; /* VBI minor */ + int radio; /* Radio minor */ + int audio; /* Audio minor */ + int teletext; /* Teletext minor */ +}; + +struct vbi_format { + uint32_t sampling_rate; /* in Hz */ + uint32_t samples_per_line; + uint32_t sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ + int32_t start[2]; /* starting line for each frame */ + uint32_t count[2]; /* count of lines for each frame */ + uint32_t flags; +#define VBI_UNSYNC 1 /* can distingues between top/bottom field */ +#define VBI_INTERLACED 2 /* lines are interlaced */ +}; + +/* video_info is biased towards hardware mpeg encode/decode */ +/* but it could apply generically to any hardware compressor/decompressor */ +struct video_info +{ + uint32_t frame_count; /* frames output since decode/encode began */ + uint32_t h_size; /* current unscaled horizontal size */ + uint32_t v_size; /* current unscaled veritcal size */ + uint32_t smpte_timecode; /* current SMPTE timecode (for current GOP) */ + uint32_t picture_type; /* current picture type */ + uint32_t temporal_reference; /* current temporal reference */ + uint8_t user_data[256]; /* user data last found in compressed stream */ + /* user_data[0] contains user data flags, user_data[1] has count */ +}; + +/* generic structure for setting playback modes */ +struct video_play_mode +{ + int mode; + int p1; + int p2; +}; + +/* for loading microcode / fpga programming */ +struct video_code +{ + char loadwhat[16]; /* name or tag of file being passed */ + int datasize; + uint8_t *data; +}; + +#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ +#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ +#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ +#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ +#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ +#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ +#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ +#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ +#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ +#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ +#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ +#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ +#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ +#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ +#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ +#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ +#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ +#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ +#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ +#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ +#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ +#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ +#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ +#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ +#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ +#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ +#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ +#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ +#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ + + +#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ + +/* VIDIOCSWRITEMODE */ +#define VID_WRITE_MPEG_AUD 0 +#define VID_WRITE_MPEG_VID 1 +#define VID_WRITE_OSD 2 +#define VID_WRITE_TTX 3 +#define VID_WRITE_CC 4 +#define VID_WRITE_MJPEG 5 + +/* VIDIOCSPLAYMODE */ +#define VID_PLAY_VID_OUT_MODE 0 + /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ +#define VID_PLAY_GENLOCK 1 + /* p1: 0 = OFF, 1 = ON */ + /* p2: GENLOCK FINE DELAY value */ +#define VID_PLAY_NORMAL 2 +#define VID_PLAY_PAUSE 3 +#define VID_PLAY_SINGLE_FRAME 4 +#define VID_PLAY_FAST_FORWARD 5 +#define VID_PLAY_SLOW_MOTION 6 +#define VID_PLAY_IMMEDIATE_NORMAL 7 +#define VID_PLAY_SWITCH_CHANNELS 8 +#define VID_PLAY_FREEZE_FRAME 9 +#define VID_PLAY_STILL_MODE 10 +#define VID_PLAY_MASTER_MODE 11 + /* p1: see below */ +#define VID_PLAY_MASTER_NONE 1 +#define VID_PLAY_MASTER_VIDEO 2 +#define VID_PLAY_MASTER_AUDIO 3 +#define VID_PLAY_ACTIVE_SCANLINES 12 + /* p1 = first active; p2 = last active */ +#define VID_PLAY_RESET 13 +#define VID_PLAY_END_MARK 14 + +#endif /* CONFIG_VIDEO_V4L1_COMPAT */ +#endif /* __MIN_V4L1 */ + +#endif /* __LINUX_VIDEODEV_H */ + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ Index: multimedia/v4l_compat/pkg-plist =================================================================== --- multimedia/v4l_compat/pkg-plist +++ multimedia/v4l_compat/pkg-plist @@ -1,14 +1,13 @@ -include/linux/input.h -include/linux/uinput.h -include/linux/videodev.h -include/linux/videodev2.h include/linux/dvb/audio.h include/linux/dvb/ca.h include/linux/dvb/dmx.h include/linux/dvb/frontend.h -include/linux/dvb/net.h -include/linux/dvb/osd.h include/linux/dvb/version.h include/linux/dvb/video.h -@dirrm include/linux/dvb -@dirrmtry include/linux +include/linux/input.h +include/linux/ivtv.h +include/linux/uinput.h +include/linux/v4l2-common.h +include/linux/v4l2-controls.h +include/linux/videodev.h +include/linux/videodev2.h