aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/cx18/cx18-vbi.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-02-08 22:40:04 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:42:39 -0300
commit812b1f9d54a5f75066f8a5c92166a979c48c98c6 (patch)
treed04cdfdd80d0e2df825dbd22a6130434867233f0 /drivers/media/video/cx18/cx18-vbi.c
parent466df46484aced005fa41706f87e18eaa86918ad (diff)
V4L/DVB (10446): cx18: Finally get sliced VBI working - for 525 line 60 Hz systems at least
Sliced VBI, in the manner that ivtv implements it as a separate data stream, now works for 525 line 60 Hz systems like NTSC-M. It may work for 625 line 50 Hz systems, but I have more engineering work to do, to verify it is operating properly. Sliced data insertion into the MPEG PS should be working, but is untested. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-vbi.c')
-rw-r--r--drivers/media/video/cx18/cx18-vbi.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/media/video/cx18/cx18-vbi.c b/drivers/media/video/cx18/cx18-vbi.c
index 52082d4a179..8e6f4d4aff9 100644
--- a/drivers/media/video/cx18/cx18-vbi.c
+++ b/drivers/media/video/cx18/cx18-vbi.c
@@ -221,13 +221,22 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf,
pts = (be32_to_cpu(q[0] == 0x3fffffff)) ? be32_to_cpu(q[2]) : 0;
+ /*
+ * For calls to compress_sliced_buf(), ensure there are an integral
+ * number of lines by shifting the real data up over the 12 bytes header
+ * that got stuffed in.
+ * FIXME - there's a smarter way to do this with pointers, but for some
+ * reason I can't get it to work correctly right now.
+ */
+ memcpy(p, &buf->buf[12], size-12);
+
/* first field */
- /* compress_sliced_buf() will skip the 12 bytes of header */
lines = compress_sliced_buf(cx, 0, p, size / 2, sliced_vbi_eav_rp[0]);
- /* second field */
- /* experimentation shows that the second half does not always
- begin at the exact address. So start a bit earlier
- (hence 32). */
+ /*
+ * second field
+ * In case the second half does not always begin at the exact address,
+ * start a bit earlier (hence 32).
+ */
lines = compress_sliced_buf(cx, lines, p + size / 2 - 32,
size / 2 + 32, sliced_vbi_eav_rp[1]);
/* always return at least one empty line */