Skip to contentSkip to conversation

Reading/writing controls from different classes in a single VIDIOC_[GS]_EXT_CTRLS call

DISCUSSION Laurent Pinchart 2 participants 4 messages Dec 17, 2010 – Dec 20, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw
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_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 ?

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
#2 lore raw
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_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.

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
#3 lore raw

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_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.

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_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.

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