public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* How do private controls actually work?
@ 2010-03-01  2:56 Devin Heitmueller
  2010-03-01  8:57 ` Laurent Pinchart
  0 siblings, 1 reply; 14+ messages in thread
From: Devin Heitmueller @ 2010-03-01  2:56 UTC (permalink / raw)
  To: Linux Media Mailing List

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-03-03  3:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01  2:56 How do private controls actually work? Devin Heitmueller
2010-03-01  8:57 ` Laurent Pinchart
2010-03-01  9:07   ` Devin Heitmueller
2010-03-01  9:58     ` Hans Verkuil
2010-03-01 10:20       ` Devin Heitmueller
2010-03-01 11:18         ` Hans Verkuil
2010-03-01 22:29         ` Mauro Carvalho Chehab
2010-03-02 20:28         ` Hans Verkuil
2010-03-02 20:42           ` Devin Heitmueller
2010-03-02 20:56             ` Hans Verkuil
2010-03-02 21:23             ` Mauro Carvalho Chehab
2010-03-03  1:57               ` Andy Walls
2010-03-03  3:25                 ` Mauro Carvalho Chehab
2010-03-01 11:47       ` Andy Walls

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox