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
1269#define V4L2_CTRL_ID_MASK (0x0fffffff)1269#define V4L2_CTRL_ID_MASK (0x0fffffff)
1270#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)1270#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
1271#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)1271#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
1272#define V4L2_CTRL_MAX_DIMS (4)
1272 1273
1273enum v4l2_ctrl_type {1274enum v4l2_ctrl_type {
1274 V4L2_CTRL_TYPE_INTEGER = 1,1275 V4L2_CTRL_TYPE_INTEGER = 1,
@@ -1298,6 +1299,23 @@ struct v4l2_queryctrl { · 23 unmodified lines
1298 __u32 reserved[2];1299 __u32 reserved[2];
1299};1300};
1300 1301
1302/* Used in the VIDIOC_QUERY_EXT_CTRL ioctl for querying extended controls */
1303struct 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
1301/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */1319/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
1302struct v4l2_querymenu {1320struct v4l2_querymenu {
1303 __u32 id;1321 __u32 id;
@@ -2011,6 +2029,8 @@ struct v4l2_create_buffers { · 707 unmodified lines
2011 Never use these in applications! */2029 Never use these in applications! */
2012#define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info)2030#define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info)
2013 2031
2032#define VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct v4l2_query_ext_ctrl)
2033
2014/* Reminder: when adding new ioctls please add support for them to2034/* Reminder: when adding new ioctls please add support for them to
2015 drivers/media/video/v4l2-compat-ioctl32.c as well! */2035 drivers/media/video/v4l2-compat-ioctl32.c as well! */
2016 2036