From owner-freebsd-multimedia@FreeBSD.ORG Wed Jan 17 19:25:02 2007 Return-Path: X-Original-To: multimedia@freebsd.org Delivered-To: freebsd-multimedia@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF1F016A407; Wed, 17 Jan 2007 19:25:02 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id 9813F13C45E; Wed, 17 Jan 2007 19:25:02 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l0HJOwP0023641; Wed, 17 Jan 2007 11:24:58 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l0HJOwuR023640; Wed, 17 Jan 2007 11:24:58 -0800 (PST) (envelope-from rizzo) Date: Wed, 17 Jan 2007 11:24:58 -0800 From: Luigi Rizzo To: Steve Ames Message-ID: <20070117112458.A23628@xorpc.icir.org> References: <20070117103205.A22896@xorpc.icir.org> <010b01c73a6c$a08db930$d200040a@eservoffice.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <010b01c73a6c$a08db930$d200040a@eservoffice.com>; from steve@virtual-voodoo.com on Wed, Jan 17, 2007 at 02:21:01PM -0500 Cc: steve@energistic.com, marcus@freebsd.org, multimedia@freebsd.org Subject: Re: pwlib patch for proper video4l device detection X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2007 19:25:03 -0000 On Wed, Jan 17, 2007 at 02:21:01PM -0500, Steve Ames wrote: > No objections. I don't use video so I'm happy to see patches from people who > are. Instead of using > > #if 1 > > could you use > > #if defined(P_FREEBSD) > > (or some other FreeBSD specific variable) instead so that this patch can be > sent upstream and used on both FreeBSD and other OS? I'll happily forward > the patch onto the powers that be at voxgratia. sure - it was just testing code cheers luigi > -Steve > > Luigi Rizzo wrote: > > Hi pwlib maintainers (and multimedia people), > > pwlib does the detection of video4linux devices using the > > major/minor numbers, which makes no sense on FreeBSD where > > we have devfs. > > > > The patch at > > http://info.iet.unipi.it/~luigi/FreeBSD/patch-zz-vidinput_v4l fixes > > this - it is relatively simple, see below (apart from > > whitespace issues). > > > > If you don't have objections i would like to commit it to > > the port, so that things like ekiga can access the webcams. > > > > Suitable v4l drivers are > > in ports/multimedia/pwcbsd and at > > http://info.iet.unipi.it/~luigi/FreeBSD/usb-cameras.html > > > > cheers > > luigi > > > > --- plugins/vidinput_v4l/vidinput_v4l.cxx.orig Sat Jun 10 17:57:46 > > 2006 +++ plugins/vidinput_v4l/vidinput_v4l.cxx Tue Jan 16 19:19:18 > > 2007 @@ -474,7 +474,15 @@ > > if (devdir.GetInfo(info) && info.type == > > PFileInfo::CharDevice) { struct stat s; > > if (lstat(devname, &s) == 0) { > > - > > +#if 1 > > + int l = strlen(filename); > > + int num = filename[l-1] - '0'; > > + if (filename[0] == 'v' && filename[1] == 'i' && > > filename[2] == 'd' && + num >= 0 && num < 10) { > > + //cout << "reading device " << devname << " minor " << num > > << "\n"; + 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]) { > > @@ -484,6 +492,7 @@ > > } > > } > > } > > +#endif > > } > > } > > } >