[Gambas-devel] V4L2 for Gambas ...
Gareth Bult
gareth at ...560...
Thu Jan 22 02:27:45 CET 2009
Mmm,
>webcam.video.width
> set/get the width of the video frame
If the audio component had width then I might partially agree (!) before suggesting webcam.AudioWidth (!)
>You are now working mainly on the .video part, other can
>take the audio or control parts.
Splitting things down like this really isn't going to affect who can work on what, realistically this is handled by splitting your source up into different files ..
>Panel1.stream (what stream? audio or video)
>Panel1.webcam.stream (same?)
webcam.AudioStream
webcam.VideoStream
Is this not more obvious / in keeping with other Gambas classes?
Also [and I could be wrong] but is an additional (needless?) level of indirection going to take Gambas longer to process? (someone recently brought up the question of Gambas' performance .. and I'm guessing we should be choosing faster methods where possible?)
>KISS is not always right
I would agree. Not always ... just 99.99% .. ;-)
To be honest, I think the "VideoDevice" could be used to cope with many different device types. However, rather than trying to add lots of different optional sub-properties to handle everything, I would far rather split VideoDevice down and have "WebCam", "VideoCamera" etc etc ... this would be KISS in action and this really would help multiple developers take on the different device types.
"Some" of the code is shared, and if the v4l code is refactored in the same way I've done the v4l2 code, then all the common code can be shared by the different device types .. but having things like a "tuner" available to a webcam .. it's just confusing and it means I have to wrap all the current calls so it says "feature not available" to stop it falling in a heap if someone tries to use it.
Se have "String" and "Integer" because they are two distinct data types .. they both store data, but they are different. There is no reason why we should have one component to service webcam's and tv cards, they both handle pictures, but they are both distinctly different (!)
Incidentally .. can someone give me a practical example of why one might want to use the "stream" feature of "VideoDevice" on a webcam? (before I add the code .. because I'm not sure I see the point ??)
Gareth.
----- Original Message -----
From: "Ron_1st" <ronstk at ...124...>
To: gambas-devel at lists.sourceforge.net
Sent: Wednesday, 21 January, 2009 7:40:32 PM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [Gambas-devel] V4L2 for Gambas ...
On Wednesday 21 January 2009, Gareth Bult wrote:
> >I think that Ron_1st wanted to say, in his mail, that you can use subclasses
> >just for grouping device properties.
Yes that is correct.
>
> Mmm, but that doesn't necessarily help you when you come to "use" the component ...
>
> To be realistic, if this was useful you would have;
>
> component.dimensions.width
> component.dimensions.height
> component.dimensions.top
> component.dimensions.left
>
> Would we not?
>
> ... yet we don't .. (!)
>
> ;-)
OK I get your point and that make sense too.
But...
If component is the GUI part of webcam then this is correct
if that GUI shows the video frames that do have also width/height
and that is what you set/get with v4l(2).
webcam.width
webcam.height
sets the width/height of the GUI part, viewport
webcam.video.width
set/get the width of the video frame
and if we have this way a subclass for video it make sense to have also
webcam.audio
for audio settings volume, mute
webcam.control
i.e.snapshot button/mechanical moter move etc.
You are now working mainly on the .video part, other can
take the audio or control parts.
These assemble together the webcam as hardware device that can
be used in a frame/panel/whatever to create a webcam object
that can put in toolbox and dropped on a form as instand ready object.
Second this works nice with autocomplete too and filters just the right
properties/methods/events for the particulair part of webcam.
I hope this clear out why I suggested the subclasses.
Second this component is in my view usable for webcam/camera/tvcard
My 1'st webcam is connected to a tvcard composite connector.
My 2'nd webcam is PWC646 philips webcam with sound connected via USB
My 3'rd webcam is LogitecExpres with snapshot button connected via USB
All using v4l and or v4l2
Just example where panel1 is the GUI part for a webcam:
Panel1.width
Panel1.webcam.width
Panel1.stream (what stream? audio or video)
Panel1.webcam.stream (same?)
OK can be also
Panel1.webcam.frames
Panel1.webcam.audio
I do understand you want something to get working and thats my way to
for private toys but on the longterm mostly I see also that KISS is
not always right to be flexible and a well definied design pays back.
In this case you are the (re)creator and should do the way you like most.
If others (me?) do not like they can improve it there way, that the profit of OSS :)
Go simply your way and be happy.
Best regards,
Ron_1st
--
A: Delete the text you reply on.
Q: What to do to get my post on top?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
------------------------------------------------------------------------------
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