* [Fwd: [PATCH 2.6.31.5 1/1] v4l2: add new define for last camera class control id]
@ 2009-11-17 13:51 Mauro Carvalho Chehab
2009-11-17 14:30 ` Hans Verkuil
0 siblings, 1 reply; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2009-11-17 13:51 UTC (permalink / raw)
To: Linux Media Mailing List; +Cc: Bertrand
Hi Bertrand,
Please, always send patches c/c to:
linux-media@vger.kernel.org.
This way, people can better review it.
For more details, please read:
http://linuxtv.org/wiki/index.php/Development:_How_to_submit_patches
There are some additional details on how patch submission works at:
http://linuxtv.org/hg/v4l-dvb/file/tip/README.patches
I'm forwarding it to the ML. I'll comment about it there.
Cheers,
Mauro.
-------- Mensagem original --------
Assunto: [PATCH 2.6.31.5 1/1] v4l2: add new define for last camera class control id
Data: Wed, 11 Nov 2009 22:00:24 +0100
De: Bertrand <ba@cykian.net>
Para: Mauro Carvalho Chehab <mchehab@infradead.org>
The videodev2.h file contains, among other things, defines that point
to the control properties of video devices.
For the standard video controls, there is a V4L2_CID_BASE define for
the base, and a pointer to the last control ID plus 1 named
V4L2_CID_LASTP1.
This allows automatic, version independent enumeration of the controls.
There are other controls which are specific to the camera class
devices. While there is a V4L2_CID_CAMERA_CLASS_BASE define, there was
none for the last one.
As a result it was not possible to do an enumeration of the controls
of that class. This patch corrects this by adding a
V4L2_CID_CAMERA_CLASS_LASTP1 define.
Signed-off-by: Bertrand Achard <ba@cykian.net>
--- linux-2.6.31.5/include/linux/videodev2.h 2009-10-23 00:57:56.000000000 +0200
+++ linux-2.6.31.5-n/include/linux/videodev2.h 2009-11-11
21:48:48.000000000 +0100
@@ -1147,6 +1147,8 @@ enum v4l2_exposure_auto_type {
#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
+#define V4L2_CID_CAMERA_CLASS_LASTP1 (V4L2_CID_CAMERA_CLASS_BASE+17)
+
/*
* T U N I N G
*/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Fwd: [PATCH 2.6.31.5 1/1] v4l2: add new define for last camera class control id]
2009-11-17 13:51 [Fwd: [PATCH 2.6.31.5 1/1] v4l2: add new define for last camera class control id] Mauro Carvalho Chehab
@ 2009-11-17 14:30 ` Hans Verkuil
0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2009-11-17 14:30 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Bertrand
> Hi Bertrand,
>
> Please, always send patches c/c to:
> linux-media@vger.kernel.org.
> This way, people can better review it.
>
> For more details, please read:
> http://linuxtv.org/wiki/index.php/Development:_How_to_submit_patches
>
> There are some additional details on how patch submission works at:
> http://linuxtv.org/hg/v4l-dvb/file/tip/README.patches
>
> I'm forwarding it to the ML. I'll comment about it there.
>
> Cheers,
> Mauro.
>
> -------- Mensagem original --------
> Assunto: [PATCH 2.6.31.5 1/1] v4l2: add new define for last camera class
> control id
> Data: Wed, 11 Nov 2009 22:00:24 +0100
> De: Bertrand <ba@cykian.net>
> Para: Mauro Carvalho Chehab <mchehab@infradead.org>
>
> The videodev2.h file contains, among other things, defines that point
> to the control properties of video devices.
>
> For the standard video controls, there is a V4L2_CID_BASE define for
> the base, and a pointer to the last control ID plus 1 named
> V4L2_CID_LASTP1.
> This allows automatic, version independent enumeration of the controls.
>
> There are other controls which are specific to the camera class
> devices. While there is a V4L2_CID_CAMERA_CLASS_BASE define, there was
> none for the last one.
> As a result it was not possible to do an enumeration of the controls
> of that class. This patch corrects this by adding a
> V4L2_CID_CAMERA_CLASS_LASTP1 define.
Hi Bertrand,
Enumerating controls that are not part of the user controls or the private
controls must use the V4L2_CTRL_FLAG_NEXT_CTRL flag when enumerating:
http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html#id2762121
If a driver does not support that, then that driver should be fixed.
Note that this can also be used for user and private controls, but most
drivers do not do that. I'm working on a better driver framework that will
handle this in the core inside of depending on the driver support.
The old style of using LASTP defines is really bad and inflexible and
should be avoided for extended controls.
Regards,
Hans
>
> Signed-off-by: Bertrand Achard <ba@cykian.net>
>
> --- linux-2.6.31.5/include/linux/videodev2.h 2009-10-23 00:57:56.000000000
> +0200
> +++ linux-2.6.31.5-n/include/linux/videodev2.h 2009-11-11
> 21:48:48.000000000 +0100
> @@ -1147,6 +1147,8 @@ enum v4l2_exposure_auto_type {
>
> #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
>
> +#define V4L2_CID_CAMERA_CLASS_LASTP1 (V4L2_CID_CAMERA_CLASS_BASE+17)
> +
> /*
> * T U N I N G
> */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-17 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-17 13:51 [Fwd: [PATCH 2.6.31.5 1/1] v4l2: add new define for last camera class control id] Mauro Carvalho Chehab
2009-11-17 14:30 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox