media: v4l2-common: create v4l2_g/s_parm_cap helpers

Create helpers to handle VIDIOC_G/S_PARM by querying the
g/s_frame_interval v4l2_subdev ops.

Signed-off-by: Hans Verkuil <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
Hans Verkuil 2018-01-22 03:58:36 -05:00 • committed by Mauro Carvalho Chehab
commit 672de9a79c
2 changed files with 74 additions and 0 deletions

View file

@ -341,4 +341,30 @@ v4l2_find_nearest_format(const struct v4l2_frmsize_discrete *sizes,
*/
void v4l2_get_timestamp(struct timeval *tv);
/**
* v4l2_g_parm_cap - helper routine for vidioc_g_parm to fill this in by
* calling the g_frame_interval op of the given subdev. It only works
* for V4L2_BUF_TYPE_VIDEO_CAPTURE(_MPLANE), hence the _cap in the
* function name.
*
* @vdev: the struct video_device pointer. Used to determine the device caps.
* @sd: the sub-device pointer.
* @a: the VIDIOC_G_PARM argument.
*/
int v4l2_g_parm_cap(struct video_device *vdev,
struct v4l2_subdev *sd, struct v4l2_streamparm *a);
/**
* v4l2_s_parm_cap - helper routine for vidioc_s_parm to fill this in by
* calling the s_frame_interval op of the given subdev. It only works
* for V4L2_BUF_TYPE_VIDEO_CAPTURE(_MPLANE), hence the _cap in the
* function name.
*
* @vdev: the struct video_device pointer. Used to determine the device caps.
* @sd: the sub-device pointer.
* @a: the VIDIOC_S_PARM argument.
*/
int v4l2_s_parm_cap(struct video_device *vdev,
struct v4l2_subdev *sd, struct v4l2_streamparm *a);
#endif /* V4L2_COMMON_H_ */