From b23b7d2a8d967834e5be01ec654e53ce6a1edf8e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 Sep 2006 13:42:05 -0300 Subject: Frame format enumeration (1/2) From: Laurent Pinchart Add VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS ioctls to enumerate supported frame sizes and frame intervals. Signed-off-by: Martin Rubli Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev2.h | 75 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index c269a76ca..c3c175f93 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -276,6 +276,79 @@ struct v4l2_fmtdesc #define V4L2_FMT_FLAG_COMPRESSED 0x0001 +/* + * F R A M E S I Z E E N U M E R A T I O N + */ +enum v4l2_frmsizetypes +{ + V4L2_FRMSIZE_TYPE_DISCRETE = 1, + V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, + V4L2_FRMSIZE_TYPE_STEPWISE = 3, +}; + +struct v4l2_frmsize_discrete +{ + __u32 width; /* Frame width [pixel] */ + __u32 height; /* Frame height [pixel] */ +}; + +struct v4l2_frmsize_stepwise +{ + __u32 min_width; /* Minimum frame width [pixel] */ + __u32 max_width; /* Maximum frame width [pixel] */ + __u32 step_width; /* Frame width step size [pixel] */ + __u32 min_height; /* Minimum frame height [pixel] */ + __u32 max_height; /* Maximum frame height [pixel] */ + __u32 step_height; /* Frame height step size [pixel] */ +}; + +struct v4l2_frmsizeenum +{ + __u32 index; /* Frame size number */ + __u32 pixel_format; /* Pixel format */ + __u32 type; /* Frame size type the device supports. */ + + union { /* Frame size */ + struct v4l2_frmsize_discrete discrete; + struct v4l2_frmsize_stepwise stepwise; + }; + + __u32 reserved[2]; /* Reserved space for future use */ +}; + +/* + * F R A M E R A T E E N U M E R A T I O N + */ +enum v4l2_frmivaltypes +{ + V4L2_FRMIVAL_TYPE_DISCRETE = 1, + V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, + V4L2_FRMIVAL_TYPE_STEPWISE = 3, +}; + +struct v4l2_frmival_stepwise +{ + struct v4l2_fract min; /* Minimum frame interval [s] */ + struct v4l2_fract max; /* Maximum frame interval [s] */ + struct v4l2_fract step; /* Frame interval step size [s] */ +}; + +struct v4l2_frmivalenum +{ + __u32 index; /* Frame format index */ + __u32 pixel_format; /* Pixel format */ + __u32 width; /* Frame width */ + __u32 height; /* Frame height */ + __u32 type; /* Frame interval type the device supports. */ + + union { /* Frame interval */ + struct v4l2_fract discrete; + struct v4l2_frmival_stepwise stepwise; + }; + + __u32 reserved[2]; /* Reserved space for future use */ +}; + /* * T I M E C O D E */ @@ -1315,6 +1388,8 @@ struct v4l2_streamparm #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) +#define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) +#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) #ifdef __OLD_VIDIOC_ /* for compatibility, will go away some day */ -- cgit v1.2.3 From 59f58677a8880937bdab0ca6cee7c0176ee1d44a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 Sep 2006 13:48:26 -0300 Subject: Mark the two newer ioctls as experimental From: Mauro Carvalho Chehab VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS ioctls are meant to be used to provide better support for webcams. Currently, it is not yet used on kernel drivers. Better to keep it marked as experimental, until we have several kernel drivers supporting those features. Signed-off-by: Mauro Carvalho Chehab --- linux/include/linux/videodev2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux/include') diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index c3c175f93..f886a85ac 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -276,6 +276,8 @@ struct v4l2_fmtdesc #define V4L2_FMT_FLAG_COMPRESSED 0x0001 +#if 1 /*KEEP*/ + /* Experimental Frame Size and frame rate enumeration */ /* * F R A M E S I Z E E N U M E R A T I O N */ @@ -348,6 +350,7 @@ struct v4l2_frmivalenum __u32 reserved[2]; /* Reserved space for future use */ }; +#endif /* * T I M E C O D E @@ -1388,8 +1391,10 @@ struct v4l2_streamparm #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) +#if 1 /*KEEP*/ #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) +#endif #ifdef __OLD_VIDIOC_ /* for compatibility, will go away some day */ -- cgit v1.2.3