[Gambas-devel] gb.v4l update
Daniel Campos
danielcampos at ...45...
Sun Jul 3 12:54:07 CEST 2005
OK, I will apply the changes in the next release,
thanks,
Daniel
>
>Yes, of course!
>
>But before I suggest... :-)
>
>1) Renaming "VideoDev" to "VideoDevice"
>
>2) Replacing the ToString() method by sort of "Data" property that returns a
>Byte[] array.
>
>3) Make VideoDevice a stream, so that reading returns the image data.
>
>4) When a method receives a file name as argument, you *must* use the
>GB.FileName() API to get it, and not use the string argument directly:
>
>BEGIN_METHOD(save_me, GB_STRING path)
> char *filename = GB.FileName(STRING(path), LENGTH(path));
> ...
>END_METHOD
>
>Look at CIMAGE_save() in ./src/gb.qt/src/CImage.cpp if you need an example.
>
>GB.FileName() converts the file name given by the user (in UTF-8) to the
>encoding used by the system (ISO8859-15 on my Mandrake).
>
>If you don't that, file names including non-ASCII characters won't work!
>
>5) Use the file extension to guess the file format, when the format argument
>is not specified in the Save method.
>
>6) GB_PROPERTY_READ("Tuner",".VideoDevTuner",CWEBCAM_self) is not needed
>anymore. You can use: GB_PROPERTY_SELF("Tuner",".VideoDevTuner"), and then
>remove CWEBCAM_self.
>
>7) Do not prefix constants when there is no ambiguity: NormPAL -> PAL,
>SourceCOMPOSITE -> Composite, and so on.
>
>8) Replacing SelectSource() method by an integer property named Source, that
>combines Source and Norm arguments. Something like:
>
>MyVideoDevice.Source = VideoDevice.PAL + VideoDevice.Composite
>
>You may have to change the value of the constants to do that.
>
>9) I have an article in french Linux magazine that explains how to capture
>image from IEEE 1394 device. But they use a specific API... Can v4l use IEEE
>1394 devices ?
>
>10) Don't use GB.ReturnNewString("", 0); - berk! Just use GB.ReturnNull();
>
>11) Instead of using GB.ReturnNewString(str, 0);, use
>GB.ReturnNewZeroString(str);
>
>Regards,
>
>
>
More information about the Devel
mailing list