summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-09-14 13:36:34 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-14 13:36:34 -0300
commit27167428b37b74b3453ab7cfa9465529a38f4d09 (patch)
treeb789ef87c6136c6827f8389a01ca3df31898f843 /linux/drivers
parentf1f6feeeee28e8b24e319a3a245d55846906016d (diff)
downloadmediapointer-dvb-s2-27167428b37b74b3453ab7cfa9465529a38f4d09.tar.gz
mediapointer-dvb-s2-27167428b37b74b3453ab7cfa9465529a38f4d09.tar.bz2
Add a default method for VIDIOC_G_PARM
From: Mauro Carvalho Chehab <mchehab@infradead.org> For most drivers, VIDIOC_G_PARM will just return the current standard fps. So, instead of failing, drivers based on video_ioctl2 will implement the default method. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/videodev.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c
index 3297057bb..f29017482 100644
--- a/linux/drivers/media/video/videodev.c
+++ b/linux/drivers/media/video/videodev.c
@@ -1302,9 +1302,29 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
case VIDIOC_G_PARM:
{
struct v4l2_streamparm *p=arg;
- if (!vfd->vidioc_g_parm)
- break;
- ret=vfd->vidioc_g_parm(file, fh, p);
+ if (vfd->vidioc_g_parm) {
+ ret=vfd->vidioc_g_parm(file, fh, p);
+ } else {
+ struct v4l2_standard s;
+
+ if (!vfd->tvnormsize) {
+ printk (KERN_WARNING "%s: no TV norms defined!\n",
+ vfd->name);
+ break;
+ }
+
+ if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+ v4l2_video_std_construct(&s, vfd->tvnorms[vfd->current_norm].id,
+ vfd->tvnorms[vfd->current_norm].name);
+
+ memset(p,0,sizeof(*p));
+
+ p->parm.capture.timeperframe = s.frameperiod;
+ ret=0;
+ }
+
dbgarg (cmd, "type=%d\n", p->type);
break;
}