From: Jaime Velasco Juan <jsagarribay@gmail.com>
To: mchehab@infradead.org
Cc: video4linux-list@redhat.com
Subject: [PATCH v2 - RESEND] stkwebcam: Implement VIDIOC_ENUM_FRAMESIZES ioctl
Date: Thu, 25 Dec 2008 10:04:52 +0000 [thread overview]
Message-ID: <20081225100452.GA4073@singular.sob> (raw)
In-Reply-To: <20081209173458.GA4208@singular.sob>
This patch implements VIDIOC_ENUM_FRAMESIZES, it is used at least
by gstreamer.
Signed-off-by: Jaime Velasco Juan <jsagarribay@gmail.com>
---
drivers/media/video/stk-webcam.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
Hi Mauro, could you please apply this patch?
Regards
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index e9eb6d7..5566c23 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,
return 0;
}
+static int stk_vidioc_enum_framesizes(struct file *filp,
+ void *priv, struct v4l2_frmsizeenum *frms)
+{
+ if (frms->index >= ARRAY_SIZE(stk_sizes))
+ return -EINVAL;
+ switch (frms->pixel_format) {
+ case V4L2_PIX_FMT_RGB565:
+ case V4L2_PIX_FMT_RGB565X:
+ case V4L2_PIX_FMT_UYVY:
+ case V4L2_PIX_FMT_YUYV:
+ case V4L2_PIX_FMT_SBGGR8:
+ frms->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+ frms->discrete.width = stk_sizes[frms->index].w;
+ frms->discrete.height = stk_sizes[frms->index].h;
+ return 0;
+ default: return -EINVAL;
+ }
+}
+
static struct file_operations v4l_stk_fops = {
.owner = THIS_MODULE,
.open = v4l_stk_open,
@@ -1296,6 +1315,7 @@ static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
.vidioc_g_ctrl = stk_vidioc_g_ctrl,
.vidioc_s_ctrl = stk_vidioc_s_ctrl,
.vidioc_g_parm = stk_vidioc_g_parm,
+ .vidioc_enum_framesizes = stk_vidioc_enum_framesizes,
};
static void stk_v4l_dev_release(struct video_device *vd)
--
1.5.6.5
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
prev parent reply other threads:[~2008-12-25 10:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-08 18:10 [PATCH] stkwebcam: Implement VIDIOC_ENUM_FRAMESIZES ioctl Jaime Velasco Juan
2008-12-08 18:33 ` Hans Verkuil
2008-12-09 17:34 ` [PATCH v2] " Jaime Velasco Juan
2008-12-25 10:04 ` Jaime Velasco Juan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081225100452.GA4073@singular.sob \
--to=jsagarribay@gmail.com \
--cc=mchehab@infradead.org \
--cc=video4linux-list@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox