Reading/writing controls from different classes in a single VIDIOC_[GS]_EXT_CTRLS call
Hi Hans,
I've recently run into an issue when porting a sensor driver to the control framework.
A userspace application using that driver using VIDIOC_G_EXT_CTRLS to retrieve the value of a bunch of controls in a single call. Those controls don't belong to the same class, and the application started failing.
What's the rationale behind forbidding that ?
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 10 lines · On Friday, December 17, 2010 17:17:05 Laurent Pinchart wrote:
Hi Hans,
I've recently run into an issue when porting a sensor driver to the control framework.
A userspace application using that driver using
VIDIOC_G_EXT_CTRLSto retrieve the value of a bunch of controls in a single call. Those controls don't belong to the same class, and the application started failing.What's the rationale behind forbidding that ?
Which driver? The control framework doesn't have that limitation anymore. Originally the API had that limitation, mostly to reduce driver complexity, but that limitation is lifted in the control framework.
Regards,
Hans
Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by Cisco
Quoted 10 lines · On Friday, December 17, 2010 20:52:25 Hans Verkuil wrote:
Quoted 9 lines · On Friday, December 17, 2010 17:17:05 Laurent Pinchart wrote:
Hi Hans,
I've recently run into an issue when porting a sensor driver to the control framework.
A userspace application using that driver using
VIDIOC_G_EXT_CTRLSto retrieve the value of a bunch of controls in a single call. Those controls don't belong to the same class, and the application started failing.
Quoted 5 lines
Quoted 1 line
What's the rationale behind forbidding that ?
Which driver? The control framework doesn't have that limitation anymore. Originally the API had that limitation, mostly to reduce driver complexity, but that limitation is lifted in the control framework.
A follow-up: if the ctrl_class field of v4l2_ext_controls is set to a specific control class by the application, then all controls in the list must belong to that control class. This is checked by the control framework. This matches the behavior as defined in the spec. If ctrl_class is 0, then the control framework allows controls from any class.
This doesn't seem to be documented yet. I thought I did :-(
Regards,
Hans
Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by Cisco
Hi Hans,
Quoted 18 lines · On Friday 17 December 2010 20:57:32 Hans Verkuil wrote:
Quoted 11 lines · On Friday, December 17, 2010 20:52:25 Hans Verkuil wrote:
Quoted 10 lines · On Friday, December 17, 2010 17:17:05 Laurent Pinchart wrote:
Hi Hans,
I've recently run into an issue when porting a sensor driver to the control framework.
A userspace application using that driver using
VIDIOC_G_EXT_CTRLSto retrieve the value of a bunch of controls in a single call. Those controls don't belong to the same class, and the application started failing.Quoted 5 lines
Quoted 1 line
What's the rationale behind forbidding that ?
Which driver? The control framework doesn't have that limitation anymore. Originally the API had that limitation, mostly to reduce driver complexity, but that limitation is lifted in the control framework.
Quoted 5 lines
A follow-up: if the
ctrl_classfield ofv4l2_ext_controlsis set to a specific control class by the application, then all controls in the list must belong to that control class. This is checked by the control framework. This matches the behavior as defined in the spec. Ifctrl_classis 0, then the control framework allows controls from any class.
You're correct. Thanks for the clarification.
Quoted 1 line
This doesn't seem to be documented yet. I thought I did :-(
The VIDIOC_[GS]_EXT_CTRLS documentation should state that ctrl_class = 0 is a valid option.
Signature · 3 lines
Regards, Laurent Pinchart