aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAntti Koskipaa <akoskipa@gmail.com>2010-06-23 04:03:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:53:33 -0400
commitf6a5cb1be894468cdc69ec557d47f40c28f64642 (patch)
tree57518c84f343f0205a568c5333f5b5ead7c38ff8 /include
parent35c3017a29d278c4405a7f3ab30b814999d156d3 (diff)
[media] v4l: v4l2_subdev userspace crop API
This patch adds the VIDIOC_SUBDEV_S_CROP and G_CROP ioctls to the userland API. CROPCAP is not implemented because it's redundant. Signed-off-by: Antti Koskipaa <akoskipa@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/v4l2-subdev.h15
-rw-r--r--include/media/v4l2-subdev.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h
index c55f9e9e1dd..ed29cbbebfe 100644
--- a/include/linux/v4l2-subdev.h
+++ b/include/linux/v4l2-subdev.h
@@ -51,6 +51,19 @@ struct v4l2_subdev_format {
51}; 51};
52 52
53/** 53/**
54 * struct v4l2_subdev_crop - Pad-level crop settings
55 * @which: format type (from enum v4l2_subdev_format_whence)
56 * @pad: pad number, as reported by the media API
57 * @rect: pad crop rectangle boundaries
58 */
59struct v4l2_subdev_crop {
60 __u32 which;
61 __u32 pad;
62 struct v4l2_rect rect;
63 __u32 reserved[8];
64};
65
66/**
54 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration 67 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
55 * @pad: pad number, as reported by the media API 68 * @pad: pad number, as reported by the media API
56 * @index: format index during enumeration 69 * @index: format index during enumeration
@@ -122,5 +135,7 @@ struct v4l2_subdev_frame_interval_enum {
122 _IOWR('V', 74, struct v4l2_subdev_frame_size_enum) 135 _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
123#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \ 136#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
124 _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum) 137 _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
138#define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop)
139#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
125 140
126#endif 141#endif
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 8b7a78a013c..edeaf398d48 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -431,6 +431,10 @@ struct v4l2_subdev_pad_ops {
431 struct v4l2_subdev_format *format); 431 struct v4l2_subdev_format *format);
432 int (*set_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 432 int (*set_fmt)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
433 struct v4l2_subdev_format *format); 433 struct v4l2_subdev_format *format);
434 int (*set_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
435 struct v4l2_subdev_crop *crop);
436 int (*get_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
437 struct v4l2_subdev_crop *crop);
434}; 438};
435 439
436struct v4l2_subdev_ops { 440struct v4l2_subdev_ops {