Hello,

I've stumbled upon a problem when hacking the VLC v4l2 driver:

I want to enumerate all the private controls to make them available in
the interface. The code used to enumerate the controls uses the same
logic as Example 1-8 in the spec:
http://v4l2spec.bytesex.org/spec-single/v4l2.html#AEN732

Unfortunately it doesn't work as expected. My webcam provides the
following private controls:
Backlight Compensation -> V4L2_CID_PRIVATE_BASE+0
Power Line Frequency -> V4L2_CID_PRIVATE_BASE+1
Sharpness -> V4L2_CID_PRIVATE_BASE+2
White Balance Temperature Auto -> V4L2_CID_PRIVATE_BASE+12
White Balance Temperature -> V4L2_CID_PRIVATE_BASE+13
Unfortunately, ioctl( fd, VIDIOC_QUERYCTRL, &queryctrl ) on
V4L2_CID_PRIVATE_BASE+3 returns -1, which exits the private controls
enumartion code.

According to footnote [24] in the spec,
"V4L2_CTRL_FLAG_DISABLED was intended for two purposes: Drivers can skip
predefined controls not supported by the hardware (although returning
EINVAL would do as well), or disable predefined and private controls
after hardware detection without the trouble of reordering control
arrays and indices (EINVAL cannot be used to skip private controls
because it would prematurely end the enumeration)."

If I understand that correctly, the ioctl (at least for private
controls), should be succesfull for all the private controls supported
by the uvcvideo drive and set the V4L2_CTRL_FLAG_DISABLED flag if that
control isn't handled by the hardware. This would fix private control
enumartion.

Since I don't know the uvcvideo control code really well I haven't
started patching it yet and would like a confirmation from the gurus
that I'm reading the spec correctly.

Thanks,

-- 
Antoine Cellerier
dionoea
_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to