diff options
| author | Sakari Ailus <sakari.ailus@iki.fi> | 2011-10-14 13:14:26 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-10 14:00:41 -0400 |
| commit | ae184cda8d0eebfea6cf217abc3f94a7cfffe24d (patch) | |
| tree | b158537e0b4f894578748784f581a18af5b2cc0c /include/linux | |
| parent | c520331a52094182d6682fa7d6f630bdfbfc2974 (diff) | |
[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 <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/v4l2-subdev.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h index ed29cbbebfef..812019ee1e06 100644 --- a/include/linux/v4l2-subdev.h +++ b/include/linux/v4l2-subdev.h | |||
| @@ -123,6 +123,43 @@ struct v4l2_subdev_frame_interval_enum { | |||
| 123 | __u32 reserved[9]; | 123 | __u32 reserved[9]; |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | #define V4L2_SUBDEV_SEL_FLAG_SIZE_GE (1 << 0) | ||
| 127 | #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE (1 << 1) | ||
| 128 | #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1 << 2) | ||
| 129 | |||
| 130 | /* active cropping area */ | ||
| 131 | #define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL 0x0000 | ||
| 132 | /* cropping bounds */ | ||
| 133 | #define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002 | ||
| 134 | /* current composing area */ | ||
| 135 | #define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL 0x0100 | ||
| 136 | /* composing bounds */ | ||
| 137 | #define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102 | ||
| 138 | |||
| 139 | |||
| 140 | /** | ||
| 141 | * struct v4l2_subdev_selection - selection info | ||
| 142 | * | ||
| 143 | * @which: either V4L2_SUBDEV_FORMAT_ACTIVE or V4L2_SUBDEV_FORMAT_TRY | ||
| 144 | * @pad: pad number, as reported by the media API | ||
| 145 | * @target: selection target, used to choose one of possible rectangles | ||
| 146 | * @flags: constraint flags | ||
| 147 | * @r: coordinates of the selection window | ||
| 148 | * @reserved: for future use, set to zero for now | ||
| 149 | * | ||
| 150 | * Hardware may use multiple helper windows to process a video stream. | ||
| 151 | * The structure is used to exchange this selection areas between | ||
| 152 | * an application and a driver. | ||
| 153 | */ | ||
| 154 | struct v4l2_subdev_selection { | ||
| 155 | __u32 which; | ||
| 156 | __u32 pad; | ||
| 157 | __u32 target; | ||
| 158 | __u32 flags; | ||
| 159 | struct v4l2_rect r; | ||
| 160 | __u32 reserved[8]; | ||
| 161 | }; | ||
| 162 | |||
| 126 | #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) | 163 | #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) |
| 127 | #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) | 164 | #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) |
| 128 | #define VIDIOC_SUBDEV_G_FRAME_INTERVAL \ | 165 | #define VIDIOC_SUBDEV_G_FRAME_INTERVAL \ |
| @@ -137,5 +174,9 @@ struct v4l2_subdev_frame_interval_enum { | |||
| 137 | _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum) | 174 | _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum) |
| 138 | #define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop) | 175 | #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) | 176 | #define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop) |
| 177 | #define VIDIOC_SUBDEV_G_SELECTION \ | ||
| 178 | _IOWR('V', 61, struct v4l2_subdev_selection) | ||
| 179 | #define VIDIOC_SUBDEV_S_SELECTION \ | ||
| 180 | _IOWR('V', 62, struct v4l2_subdev_selection) | ||
| 140 | 181 | ||
| 141 | #endif | 182 | #endif |
