summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vivid/vivid-vbi-out.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2014-09-20 06:11:44 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-21 20:40:05 -0300
commit62f28725a8dc5c16d3d63606f046899ae41fcf4a (patch)
tree0a994727a4369f7ad5fba0e3de7192cf237285d1 /drivers/media/platform/vivid/vivid-vbi-out.c
parent625c3442dcc79722c60afc398beac4c11f0395ac (diff)
downloadblackbird-op-linux-62f28725a8dc5c16d3d63606f046899ae41fcf4a.tar.gz
blackbird-op-linux-62f28725a8dc5c16d3d63606f046899ae41fcf4a.zip
[media] vivid: add teletext support to VBI capture
This is useful to test teletext capture applications like alevt and mtt. It also fixes a previously undetected bug where the PAL VBI start line of the second field was off by one. Using the new field start defines helps a lot fixing such bugs. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/vivid/vivid-vbi-out.c')
-rw-r--r--drivers/media/platform/vivid/vivid-vbi-out.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/platform/vivid/vivid-vbi-out.c b/drivers/media/platform/vivid/vivid-vbi-out.c
index 039316d835b4..9d00a07ecdcd 100644
--- a/drivers/media/platform/vivid/vivid-vbi-out.c
+++ b/drivers/media/platform/vivid/vivid-vbi-out.c
@@ -149,8 +149,8 @@ int vidioc_g_fmt_vbi_out(struct file *file, void *priv,
vbi->offset = 24;
vbi->samples_per_line = 1440;
vbi->sample_format = V4L2_PIX_FMT_GREY;
- vbi->start[0] = is_60hz ? 10 : 6;
- vbi->start[1] = is_60hz ? 273 : 318;
+ vbi->start[0] = is_60hz ? V4L2_VBI_ITU_525_F1_START + 9 : V4L2_VBI_ITU_625_F1_START + 5;
+ vbi->start[1] = is_60hz ? V4L2_VBI_ITU_525_F2_START + 9 : V4L2_VBI_ITU_625_F2_START + 5;
vbi->count[0] = vbi->count[1] = is_60hz ? 12 : 18;
vbi->flags = dev->vbi_cap_interlaced ? V4L2_VBI_INTERLACED : 0;
vbi->reserved[0] = 0;
@@ -195,7 +195,8 @@ int vidioc_try_fmt_sliced_vbi_out(struct file *file, void *fh, struct v4l2_forma
if (!vivid_is_svid_out(dev) || !dev->has_sliced_vbi_out)
return -EINVAL;
- service_set &= is_60hz ? V4L2_SLICED_CAPTION_525 : V4L2_SLICED_WSS_625;
+ service_set &= is_60hz ? V4L2_SLICED_CAPTION_525 :
+ V4L2_SLICED_WSS_625 | V4L2_SLICED_TELETEXT_B;
vivid_fill_service_lines(vbi, service_set);
return 0;
}
OpenPOWER on IntegriCloud