aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-10-22 16:44:55 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-11-04 18:41:16 -0500
commita8ab68bffe3fe7b8e9ff963ea321d283fc77ac5f (patch)
treecc0b0d7e19baf0df9b92cbf6093ae5cc9ad83256
parent35378434e739ac869d0146a47133a0f9d6fd2ee8 (diff)
V4L/DVB (6392): bttv: Update initial image size when set via V4L1 VIDIOCMCAPTURE
The V4L1 spec says that the image size should be with with VIDIOCSWIN before requesting buffers with VIDIOCGMBUF and capturing into them with VIDIOCMCAPTURE. But it seems that many apps don't do this. They set the size using the fields in the VIDIOCMCAPTURE ioctl. The driver doesn't know what size to capture until it actually starts to capture. In particular, it doesn't know what size to capture until it has already mmap the captured buffers. Which is quite stupid. Why V4L1 has size and format fields for VIDIOCMCAPTURE I have no idea. Many drivers don't support this, including those using v4l1-compat. The bttv does, which is probably the only reason such broken software is so prevalent. But, the driver doesn't adjust its idea of what size is being captured when it is set this way. If you try to query the driver's current setting with v4l2-ctl, it won't be correct. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 56e43506fe1f..a88b56e6ca05 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3113,6 +3113,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
3113 vm->width,vm->height,field); 3113 vm->width,vm->height,field);
3114 if (0 != retval) 3114 if (0 != retval)
3115 goto fh_unlock_and_return; 3115 goto fh_unlock_and_return;
3116 btv->init.width = vm->width;
3117 btv->init.height = vm->height;
3116 spin_lock_irqsave(&btv->s_lock,flags); 3118 spin_lock_irqsave(&btv->s_lock,flags);
3117 buffer_queue(&fh->cap,&buf->vb); 3119 buffer_queue(&fh->cap,&buf->vb);
3118 spin_unlock_irqrestore(&btv->s_lock,flags); 3120 spin_unlock_irqrestore(&btv->s_lock,flags);