From owner-freebsd-emulation@FreeBSD.ORG Sat May 30 10:32:59 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B2D8106566C; Sat, 30 May 2009 10:32:59 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from dd12710.kasserver.com (dd12710.kasserver.com [85.13.134.233]) by mx1.freebsd.org (Postfix) with ESMTP id 872548FC19; Sat, 30 May 2009 10:32:57 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from localhost.my.domain (ppp-93-104-110-94.dynamic.mnet-online.de [93.104.110.94]) by dd12710.kasserver.com (Postfix) with ESMTP id BDC48184FD3CE; Sat, 30 May 2009 12:32:57 +0200 (CEST) Received: (from guru@localhost) by localhost.my.domain (8.14.3/8.14.3/Submit) id n4UAWsC1003426; Sat, 30 May 2009 12:32:54 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Sat, 30 May 2009 12:32:54 +0200 From: Matthias Apitz To: Luigi Rizzo Message-ID: <20090530103254.GA3368@current.Sisis.de> References: <200804142217.17035.beech@FreeBSD.org> <20090530070025.GA2465@current.Sisis.de> <200905300955.34102.hselasky@freebsd.org> <20090530090540.GC46541@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20090530090540.GC46541@onelab2.iet.unipi.it> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 8.0-CURRENT (i386) Cc: freebsd-multimedia@freebsd.org, freebsd-emulation@freebsd.org, Hans Petter Selasky Subject: Re: Skype-2.0 is here! X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2009 10:32:59 -0000 El día Saturday, May 30, 2009 a las 11:05:40AM +0200, Luigi Rizzo escribió: > On Sat, May 30, 2009 at 09:55:32AM +0200, Hans Petter Selasky wrote: > > > > Hi all, > > > > We need some common effort to get Video4Linux USB devices working on FreeBSD. > > First of all we need to push a video4linux library. > > > > -lvideodevx > > > > Methods: > > > > int videodevx_open(int unit); /* returns a handle, not neccesarily a > > file-handle */ > > int videodevx_read(int hdl, ptr, len); > > int videodevx_write(int hdl, ptr, len); > > int videodevx_ioctl(int hdl, cmd, arg); > > int videodevx_mmap(int hdl, void *addr, size_t len, int prot, int flags, int > > fd, off_t offset); > > int videodevx_getfd(int hdl); /* used for polling */ > > int videodevx_close(int hdl); > > > > Some work in progress is available from: > > > > svn --username anonsvn --password anonsvn \ > > checkout svn://svn.turbocat.net/i4b/trunk/usbcam > > > > Download "linux-2.6.29" to "ulinux/linux" > > > > cd ulinux > > > > make clean all > > > > NOTE: It's not linking yet. > > > > Second, we need a userland port for Video4Linux, which I am working on. So > > that the application directly receives the USB data and talks to the webcam > > through -lvideodevx and the new BSD licensed -lusb . > > > > Third we need to convince everyone to use videodevx when opening video > > devices. On linux videodevx will simply be a wrapper for > > open/close/ioctl/... . On FreeBSD videodevx will be a complete USB webcam > > driver library. > > > > Anyone that wants to join heads? > > Excellent summary which covers the situation for native apps. > > I wonder if the case is a bit different for skype and linux binaries > in general, as they run under linux emulation so perhaps the > it is the linuxulator that has to emulate the v4l(2?) calls, > and i have no idea if this needs to be done in the kernel or we > can deal with this in some libc wrapper ? Some time ago (using RELENG_7) I did some effort to port Ekiga, PWLib and Opal out of SVN to FreeBSD because the port versions have been outdated at this time. I wanted to use the Ekiga client to connect to our Polycon VC system but there was a bug in the Polycon which could not decifer the video encoding and so this ended up for me in a dead project :-( old details are here: http://wiki.ekiga.org/index.php/Compile_your_own_SVN_version_of_Ekiga_on_FreeBSD In any case, there was support for video in ptlib/plugins/vidinput_v4l/vidinput_v4l.cxx and the only change I had to made to make it work in FreeBSD was the manner of picking up the /dev/video0 and not using the Linux major and minor number: #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]) { PINDEX num = MINOR(s.st_rdev); if (num <= 63 && num >= 0) { vid.SetAt(num, devname); } } } #endif the rest of the code was just working above the /dev/video0 device provided by the pwc.ko. I'm wondering if we could make use of the PTlib plug-in for this as well? To bring it under the linuxemulator is another story, though. CU matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.unixarea.de/ People who hate Microsoft Windows use Linux but people who love UNIX use FreeBSD.