1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-22 20:41:26 +00:00

This kld adds V4L2 ioctl handling to the Linux compatibility layer

so that Linux apps like Skype or Flash can talk to V4L2 devices
(like webcams) via /dev/videoX.  The patches this kld is based on
have been committed to FreeBSD 9.0-current now (r221426) so this
port is only needed on eaerlier versions.

Note this port does not contain actual V4L2 drivers, those are
provided by e.g. the multimedia/webcamd port.

WWW: http://people.freebsd.org/~nox/dvb/
This commit is contained in:
Juergen Lock 2011-05-08 15:04:17 +00:00
parent ac787cb21a
commit b562f2a6f6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=273770
6 changed files with 118 additions and 0 deletions

View File

@ -181,6 +181,7 @@
SUBDIR += linux-tsmuxer
SUBDIR += linux-xmovie
SUBDIR += linux_dvbwrapper-kmod
SUBDIR += linux_v4l2wrapper-kmod
SUBDIR += lives
SUBDIR += lsdvd
SUBDIR += lxdvdrip

View File

@ -0,0 +1,59 @@
# New ports collection makefile for: linux_v4l2wrapper-kmod
# Date created: Fri May 6 22:30:00 CEST 2011
# Whom: nox@FreeBSD.org
#
# $FreeBSD$
#
PORTNAME= linux_v4l2wrapper-kmod
PORTVERSION= 1.0
CATEGORIES= multimedia kld
MASTER_SITES= LOCAL/nox \
http://people.freebsd.org/~ae/
DISTNAME= linux_v4l2_kld
EXTRACT_SUFX= .tgz
MAINTAINER= nox@FreeBSD.org
COMMENT= Linux compatibility layer - V4L2 ioctl handler
ONLY_FOR_ARCHS= i386 amd64
PATCH_STRIP= -p1
WRKSRC= ${WRKDIR}/linux_v4l2
.include <bsd.port.pre.mk>
PLIST_FILES+= "@cwd /"
PLIST_FILES+= ${KMODDIR:C,^/,,}/linux_v4l2wrapper.ko
PLIST_FILES+= "@exec kldxref ${KMODDIR}"
PLIST_FILES+= "@unexec kldxref ${KMODDIR}"
# install where x11/nvidia-driver does also:
KMODDIR= /boot/modules
MAKE_ENV+= KMODDIR="${KMODDIR}"
SYSDIR?= ${SRC_BASE}/sys
MAKE_ENV+= SYSDIR="${SYSDIR}"
CFLAGS+= ${DEBUG_FLAGS}
# try to avoid child processes when finding out if already in the kernel
.if ${OSVERSION} > 900036
INBASE= 1
.else
.if ${OSVERSION} == 900036
INBASE!= ($(SYSCTL) -n kern.features.linuxulator_v4l2 2>/dev/null || true)
.else
INBASE= 0
.endif
.endif
.if ${INBASE} == "1"
IGNORE= is already in kernel
.else
.if !exists(${SYSDIR}/Makefile)
IGNORE= requires kernel source to be installed
.endif
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,2 @@
SHA256 (linux_v4l2_kld.tgz) = 1d8d4fad58bc829f85541d41d5e29425e1453375d6b25848c20eea677119ee32
SIZE (linux_v4l2_kld.tgz) = 22170

View File

@ -0,0 +1,16 @@
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
# $FreeBSD$
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_ARCH} == "amd64"
SFX= 32
CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32
.endif
-KMOD= linux_v4l2
+KMOD= linux_v4l2wrapper
SRCS= linux_v4l2.c
.include <bsd.kmod.mk>

View File

@ -0,0 +1,30 @@
--- a/linux_v4l2.c
+++ b/linux_v4l2.c
@@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$");
#endif
#include <compat/linux/linux_ioctl.h>
-#include <compat/linux/linux_videodev.h>
-#include <compat/linux/linux_videodev_compat.h>
#include "linux_v4l2_ioctl.h"
#include "linux_videodev2.h"
@@ -71,14 +69,14 @@ linux_v4l2_modevent(module_t mod __unuse
}
static moduledata_t v4l2_mod = {
- "linux_v4l2",
+ "linux_v4l2wrapper",
linux_v4l2_modevent,
0
};
-DECLARE_MODULE(linux_v4l2, v4l2_mod, SI_SUB_SYSCALLS, SI_ORDER_ANY);
-MODULE_VERSION(linux_v4l2, 1);
-MODULE_DEPEND(linux_v4l2, linux, 1, 1, 1);
+DECLARE_MODULE(linux_v4l2wrapper, v4l2_mod, SI_SUB_SYSCALLS, SI_ORDER_ANY);
+MODULE_VERSION(linux_v4l2wrapper, 1);
+MODULE_DEPEND(linux_v4l2wrapper, linux, 1, 1, 1);
static int
linux_to_bsd_v4l2_standard(struct l_v4l2_standard *lvstd, struct v4l2_standard *vstd)

View File

@ -0,0 +1,10 @@
This kld adds V4L2 ioctl handling to the Linux compatibility layer
so that Linux apps like Skype or Flash can talk to V4L2 devices
(like webcams) via /dev/videoX. The patches this kld is based on
have been committed to FreeBSD 9.0-current now (r221426) so this
port is only needed on eaerlier versions.
Note this port does not contain actual V4L2 drivers, those are
provided by e.g. the multimedia/webcamd port.
WWW: http://people.freebsd.org/~nox/dvb/