List Info

Thread: pwlib patch: Proper detection of video4linux under FreeBSD




pwlib patch: Proper detection of video4linux under FreeBSD
country flaguser name
United States
2007-02-07 10:15:33
Hello,

Following is a small patch to enable proper detection of
video4linux devices under FreeBSD. The original code
detects video devices using the major/minor numbers. On
FreeBSD this doesn't work so we rely on the name
/dev/video* instead.

This patch applies cleanly to 1.10.3.

-Steve

--- 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[] = ;
           for (PINDEX i = 0; i <
PARRAYSIZE(deviceNumbers); i++) {
             if (MAJOR(s.st_rdev) == deviceNumbers[i]) {
 -493,6
+502,7 
               }
             }
           }
+#endif
         }
       }
     }
------------------------------------------------------------
------------
Check the FAQ before asking! - http://www.
openh323.org/~openh323/fom.cgi
The OpenH323 Project mailing list, using Mailman. To
unsubscribe or
change your subscription options, goto
htt
p://www.openh323.org/mailman/listinfo/openh323
Maintained by Quicknet Technologies, Inc - http://www.quicknet.net
------------------------------------------------------------
------------

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )