History

[media] videodev2.h: add struct v4l2_query_ext_ctrl and VIDIOC_QUERY_EXT_CTRL

Add a new struct and ioctl to extend the amount of information you can get for a control. The range is now a s64 type, and array dimensions and element size can be reported through nr_of_dims/dims/elems/elem_size.

Hans Verkuil committed 12 years ago

Commit 5082c241 parent 7e6a6821 file · +20 −0Browse files

Unified · Split

include/uapi/linux/videodev2.h+20−0
@@ -1269,6 +1269,7 @@ struct v4l2_ext_controls { · 1268 unmodified lines
12691269 #define V4L2_CTRL_ID_MASK (0x0fffffff)
12701270 #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
12711271 #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
1272+#define V4L2_CTRL_MAX_DIMS (4)
12721273
12731274 enum v4l2_ctrl_type {
12741275 V4L2_CTRL_TYPE_INTEGER = 1,
@@ -1298,6 +1299,23 @@ struct v4l2_queryctrl { · 23 unmodified lines
12981299 __u32 reserved[2];
12991300 };
13001301
1302+/* Used in the VIDIOC_QUERY_EXT_CTRL ioctl for querying extended controls */
1303+struct v4l2_query_ext_ctrl {
1304+ __u32 id;
1305+ __u32 type;
1306+ char name[32];
1307+ __s64 minimum;
1308+ __s64 maximum;
1309+ __u64 step;
1310+ __s64 default_value;
1311+ __u32 flags;
1312+ __u32 elem_size;
1313+ __u32 elems;
1314+ __u32 nr_of_dims;
1315+ __u32 dims[V4L2_CTRL_MAX_DIMS];
1316+ __u32 reserved[32];
1317+};
1318+
13011319 /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
13021320 struct v4l2_querymenu {
13031321 __u32 id;
@@ -2011,6 +2029,8 @@ struct v4l2_create_buffers { · 707 unmodified lines
20112029 Never use these in applications! */
20122030 #define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info)
20132031
2032+#define VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct v4l2_query_ext_ctrl)
2033+
20142034 /* Reminder: when adding new ioctls please add support for them to
20152035 drivers/media/video/v4l2-compat-ioctl32.c as well! */
20162036