From owner-freebsd-multimedia@FreeBSD.ORG Wed Jan 17 19:51:05 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 AC8BB16A5AA; Wed, 17 Jan 2007 19:51:05 +0000 (UTC) (envelope-from steve@virtual-voodoo.com) Received: from energistic.com (mail.energistic.com [216.54.148.60]) by mx1.freebsd.org (Postfix) with ESMTP id DBA0313C455; Wed, 17 Jan 2007 19:51:04 +0000 (UTC) (envelope-from steve@virtual-voodoo.com) Received: from stevenew (static-71-98-118-50.ipslin.dsl-w.verizon.net [71.98.118.50]) (authenticated bits=0) by energistic.com (8.13.8/8.13.8) with ESMTP id l0HJL2X6046840; Wed, 17 Jan 2007 14:21:03 -0500 (EST) (envelope-from steve@virtual-voodoo.com) Message-ID: <010b01c73a6c$a08db930$d200040a@eservoffice.com> From: "Steve Ames" To: "Luigi Rizzo" , References: <20070117103205.A22896@xorpc.icir.org> Date: Wed, 17 Jan 2007 14:21:01 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 X-Spam-Status: No, score=-6.5 required=5.0 tests=AWL, BAYES_00, J_CHICKENPOX_44, J_CHICKENPOX_51,J_CHICKENPOX_55,SPF_FAIL,USER_IN_WHITELIST_TO autolearn=no version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on energistic.com Cc: steve@energistic.com, 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:51:05 -0000 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. -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 > } > } > }