VideoDigitizer problem and public API
Steve Sisak
steve.sisak at ioxperts.com
Tue Jul 12 16:31:15 GMT 2005
Hi Inge,
Sorry for the slow reply -- I've been working on supporting some of
the features you need and want to spend some time on documentation.
First, as someone pointed out, I had forgotten to post the IOXperts
FireWire register API -- it's now up at:
<ftp://ftp.ioxperts.com/IOXperts/Developers/>
I've also posted the USB API as well -- I'd appreciate it if you (or
anyone else on the developers' list) could give them a try before I
post them on the website.
The files are just Component Manager glue and should work for any OS
version or compiler back to a 68k machine -- I haven't tested with
Objective-C, however.
The glue is implemented as inline functions for C++ and out of line
C-callable glue for other languages -- the file ComponentGlue.h
contains structure definitions used by the other headers.
At 2:52 PM -0500 7/6/05, inge at mandli.com wrote:
>I'm trying to write a software that capture an image everytime the camera
>is hardware-triggered (asynchronously, not periodically). I was trying to
>use some VideoDigitizer and SequenceGrabber function calls, especially
>VDSetupBuffer and VDGrabOneFrameAsync. I always got error -2201 or -2208.
>Error -2201 (digiUnimpErr): Digitizer feature is unimplemented.
>Error -2208 (noDMAErr): Can't do DMA digitizing; that is, can't go to the
>requested destination.
I replied to this piece in provate e-mmail, but am repeating here for
the benefit of the list:
The first thing to realize here is that the QT documentation is
somewhat obsolete in this regard -- not all digitizers support
"async" grabbing style documented in Inside Macintosh.
In fact the "required" calls documented in IM aren't really required
and aren't supported by most modern digitizers.
The best reference for talking to video digitizers is an article in
develop Magazine, issue 14:
<http://www.mactech.com/articles/develop/issue_14/king_woodcock_final.html>
("develop" was a very high-quality magazine published by Apple and
edited by Caroline Rose in the 1990's -- it it still a valuable
reference work)
Most modern digitizers are what's called "compressed source only",
meaning they only implement the newer "compressed source" API where
the vdig returns buffers of compressed data rather than attempting to
draw directly to the screen or the sequence grabber's GWorld.
If you are going to attempt to call a vdig directly, you should read
this article.
Also, noDMAErr is really a "success" code -- it means that your
output parameters are correct, but the driver can't do DMA to the
destination.
Normally, I would recommend using the Sequence Grabber to avoid
having to deal with the vagaries of different digitizers, however I
also realize that it's getting pretty old and crufty -- also the
Video Digitizer API is in serious need of clarification/enhancement
in a few areas, but it's been nearly impossible to get a dialog going
with Apple.
>I have taken a look at IOExperts' public API. I have added those files in
>the project (I'm using Xcode and Objective-C). It does not seem to be able
>to work well.
Can you elaborate a bit here on what the problem is? I haven't done a
great deal of testing with Objective-C, but you should be able to
build the glue with C++ and call it from Objective-C
>Also, I want to use 'vdig' (VideoDigitizer component) as type and 'iidc'
>as subtype in the application. However, it seems like the application can
>only work with the generic SequenceGrabber component. Is it something
>that's set in the driver? How can I override it?
The video digitizer subtype is a property of the component compiled
in when it was built -- our drivers use the subtype 'DCam' -- we
shipped around 2 years before Apple chose 'iidc'.
At the momemnt, we don't implement all of the Apple IIDC calls
because we haven't had time to implement them, but the OS calls
should just be component glue and should work with out digitizer once
we implement them.
There is no harm in calling them now, but you should be prepared to
get and handle digiUnimpErr or badComponentSelector for unsupported
calls.
>Is it possible to just use Sequence Grabber function calls?
Yes. Look at the SGDataProc sample code in the Apple QuickTime
examples for how to do the same thing using the Sequence Grabber.
>Which Video Digitizer function calls should I use to interface with
>the IOExperts API?
I need to come up with a complete list of calls, but you need to
initialize the digitizer:
VDGetDigitizerInfo()
VDSetInput()
VDSetInputStandard()
//some other stuff
VDSetCompressionOnOff(true)
VDGetCompressTypes() -- returns a set of supported formats
VDSetFrameRate()
VDSetCompression()
VDGetImageDescription() -- tells you what you're getting
now, to grab a frame
VDCompressOneFrameAsync()
VDCompressDone() -- loop until you get a buffer
// use the buffer -- probably DecompressImage() or DecompressSequenceFrame()
VDReleaseCompressBuffer()
when you're done
VDSetCompressionOnOff(false)
One thing you can do is install the logging version of the IOXperts
driver (look in the same directory as the release driver on our ftp
server) and watch the calls made by the sequence grabber in the
console. (We log under /Library/Logs/IOXperts/
>FYI, my camera is Point Grey Research Scorpion IEEE-1394 digicam SCOR20SOC.
>I've downloaded the trial version of IOExperts' Industrial Camera Driver.
I have one of these which I can test with if you find any problems.
Feel free to ask more questions -- I'm a little torn between adding
functionality (like implementing the Apple IIDC calls) and writing
better documentation -- I'm trying to find the best balance with the
time available.
>Thanks much,
>Inge Yuwono
Best wishes,
-Steve
--
_________________________________________________________________________
Steve Sisak, CTO steve.sisak at ioxperts.com
IOXperts, Inc. voice: +1 617 876-2572
87 Bristol St #3A fax: +1 617 876-2337
Cambridge, MA 02139 mobile: +1 617 388-6476
More information about the Video-Developers
mailing list