Hi,
(somehow pf-list seems to be unavailable to me currently, so I'm posting this to pd-dev, too. Sorry for duplicates. The attached patch is slightly updated compared to the first version, although not working better. And maybe someone feels inspired to do a similar thing for GEM??? Yes, please. ;)
attached hacked-up version of ./modules/image_io/pdp_v4l.c now supports Webcams with standard JPEG compression as the Eyetoy cam and others with the OV519 chipset. The support is very shaky still, though: I get a lot of decompression errors, sometimes totally black frames and lots of errors like:
Not a JPEG file: starts with 0xb8 0x94 Not a JPEG file: starts with 0xad 0x95 Not a JPEG file: starts with 0xa5 0x96 Corrupt JPEG data: premature end of data segment Unsupported marker type 0xa3 Not a JPEG file: starts with 0x8b 0x95 Not a JPEG file: starts with 0x95 0x90 Not a JPEG file: starts with 0x8d 0x95 Not a JPEG file: starts with 0x96 0x95 Not a JPEG file: starts with 0x98 0x94 Not a JPEG file: starts with 0x86 0x95 Not a JPEG file: starts with 0xbb 0x99 Corrupt JPEG data: premature end of data segment Unsupported marker type 0xf4 Not a JPEG file: starts with 0xb7 0x95
Nevertheless I can see a moving picture with the cam now, although it is more like cinema shortly after it was invented.
I suppose that I am not correctly waiting for a whole frame to arrive. The wrongly decompressed jpeg images all have their decompr. artifacts in the upper part of the pdp-output window, while the lower part is just a solid black or grey.
Unfortunatly (as the code shows) I still don't know my way around basic PDP yet, and I really would love for someone to maybe take a look at my hopefully obvious errors.
The code itself is very dirty and messy and involves a lot of guesswork on my side. A lot of it is copied from jpeg.c in libpdp, the other source is showview.c from the only working camera applications for ov519 cams (I posted a link a while ago).
My changes are between the /* fbar: jpeg start */ and /* fbar: jpeg end */ comments.
The main action happens in "load_packet_jpeg", which is called from pdp_v4l_bang. I set: x->x_v4l_palette = VIDEO_PALETTE_RGB24; there which was the final guessed step to give a picture, hooray.
I wonder, how jpeg_decompression or similar functionality can be included in pdp_v4l. It could become a second argument to pdp_v4l_open IMO, like: [open /dev/video1 jpeg=1( or similar. Or make a new method for this or, the holy grail, let pdp autodetect jpeg, but this is way above my head. Currently my code just ignores this all and just expects an ov519 cam.
Well, that's it for now. Feedback and help would be highly appreciated.
Ciao