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/media | |
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/media')
-rw-r--r-- | include/media/v4l2-subdev.h | 21 |
1 files changed, 17 insertions, 4 deletions
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 { | |||
466 | struct v4l2_subdev_crop *crop); | 466 | struct v4l2_subdev_crop *crop); |
467 | int (*get_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 467 | int (*get_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
468 | struct v4l2_subdev_crop *crop); | 468 | struct v4l2_subdev_crop *crop); |
469 | int (*get_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | ||
470 | struct v4l2_subdev_selection *sel); | ||
471 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | ||
472 | struct v4l2_subdev_selection *sel); | ||
469 | }; | 473 | }; |
470 | 474 | ||
471 | struct v4l2_subdev_ops { | 475 | struct v4l2_subdev_ops { |
@@ -549,8 +553,11 @@ struct v4l2_subdev { | |||
549 | struct v4l2_subdev_fh { | 553 | struct v4l2_subdev_fh { |
550 | struct v4l2_fh vfh; | 554 | struct v4l2_fh vfh; |
551 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) | 555 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) |
552 | struct v4l2_mbus_framefmt *try_fmt; | 556 | struct { |
553 | struct v4l2_rect *try_crop; | 557 | struct v4l2_mbus_framefmt try_fmt; |
558 | struct v4l2_rect try_crop; | ||
559 | struct v4l2_rect try_compose; | ||
560 | } *pad; | ||
554 | #endif | 561 | #endif |
555 | }; | 562 | }; |
556 | 563 | ||
@@ -561,13 +568,19 @@ struct v4l2_subdev_fh { | |||
561 | static inline struct v4l2_mbus_framefmt * | 568 | static inline struct v4l2_mbus_framefmt * |
562 | v4l2_subdev_get_try_format(struct v4l2_subdev_fh *fh, unsigned int pad) | 569 | v4l2_subdev_get_try_format(struct v4l2_subdev_fh *fh, unsigned int pad) |
563 | { | 570 | { |
564 | return &fh->try_fmt[pad]; | 571 | return &fh->pad[pad].try_fmt; |
565 | } | 572 | } |
566 | 573 | ||
567 | static inline struct v4l2_rect * | 574 | static inline struct v4l2_rect * |
568 | v4l2_subdev_get_try_crop(struct v4l2_subdev_fh *fh, unsigned int pad) | 575 | v4l2_subdev_get_try_crop(struct v4l2_subdev_fh *fh, unsigned int pad) |
569 | { | 576 | { |
570 | return &fh->try_crop[pad]; | 577 | return &fh->pad[pad].try_crop; |
578 | } | ||
579 | |||
580 | static inline struct v4l2_rect * | ||
581 | v4l2_subdev_get_try_compose(struct v4l2_subdev_fh *fh, unsigned int pad) | ||
582 | { | ||
583 | return &fh->pad[pad].try_compose; | ||
571 | } | 584 | } |
572 | #endif | 585 | #endif |
573 | 586 | ||