From owner-freebsd-multimedia Fri May 26 10: 6:29 2000 Delivered-To: freebsd-multimedia@freebsd.org Received: from alpha.netvision.net.il (alpha.netvision.net.il [194.90.1.13]) by hub.freebsd.org (Postfix) with ESMTP id C81CE37BE51 for ; Fri, 26 May 2000 10:06:23 -0700 (PDT) (envelope-from ak@freenet.co.uk) Received: from freenet.co.uk (RAS3-p24.rlz.netvision.net.il [62.0.169.26]) by alpha.netvision.net.il (8.9.3/8.8.6) with ESMTP id UAA12814; Fri, 26 May 2000 20:05:19 +0300 (IDT) Message-ID: <392EBEA7.EFDCE058@freenet.co.uk> Date: Fri, 26 May 2000 21:12:55 +0300 From: A G F Keahan X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 4.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Randall Hopper Cc: multimedia@freebsd.org Subject: Re: TV Users - Let me bounce this off you References: <20000525210340.A44725@nc.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Randall, This sounds like a great idea. I did something similar for my webcam server/client application using SysV shared memory -- the server part was continuously capturing (and optionally jpeg-compressing) data into a shared memory buffer, and web clients (CGI scripts) were reading and sending that data to the user. However, you need some locking mechanisms that would tell your daemon when it's safe to update the buffer -- you don't want a client to read the first half of one frame, and the second half of another. In my application the solution was trivial -- to use a SysV semaphore to lock the buffer for writing, so no-one can read while it's being written into. But since your idea is much more general, you probably have to think of a more general synchronisation solution. Alex Randall Hopper wrote: > > Been thinking about a way to make writing TV apps easier (not just > easy; trivial!). An API that would allow folks to literally write their > own in Python or Tcl TV app with 5-10 lines of code. > > If you like the idea, read on. My thought is to embed all the > "configure, capture, convert, and blast" needed for a TV client of any sort > into a daemon. An app wanting video data in some format would simply say: > > tv.Connect() > tv.Configure() > tv.Start() > tv.Stop() > tv.Close() > > something along those lines. > > Does this kind of interface interest anyone? > > Potential clients would be, for example, GUI applications, one-shot > frame grabbers, webcams, on-the-fly MPEG encoders, etc. > > Potential destinations for the video data would be: any X Window > (created by Tk, wxWindows, Motif, ...whatever!), the frame buffer, a > socket, named pipe, file(s), memory buffer (user, XImage, XvShmImage), raw > device, ... > > Possible video sources are, of course, the TV cards (either directly > though the driver API or indirectly via the new Xv extension). > > BTW, GUI apps would simply say "here; take this X Window", and the > daemon would take care of all the rest (determine src and dest pixel > format, configure and fire up the TV driver, handle any format conversions > necessary [and FAST! -- using MMX if available], possibly changing between > XImage and DGA transfer automagically, using Shared memory, YUV images, or > whatever capture/convert/transfer path supported is fastest on your box, ...) > > Basically, the idea is to bury all the low-level nastiness in the > daemon so users don't have to care about driver capture formats, pixel > format conversions, available X protocols, throttling, etc. > > Hermes or SDL might be good libraries to use under-the-hood to do the > the pixel format conversion (Hermes already has MMX support; been testing > it recently with bktr TV and it looks promising). > > Anyway, thanks for reading. Please fire off any opinions, for or > against. No sense in spending time on this if desire for it is just > lukewarm. > > -- > Randall Hopper > aa8vb@nc.rr.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-multimedia" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message