summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-vbi.c
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2009-11-25 03:17:25 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 19:10:32 +0100
commit66d9cbad5330d6df30c82f10ee18b62b096b84ef (patch)
tree47d42a16b56f43df1dc2a535188205e6fc929708 /drivers/media/video/em28xx/em28xx-vbi.c
parentV4L/DVB (13930): dib0700: rework IR logic for firmware 1.20 (diff)
downloadlinux-66d9cbad5330d6df30c82f10ee18b62b096b84ef.tar.xz
linux-66d9cbad5330d6df30c82f10ee18b62b096b84ef.zip
V4L/DVB (13932): em28xx: add PAL support for VBI
Make the VBI support work for PAL standards in addition to NTSC. This work was sponsored by EyeMagnet Limited. Thanks go out to Andy Walls for providing a CD containing test PAL/VBI captures and to Steven Toth for providing a PVR-350 to do signal generation with. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-vbi.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-vbi.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/media/video/em28xx/em28xx-vbi.c b/drivers/media/video/em28xx/em28xx-vbi.c
index 94943e5a1529..c7dce39823d8 100644
--- a/drivers/media/video/em28xx/em28xx-vbi.c
+++ b/drivers/media/video/em28xx/em28xx-vbi.c
@@ -71,7 +71,11 @@ free_buffer(struct videobuf_queue *vq, struct em28xx_buffer *buf)
static int
vbi_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
{
- *size = 720 * 12 * 2;
+ struct em28xx_fh *fh = q->priv_data;
+ struct em28xx *dev = fh->dev;
+
+ *size = dev->vbi_width * dev->vbi_height * 2;
+
if (0 == *count)
*count = vbibufs;
if (*count < 2)
@@ -85,19 +89,18 @@ static int
vbi_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
enum v4l2_field field)
{
+ struct em28xx_fh *fh = q->priv_data;
+ struct em28xx *dev = fh->dev;
struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb);
int rc = 0;
- unsigned int size;
-
- size = 720 * 12 * 2;
- buf->vb.size = size;
+ buf->vb.size = dev->vbi_width * dev->vbi_height * 2;
if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size)
return -EINVAL;
- buf->vb.width = 720;
- buf->vb.height = 12;
+ buf->vb.width = dev->vbi_width;
+ buf->vb.height = dev->vbi_height;
buf->vb.field = field;
if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {