[Pxc] pxc and pxcdd libraries anyone ?

Francesco Callari francoc@geometrix.com
Fri, 08 Sep 2000 15:32:49 -0700


Wow, that was *fast* - and it almsot midnite in Italy too :-)

>> but wonder if anyone has already some
>> work porting/reverse-engineering the Imagenation SDK,
>> i.e. the PXC2, FRAME and PXCDD libraries. 
>
>I don't know what those beasts are, 

The PXC2 and FRAME are the APIs documented in the PXC200 
programmer's manual, PXCDD is the DirectDraw library that
allows to display live video in a (MS)window. 

> As far as the incompatibility between my
>implementation and ImageNation's API, it's because I don't like theirs

I know, some things suck, some just don't work (e.g. exporting a BMP image),
but to me the overall design seems sound - especially compared to other
frame grabber SDKs I've seen. 

For example, I like the simple way the API implements
asynchronous grabbing, without forcing you to use some ring
buffer structure and associated locks as others do. 
It's as simple as
        
        handle_1 = pxc->Grab(buffer_1, QUEUED); // QUEUED = nonblocking
        handle_2 = pxc->Grab(buffer_2, QUEUED); 
        for (;;) {
                pxc->WaitFinished(handle_1);
                doMyStuff(buffer1);
                handle_1 = pxc->Grab(buffer_1, QUEUED);

                pxc->WaitFinished(handle_2);
                doMyStuff(buffer_2);
                handle_2 = pxc->Grab(buffer_2, QUEUED);
        }

With something like this I can do subpixel laser stripe extration at 30Hz
on full B&W frames, taking advantage of the DMA transfer to memory of the next
frame while the current is being processed.

What exactly you don't like? And what incompatibilities
do you refer to? I thought your code was essentially a device driver, I
wasn't aware that there was an actual API in there. The documentation does
not mention it, but admittedly I haven't gone through your sources yet.

>As a matter of facts, I initially planned to implement a compatibility 
>library, useable by including "pxc200-compat.h" (or similar name) and
>by linking with -lpxc.

Yup, a library is exactly what I have in mind. It sits on top of your
driver and provides a drop-in replacement for Imagenation's higher-level 
APIs. Again, I am not quite clear about the compatibility bit - compatible 
with what other library? 

As far as visualization/live video display, it's probably going to be
harder to keep any source compatibility with windoze code (which uses the
PXCDD library), but that's ok, I think. Does your application use an
X server extension (MIT-SHM?), or do you just copy the pixels into a
pixmap and pass it to the server?

Cheers
Franco