[Gambas-devel] Webcam mods (Logitec Quickcam 4000 etc) :: testers wanted ...

Benoit Minisini gambas at ...1...
Sat Jan 10 22:45:54 CET 2009


On vendredi 9 janvier 2009, Gareth Bult wrote:
> Hi,
>
> Attached is my version of CWebcam.c, if anyone can give this a try I would
> very much appreciate it. (against trunk)
>
> Issues;
>
> The current V4L2 assumes that the camera will return an RGB signal that it
> can stuff directly into a "Picture" or "Image" object. - not always the
> case, for example with the Logitec QuickCam 4000 (and I'm sure quite a few
> others) .
>
> As a result, a post-processor is required to convert from the Camera's
> format (in this case yuv420p) to RGB. I've inserted a hook so this (and
> possibly other) post-processing routines can be added. The actual
> conversion routine I've hijacked directly from "Camorama", pretty much no
> tweaking required.

The image buffer support of Gambas is actually being redesigned and rewritten, 
because I need more power for my own job. :-)

The current one is able to convert between different RGB formats, but not 
between YUV and RGB. Two possibilities then:

- Keep the YUV/RGB conversion in gb.v4l, assuming that only video uses YUV.

- Add the new format and the conversion routine is the future gb.image 
component.

>
> In addition and just to make life interesting, the VIDIOCGMBUF ioctl seems
> to be partially broken, not sure if it's specific to the driver for this
> camera or if it's a wider issue, however it seems to return a fixed buffer
> size and frame count, regardless of the resolution specified. For 320x240
> this is fine, two frames will fit in the allocated space and it works fine.
> However, for 640x480 it returns sufficient memory for 1 frame, but
> specifies two frames in the header - not good! (this breaks gambas pretty
> quickly) So I've included a fix to rewrite the "mbuf" field IF the contents
> are invalid, i.e. if the widthxheightxdepthxframes is greater than the
> allocated size.

OK.

>
> I'm hoping that none of this affects standard RGB cameras, again if someone
> could test I would appreciate it.
>
> If you drop this into the v4l/src directory and do a make install, if your
> Logitec wasn't working, running the webcam demo should now work.
>
> .. I'm new to hacking Gambas so if I've done something bad re; memory etc ,
> please let me know...

I will look at the code, but I have no camera to test, so volunteers are 
needed there!

Regards,

-- 
Benoit Minisini




More information about the Devel mailing list