]> bbs.cooldavid.org Git - net-next-2.6.git/commit - drivers/media/video/bt8xx/bttv-risc.c
V4L/DVB (5077): Bttv cropping support
authorMichael Schimek <mschimek@gmx.at>
Thu, 18 Jan 2007 19:17:39 +0000 (16:17 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 21 Feb 2007 15:34:36 +0000 (13:34 -0200)
commite5bd0260e7d3d806e66c12859f50733dca43bbcf
tree7a726da52b8155357a08e4feb7e0e79084673fa0
parent13071f0a58f285eee81f63c917078bb2a48cf51e
V4L/DVB (5077): Bttv cropping support

Adds the missing VIDIOC_CROPCAP, G_CROP and S_CROP ioctls, permitting
applications to capture or overlay a subsection of the picture or to
extend the capture window beyond active video, into the VBI area and the
horizontal blanking. VBI capturing can start and end on any line,
including the picture area, and apps can capture different lines of each
field and single fields.
For compatibility with existing applications, the open() function
resets the cropping and VBI capturing parameters and a VIDIOC_S_CROP
call is necessary to actually enable cropping.
Regrettably in PAL-M, PAL-N, PAL-Nc and NTSC-JP mode the maximum image
width will increase from 640 and 768 to 747 and 923 pixels respectively.
Like the VBI changes however, this should only affect applications which
depend on former driver limitations, such as never getting more than 640
pixels regardless of the requested width.
Also, new freedoms require additional checks for conflicts and some
applications may not expect an EBUSY error from the VIDIOC_QBUF and
VIDIOCMCAPTURE ioctls. These errors should be rare though.
So far, the patch has been tested on a UP machine with a bt878 in PAL-
BGHI and NTSC-M mode using xawtv, tvtime, mplayer/mencoder, zapping/
libzvbi and these tools: http://zapping.sf.net/bttv-crop-test.tar.bz2
I'd be grateful about comments or bug reports.

Signed-off-by: Michael H. Schimek <mschimek@gmx.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bt8xx/bttv-risc.c
drivers/media/video/bt8xx/bttv-vbi.c
drivers/media/video/bt8xx/bttvp.h