aboutsummaryrefslogtreecommitdiff
path: root/devel/pwlib
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2007-02-07 00:45:08 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2007-02-07 00:45:08 +0000
commit3e8f93ae0e83efe2de737ee9b6b607ac79a4c67b (patch)
tree1d7021efa2047eab6ea78be70c4f12b3db03035a /devel/pwlib
parentbcee6b713ea1fa77dfcab2164f4d4ae59709fe76 (diff)
downloadports-3e8f93ae0e83efe2de737ee9b6b607ac79a4c67b.tar.gz
ports-3e8f93ae0e83efe2de737ee9b6b607ac79a4c67b.zip
Enable proper detection of video4linux devices.
The original code detects video devices using the major/minor numbers. On FreeBSD this does not work, so rely on the name /dev/video* instead. Approved by: Steve Ames
Notes
Notes: svn path=/head/; revision=184447
Diffstat (limited to 'devel/pwlib')
-rw-r--r--devel/pwlib/files/patch-plugins-vidinput_v4l-vidinput_v4l.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/devel/pwlib/files/patch-plugins-vidinput_v4l-vidinput_v4l.cxx b/devel/pwlib/files/patch-plugins-vidinput_v4l-vidinput_v4l.cxx
new file mode 100644
index 000000000000..11c6e52b70d8
--- /dev/null
+++ b/devel/pwlib/files/patch-plugins-vidinput_v4l-vidinput_v4l.cxx
@@ -0,0 +1,26 @@
+--- plugins/vidinput_v4l/vidinput_v4l.cxx.orig Wed Jan 3 23:37:37 2007
++++ plugins/vidinput_v4l/vidinput_v4l.cxx Wed Feb 7 01:30:50 2007
+@@ -484,6 +484,15 @@
+ struct stat s;
+ if (lstat(devname, &s) == 0) {
+
++#if defined(P_FREEBSD)
++ // device numbers are irrelevant here, so we match on names instead.
++ if (filename.GetLength() <= 5 || filename.Left(5) != "video")
++ continue;
++ int num = atoi(filename.Mid(6));
++ if (num < 0 || num > 63)
++ continue;
++ vid.SetAt(num, devname);
++#else
+ static const int deviceNumbers[] = { 81 };
+ for (PINDEX i = 0; i < PARRAYSIZE(deviceNumbers); i++) {
+ if (MAJOR(s.st_rdev) == deviceNumbers[i]) {
+@@ -493,6 +502,7 @@
+ }
+ }
+ }
++#endif
+ }
+ }
+ }