diff options
author | Daniel Drake <dsd@laptop.org> | 2010-09-24 13:17:37 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:17:06 -0400 |
commit | b0326b7f8de020d70487673123bc93138c091151 (patch) | |
tree | 0d602baa2d6502af3cd6abc571e3b55ac55a08b3 /drivers/media/video/ov7670.c | |
parent | e99dfcf7f68d8dffccfa795d1548790cee2d7395 (diff) |
[media] ov7670: implement VIDIOC_ENUM_FRAMESIZES
GStreamer uses this.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ov7670.c')
-rw-r--r-- | drivers/media/video/ov7670.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c index ffccac5c2d75..a18dcd05087b 100644 --- a/drivers/media/video/ov7670.c +++ b/drivers/media/video/ov7670.c | |||
@@ -907,6 +907,22 @@ static int ov7670_enum_frameintervals(struct v4l2_subdev *sd, | |||
907 | } | 907 | } |
908 | 908 | ||
909 | /* | 909 | /* |
910 | * Frame size enumeration | ||
911 | */ | ||
912 | static int ov7670_enum_framesizes(struct v4l2_subdev *sd, | ||
913 | struct v4l2_frmsizeenum *fsize) | ||
914 | { | ||
915 | __u32 index = fsize->index; | ||
916 | if (index >= N_WIN_SIZES) | ||
917 | return -EINVAL; | ||
918 | |||
919 | fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; | ||
920 | fsize->discrete.width = ov7670_win_sizes[index].width; | ||
921 | fsize->discrete.height = ov7670_win_sizes[index].height; | ||
922 | return 0; | ||
923 | } | ||
924 | |||
925 | /* | ||
910 | * Code for dealing with controls. | 926 | * Code for dealing with controls. |
911 | */ | 927 | */ |
912 | 928 | ||
@@ -1453,6 +1469,7 @@ static const struct v4l2_subdev_video_ops ov7670_video_ops = { | |||
1453 | .s_parm = ov7670_s_parm, | 1469 | .s_parm = ov7670_s_parm, |
1454 | .g_parm = ov7670_g_parm, | 1470 | .g_parm = ov7670_g_parm, |
1455 | .enum_frameintervals = ov7670_enum_frameintervals, | 1471 | .enum_frameintervals = ov7670_enum_frameintervals, |
1472 | .enum_framesizes = ov7670_enum_framesizes, | ||
1456 | }; | 1473 | }; |
1457 | 1474 | ||
1458 | static const struct v4l2_subdev_ops ov7670_ops = { | 1475 | static const struct v4l2_subdev_ops ov7670_ops = { |