summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/videodev2.h
diff options
context:
space:
mode:
authorHans Verkuil2014-03-27 15:25:45 +0100
committerMauro Carvalho Chehab2014-07-17 15:38:44 +0200
commit7e6a68210784dcea8e39fd9d4c9966f9c733ba09 (patch)
tree0ed9fbef6e8f0bb0c67d9fda48f840e27e987d53 /include/uapi/linux/videodev2.h
parent[media] v4l2-ctrls: use pr_info/cont instead of printk (diff)
downloadkernel-qcow2-linux-7e6a68210784dcea8e39fd9d4c9966f9c733ba09.tar.gz
kernel-qcow2-linux-7e6a68210784dcea8e39fd9d4c9966f9c733ba09.tar.xz
kernel-qcow2-linux-7e6a68210784dcea8e39fd9d4c9966f9c733ba09.zip
[media] videodev2.h: add initial support for compound controls
Compound controls are controls that can be used for compound and array types. This allows for more compound data structures to be used with the control framework. The existing V4L2_CTRL_FLAG_NEXT_CTRL flag will only enumerate non-compound controls, so a new V4L2_CTRL_FLAG_NEXT_COMPOUND flag is added to enumerate compound controls. Set both flags to enumerate any control (compound or not). Compound control types will start at V4L2_CTRL_COMPOUND_TYPES. In addition, any control that uses the new 'ptr' field or the existing 'string' field will have flag V4L2_CTRL_FLAG_HAS_PAYLOAD set. While not strictly necessary, adding that flag makes life for applications a lot simpler. If the flag is not set, then the control value is set through the value or value64 fields of struct v4l2_ext_control, otherwise a pointer points to the value. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/uapi/linux/videodev2.h')
-rw-r--r--include/uapi/linux/videodev2.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 168ff507bf75..438c4a65c5b2 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1254,6 +1254,7 @@ struct v4l2_ext_control {
__s32 value;
__s64 value64;
char *string;
+ void *ptr;
};
} __attribute__ ((packed));
@@ -1278,7 +1279,10 @@ enum v4l2_ctrl_type {
V4L2_CTRL_TYPE_CTRL_CLASS = 6,
V4L2_CTRL_TYPE_STRING = 7,
V4L2_CTRL_TYPE_BITMASK = 8,
- V4L2_CTRL_TYPE_INTEGER_MENU = 9,
+ V4L2_CTRL_TYPE_INTEGER_MENU = 9,
+
+ /* Compound types are >= 0x0100 */
+ V4L2_CTRL_COMPOUND_TYPES = 0x0100,
};
/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
@@ -1314,9 +1318,11 @@ struct v4l2_querymenu {
#define V4L2_CTRL_FLAG_SLIDER 0x0020
#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
#define V4L2_CTRL_FLAG_VOLATILE 0x0080
+#define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100
-/* Query flag, to be ORed with the control ID */
+/* Query flags, to be ORed with the control ID */
#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
+#define V4L2_CTRL_FLAG_NEXT_COMPOUND 0x40000000
/* User-class control IDs defined by V4L2 */
#define V4L2_CID_MAX_CTRLS 1024