From ae184cda8d0eebfea6cf217abc3f94a7cfffe24d Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Fri, 14 Oct 2011 14:14:26 -0300 Subject: [media] v4l: VIDIOC_SUBDEV_S_SELECTION and VIDIOC_SUBDEV_G_SELECTION IOCTLs Add support for VIDIOC_SUBDEV_S_SELECTION and VIDIOC_SUBDEV_G_SELECTION IOCTLs. They replace functionality provided by VIDIOC_SUBDEV_S_CROP and VIDIOC_SUBDEV_G_CROP IOCTLs and also add new functionality (composing). VIDIOC_SUBDEV_G_CROP and VIDIOC_SUBDEV_S_CROP continue to be supported. Signed-off-by: Sakari Ailus Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-subdev.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'include/media/v4l2-subdev.h') diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index f0f3358d1b1b..feab950bc8ab 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -466,6 +466,10 @@ struct v4l2_subdev_pad_ops { struct v4l2_subdev_crop *crop); int (*get_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, struct v4l2_subdev_crop *crop); + int (*get_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, + struct v4l2_subdev_selection *sel); + int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, + struct v4l2_subdev_selection *sel); }; struct v4l2_subdev_ops { @@ -549,8 +553,11 @@ struct v4l2_subdev { struct v4l2_subdev_fh { struct v4l2_fh vfh; #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) - struct v4l2_mbus_framefmt *try_fmt; - struct v4l2_rect *try_crop; + struct { + struct v4l2_mbus_framefmt try_fmt; + struct v4l2_rect try_crop; + struct v4l2_rect try_compose; + } *pad; #endif }; @@ -561,13 +568,19 @@ struct v4l2_subdev_fh { static inline struct v4l2_mbus_framefmt * v4l2_subdev_get_try_format(struct v4l2_subdev_fh *fh, unsigned int pad) { - return &fh->try_fmt[pad]; + return &fh->pad[pad].try_fmt; } static inline struct v4l2_rect * v4l2_subdev_get_try_crop(struct v4l2_subdev_fh *fh, unsigned int pad) { - return &fh->try_crop[pad]; + return &fh->pad[pad].try_crop; +} + +static inline struct v4l2_rect * +v4l2_subdev_get_try_compose(struct v4l2_subdev_fh *fh, unsigned int pad) +{ + return &fh->pad[pad].try_compose; } #endif -- cgit v1.2.3-59-g8ed1b