diff options
author | Jaime Velasco Juan <jsagarribay@gmail.com> | 2008-12-25 05:04:52 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:39:37 -0500 |
commit | 126be90f720d9b23e89c68519022fb806882f42d (patch) | |
tree | 2797165257268b148b5850cca87c1dd2cf28db1e /drivers/media/video/stk-webcam.c | |
parent | 71050814c21a461fb7950373f2ae2fc625412f20 (diff) |
V4L/DVB (9978): stkwebcam: Implement VIDIOC_ENUM_FRAMESIZES ioctl
This patch implements VIDIOC_ENUM_FRAMESIZES, it is used at least
by gstreamer.
Signed-off-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/stk-webcam.c')
-rw-r--r-- | drivers/media/video/stk-webcam.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index e9eb6d754d5c..5566c2379d64 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers/media/video/stk-webcam.c | |||
@@ -1262,6 +1262,25 @@ static int stk_vidioc_g_parm(struct file *filp, | |||
1262 | return 0; | 1262 | return 0; |
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | static int stk_vidioc_enum_framesizes(struct file *filp, | ||
1266 | void *priv, struct v4l2_frmsizeenum *frms) | ||
1267 | { | ||
1268 | if (frms->index >= ARRAY_SIZE(stk_sizes)) | ||
1269 | return -EINVAL; | ||
1270 | switch (frms->pixel_format) { | ||
1271 | case V4L2_PIX_FMT_RGB565: | ||
1272 | case V4L2_PIX_FMT_RGB565X: | ||
1273 | case V4L2_PIX_FMT_UYVY: | ||
1274 | case V4L2_PIX_FMT_YUYV: | ||
1275 | case V4L2_PIX_FMT_SBGGR8: | ||
1276 | frms->type = V4L2_FRMSIZE_TYPE_DISCRETE; | ||
1277 | frms->discrete.width = stk_sizes[frms->index].w; | ||
1278 | frms->discrete.height = stk_sizes[frms->index].h; | ||
1279 | return 0; | ||
1280 | default: return -EINVAL; | ||
1281 | } | ||
1282 | } | ||
1283 | |||
1265 | static struct file_operations v4l_stk_fops = { | 1284 | static struct file_operations v4l_stk_fops = { |
1266 | .owner = THIS_MODULE, | 1285 | .owner = THIS_MODULE, |
1267 | .open = v4l_stk_open, | 1286 | .open = v4l_stk_open, |
@@ -1296,6 +1315,7 @@ static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = { | |||
1296 | .vidioc_g_ctrl = stk_vidioc_g_ctrl, | 1315 | .vidioc_g_ctrl = stk_vidioc_g_ctrl, |
1297 | .vidioc_s_ctrl = stk_vidioc_s_ctrl, | 1316 | .vidioc_s_ctrl = stk_vidioc_s_ctrl, |
1298 | .vidioc_g_parm = stk_vidioc_g_parm, | 1317 | .vidioc_g_parm = stk_vidioc_g_parm, |
1318 | .vidioc_enum_framesizes = stk_vidioc_enum_framesizes, | ||
1299 | }; | 1319 | }; |
1300 | 1320 | ||
1301 | static void stk_v4l_dev_release(struct video_device *vd) | 1321 | static void stk_v4l_dev_release(struct video_device *vd) |