linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* V4L2 control API - choosing base CID for private controls
@ 2014-05-22 11:33 Krzysztof Czarnowski
  2014-05-23  7:01 ` Hans Verkuil
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Czarnowski @ 2014-05-22 11:33 UTC (permalink / raw)
  To: linux-media

Hi,

I got completely confused while trying to create private controls with
control API and when I finally got down to sanity checks in
v4l2_ctrl_new() in v4l2-ctrls.c...

It would be nice if the following explanation by Hans (archive msg69922)
or maybe some more elaborate version could somehow make its way to
Documentation/video4linux/v4l2-controls.txt
:-)

Regards,
Krzysztof

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

* Re: V4L2 control API - choosing base CID for private controls
  2014-05-22 11:33 V4L2 control API - choosing base CID for private controls Krzysztof Czarnowski
@ 2014-05-23  7:01 ` Hans Verkuil
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2014-05-23  7:01 UTC (permalink / raw)
  To: Krzysztof Czarnowski, linux-media

On 05/22/2014 01:33 PM, Krzysztof Czarnowski wrote:
> Hi,
> 
> I got completely confused while trying to create private controls with
> control API and when I finally got down to sanity checks in
> v4l2_ctrl_new() in v4l2-ctrls.c...
> 
> It would be nice if the following explanation by Hans (archive msg69922)
> or maybe some more elaborate version could somehow make its way to
> Documentation/video4linux/v4l2-controls.txt
> :-)

Yeah, I need to improve that.

But basically you add a 'driver base' to include/uapi/linux/v4l2-controls.h
(see e.g. V4L2_CID_USER_SAA7134_BASE) where you reserve a range of private
controls for your driver and you use that base to define your controls. See
drivers/media/pci/saa7134/saa7134.h how that's done for the saa7134.

You probably tried to use V4L2_CID_PRIVATE_BASE which is not allowed in
combination with the control framework. The control framework will emulate
V4L2_CID_PRIVATE_BASE internally so old applications still work, but it's
not how they should be defined in the drivers.

Regards,

	Hans

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

end of thread, other threads:[~2014-05-23  7:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-22 11:33 V4L2 control API - choosing base CID for private controls Krzysztof Czarnowski
2014-05-23  7:01 ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).