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

Gareth Bult gareth at ...560...
Tue Jan 20 16:54:15 CET 2009


Ok (Phew!),

I seem to have it working (!)
V4L2 patches committed.

Note; because of various changes the demo program (MyWebCam) does not currently work.
I have patched my version to work, but it's a bit messey, I will attempt to write a new demo presently - hopefully this one will come without the flicker .. :)

V4L2 Features;

Transparent handling of V4L/V4L2 devices via "VideoDevice"
VideoDevice will use V4L2 if possible, V4L otherwise, unless "forced" with;

Cam = New VideoDevice(TxtDevice.Text, VideoDevice.V4L)

Formats supported;

a. RAW (although untested!)
b. YUYV (Logitec QuickCam 3500) - tested.
c. YUV420[p] (Logitec QuickCam 4000) - tested.
(so I now have 2 different converters in the CConverters.c)

VideoDevice.Features now includes "Card" which should be the full product name.
(eg; "Logitec QuickCam Pro 4000")

Notes; 
* V4L2 no longer supports Max/Min Width/Height for device dimensions.
* I have nothing with a Tuner, so it's not implemented on V4L2 - anyone ?
* Contrast/Color/Whiteness/Hue/Brightness no longer scale from 0-65535, hence there are
  some new properties, eg; Bright_Min,Bright_Max etc .. not sure if these should go into
  "Features" .. I'm not sure I see the point of "Features" in the first place tho'..

All main v4l2 code is in v4l2.c .. I'd quite like to re-factor all v4l code out a similar 
fashion to just leave CWebcam.c with Gambas class definition code .. this would make it 
easier to read and more maintainable ..

... just need to see if people can compile it now ...

The other major change is getting a picture out of it ( not my fault!  ;-) ) , instead of
using;

 Try PictureBox1.Picture = hWebCam.Picture

Use;

     PictureBox1.Picture = hWebCam.Image.Picture

Note; I'd avoid using "Try" as it tends to give you a blank picture and no explanation..

Also, there is now a "Debug" property which will control the output of background text with
regards to general status / unexpected results .. Debug is turned on by default at the moment.

Now working on the demo .. :)

Gareth.


----- Original Message -----
From: "Benoit Minisini" <gambas at ...1...>
To: "mailing list for gambas developers" <gambas-devel at lists.sourceforge.net>
Sent: Tuesday, 20 January, 2009 1:54:28 PM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [Gambas-devel] Webcam mods (Logitec Quickcam 4000 etc) :: testers wanted ...

On lundi 19 janvier 2009, Gareth Bult wrote:
> Ok,
>
> Answering my own question ( :) ) modifying the demo to read;
>
> Picturebox.Picture = hWebCam.Image.Picture works
> (from Picturebox.Picture = hWebCam.Picture)
>
> .. is this the way it "should" be done?

Yes. The old way actually did the same thing internally, so to simplify my 
job, I removed it.

>
> I now have the basic V4L2 code integrated and am running two webcams side
> by side, looks fine in my demo program .. however I notice there is some
> flicker on the "MyWebCam" demo, and I'm not sure where it's coming from.
> (again, not seeing it on my demo) I guess this is going to be attributes
> set on visual components (?) but I can't spot the difference.

It should come from the gui component. You can compare between gb.qt and 
gb.gtk to see if there is a difference. Anyway, I will look at that 
flickering problem after your code has been committed.

>
> Anyway, subject to implementing some of the more trivial properties (width,
> height etc..) I'm pretty much done.
>
> Just need SVN details for "oddjobz" ..

I granted you a svn write access. Please read carefully the "how to deal with 
Subversion" page in the wiki: I defined a standard for writing svn commit 
logs, so that the ChangeLog is automatically generated. So you must follow 
it!

Regards,

-- 
Benoit Minisini

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Gambas-devel mailing list
Gambas-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel

-- 
Managing Director, Encryptec Limited
Tel: 0845 5082719, Mob: 0785 3305393
Email: gareth at ...560... 
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.




More information about the Devel mailing list