How do private controls actually work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This might seem like a bit of a silly question, but I've been banging
my head on the wall for a while on this.

I need to add a single private control to the saa7115 driver.
However, it's not clear to me exactly how this is supposed to work.

The v4l2-ctl program will always use the extended controls interface
for private controls, since the code only uses the g_ctrl ioctl if the
class is V4L2_CTRL_CLASS_USER (and the control class for private
controls is V4L2_CID_PRIVATE_BASE).

However, if you look at the actual code in v4l2-ioctl.c, the call for
g_ext_ctrls calls check_ext_ctrls(), which fails because
"V4L2_CID_PRIVATE_BASE cannot be used as control class when using
extended controls."

The above two behaviors would seem to be conflicting.

My original plan was to implement it as a non-extended control, but
the v4l2-ctl application always sent the get call using the extended
interface.  So then I went to convert saa7115 to use the extended
control interface, but then found out that the v4l2 core wouldn't
allow an extended control to use a private control number.

To make matters worse, the G_CTRL function that supposedly passes
through calls to vidioc_g_ext_ctrl also calls check_ext_ctrl(), so if
you want to have a private control then you would need to implement
both the extended controls interface and the older g_ctrl in the
driver (presumably the idea was that you would be able to only need to
implement an extended controls interface, but that doesn't work given
the above).

I can change v4l2-ctl to use g_ctrl for private controls if we think
that is the correct approach.  But I didn't want to do that until I
knew for sure that it is correct that you can never have a private
extended control.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
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

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux