summaryrefslogtreecommitdiff
path: root/subdev.c
diff options
context:
space:
mode:
authorTodor Tomov <ttomov@mm-sol.com>2011-01-25 17:46:48 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-02-07 15:37:56 +0100
commit14ddd592a6fcba2ceb751c0d4b0a3b5d46f2a59f (patch)
tree6feac7bd38680179ddfd51c7724989fd352c9a42 /subdev.c
parent9b546182a4707fb2afe891a3eaa5ae804aa90ec8 (diff)
Add v4l2_subdev_get_frame_interval()
Add function to get frame interval. Signed-off-by: Todor Tomov <ttomov@mm-sol.com>
Diffstat (limited to 'subdev.c')
-rw-r--r--subdev.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/subdev.c b/subdev.c
index 3a8e82a..3960d05 100644
--- a/subdev.c
+++ b/subdev.c
@@ -145,6 +145,26 @@ int v4l2_subdev_set_crop(struct media_entity *entity, struct v4l2_rect *rect,
return 0;
}
+int v4l2_subdev_get_frame_interval(struct media_entity *entity,
+ struct v4l2_fract *interval)
+{
+ struct v4l2_subdev_frame_interval ival;
+ int ret;
+
+ ret = v4l2_subdev_open(entity);
+ if (ret < 0)
+ return ret;
+
+ memset(&ival, 0, sizeof(ival));
+
+ ret = ioctl(entity->fd, VIDIOC_SUBDEV_G_FRAME_INTERVAL, &ival);
+ if (ret < 0)
+ return -errno;
+
+ *interval = ival.interval;
+ return 0;
+}
+
int v4l2_subdev_set_frame_interval(struct media_entity *entity,
struct v4l2_fract *interval)
{