diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2012-05-04 11:24:41 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-05-05 13:38:50 +0200 |
commit | edad96b36f85dad7f681a7938b50b4619d11ed50 (patch) | |
tree | 49c04f475e0682f6507522cb202d2d71b9d2fc25 /src/v4l2subdev.h | |
parent | 46bec667b675573cf1ce698c68112e3dbd31930e (diff) |
Support selections API for crop
Support the new selections API for crop. Fall back to use the old crop API
in case the selection API isn't available.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/v4l2subdev.h')
-rw-r--r-- | src/v4l2subdev.h | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/v4l2subdev.h b/src/v4l2subdev.h index 1e75f94..5d55482 100644 --- a/src/v4l2subdev.h +++ b/src/v4l2subdev.h @@ -88,34 +88,38 @@ int v4l2_subdev_set_format(struct media_entity *entity, enum v4l2_subdev_format_whence which); /** - * @brief Retrieve the crop rectangle on a pad. + * @brief Retrieve a selection rectangle on a pad. * @param entity - subdev-device media entity. - * @param rect - crop rectangle to be filled. + * @param r - rectangle to be filled. * @param pad - pad number. + * @param target - selection target * @param which - identifier of the format to get. * - * Retrieve the current crop rectangleon the @a entity @a pad and store it in - * the @a rect structure. + * Retrieve the @a target selection rectangle on the @a entity @a pad + * and store it in the @a rect structure. * - * @a which is set to V4L2_SUBDEV_FORMAT_TRY to retrieve the try crop rectangle - * stored in the file handle, of V4L2_SUBDEV_FORMAT_ACTIVE to retrieve the - * current active crop rectangle. + * @a which is set to V4L2_SUBDEV_FORMAT_TRY to retrieve the try + * selection rectangle stored in the file handle, or + * V4L2_SUBDEV_FORMAT_ACTIVE to retrieve the current active selection + * rectangle. * * @return 0 on success, or a negative error code on failure. */ -int v4l2_subdev_get_crop(struct media_entity *entity, struct v4l2_rect *rect, - unsigned int pad, enum v4l2_subdev_format_whence which); +int v4l2_subdev_get_selection(struct media_entity *entity, + struct v4l2_rect *rect, unsigned int pad, unsigned int target, + enum v4l2_subdev_format_whence which); /** - * @brief Set the crop rectangle on a pad. + * @brief Set a selection rectangle on a pad. * @param entity - subdev-device media entity. * @param rect - crop rectangle. * @param pad - pad number. + * @param target - selection target * @param which - identifier of the format to set. * - * Set the crop rectangle on the @a entity @a pad to @a rect. The driver is - * allowed to modify the requested rectangle, in which case @a rect is updated - * with the modifications. + * Set the @a target selection rectangle on the @a entity @a pad to @a + * rect. The driver is allowed to modify the requested rectangle, in + * which case @a rect is updated with the modifications. * * @a which is set to V4L2_SUBDEV_FORMAT_TRY to set the try crop rectangle * stored in the file handle, of V4L2_SUBDEV_FORMAT_ACTIVE to configure the @@ -123,8 +127,9 @@ int v4l2_subdev_get_crop(struct media_entity *entity, struct v4l2_rect *rect, * * @return 0 on success, or a negative error code on failure. */ -int v4l2_subdev_set_crop(struct media_entity *entity, struct v4l2_rect *rect, - unsigned int pad, enum v4l2_subdev_format_whence which); +int v4l2_subdev_set_selection(struct media_entity *entity, + struct v4l2_rect *rect, unsigned int pad, unsigned int target, + enum v4l2_subdev_format_whence which); /** * @brief Retrieve the frame interval on a sub-device. |