On Mon, 9 Feb 2009 18:50:15 -0200 Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx> wrote: > On Thu, 5 Feb 2009 10:32:31 +0100 > Jean-Francois Moine <moinejf@xxxxxxx> wrote: [snip] > > Please pull from http://linuxtv.org/hg/~jfrancois/gspca/ > > for: [snip] > Hmm... it seems that your tree has more changesets than what you've > pointed on your pull request... I got here 15 patches. Right! And there are some more to come! I was waiting for you to do the pull before requesting a new pull... > On the last changesets, I've seen that you're adding a lot of private > controls, like those: > > +#define V4L2_CID_IMAGE_QUALITY (V4L2_CID_PRIVATE_BASE + 0) > +#define V4L2_CID_CAM_QUALITY (V4L2_CID_PRIVATE_BASE + 1) > > and, on other driver: > > +#define V4L2_CID_INFRARED (V4L2_CID_PRIVATE_BASE + 0) > +#define V4L2_CID_IMAGE_QUALITY (V4L2_CID_PRIVATE_BASE + 1) > +#define V4L2_CID_JPEG_QUALITY (V4L2_CID_PRIVATE_BASE + 2) > > We should really standardize those controls and prepare some patches > for V4L2 API also, documenting what does that mean. Btw, it as not > clear what's the difference between those "quality" controls... Well, each webcam has a lot of parameters. Some of them enter in the standard controls, some other ones are very specific. This is the case here for the zc3xx subdriver: there is a quality parameter in the bridge which accepts values from 0 to 3. This parameter is automatically set by the ms-win driver according (surely) to the luminosity, and its initial value depends on the sensor. As we have no documentation about this quality, the best for me was to have a specific control (CAM_QUALITY). What difference with the JPEG quality? This last control is used to load the quantization tables into the webcam. The quality is the standard JPEG compression quality (value 0..100 in percent). And the last control? It is not a control of the webcam. It defines the quantization tables which are added to the webcam raw images to create JPEG images readable by any JPEG/MJPEG viewer. So, while their units are the same (compression in percent), the difference between JPEG_QUALITY and IMAGE_QUALITY is that the first one is used for encoding (in the webcam) while the second one is used for decoding (by the v4l library). Indeed, I should have written some documentation, but I think most users will play with these controls before reading anything. About the two last controls (quantization tables in the webcam or added in the raw JPEG images), there is already a jpegcomp ioctl, but I could not understand how it should work. AFAIK, only one driver implements it. Otherwise, one interesting feature of the V4L2 API is the possibility for any application to handle all standard and private device controls via VIDIOC_G/S_CTRL. Usually, control changes are not done automatically by applications, but by the users. Once a user has set the controls to get correct images, he may start any viewer application (but not mplayer which resets some controls to their default!). BTW, it should be useful to have a program which saves the control values on disk at change time, device disconnection or reboot) and reload them at system start or on device connection... Cheers. -- Ken ar c'hentañ | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html