diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-03-14 14:54:47 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 17:58:48 +0200 |
commit | 1dbf85397a686488b4be412af1cc069ae63a5ecc (patch) | |
tree | 6a59c95b58e20a11b7cb81a2863790b09f174475 /drivers/media/video/saa7127.c | |
parent | V4L/DVB: cx18: support new vbi ops to set/get VBI format (diff) | |
download | linux-1dbf85397a686488b4be412af1cc069ae63a5ecc.tar.xz linux-1dbf85397a686488b4be412af1cc069ae63a5ecc.zip |
V4L/DVB: saa7127: support new vbi ops to set/get VBI format
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7127.c')
-rw-r--r-- | drivers/media/video/saa7127.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 32e11fc9c85c..87986ad62f86 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c @@ -625,29 +625,33 @@ static int saa7127_s_stream(struct v4l2_subdev *sd, int enable) return saa7127_set_video_enable(sd, enable); } -static int saa7127_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) +static int saa7127_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt) { struct saa7127_state *state = to_state(sd); - if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) - return -EINVAL; - - memset(&fmt->fmt.sliced, 0, sizeof(fmt->fmt.sliced)); + memset(fmt, 0, sizeof(*fmt)); if (state->vps_enable) - fmt->fmt.sliced.service_lines[0][16] = V4L2_SLICED_VPS; + fmt->service_lines[0][16] = V4L2_SLICED_VPS; if (state->wss_enable) - fmt->fmt.sliced.service_lines[0][23] = V4L2_SLICED_WSS_625; + fmt->service_lines[0][23] = V4L2_SLICED_WSS_625; if (state->cc_enable) { - fmt->fmt.sliced.service_lines[0][21] = V4L2_SLICED_CAPTION_525; - fmt->fmt.sliced.service_lines[1][21] = V4L2_SLICED_CAPTION_525; + fmt->service_lines[0][21] = V4L2_SLICED_CAPTION_525; + fmt->service_lines[1][21] = V4L2_SLICED_CAPTION_525; } - fmt->fmt.sliced.service_set = + fmt->service_set = (state->vps_enable ? V4L2_SLICED_VPS : 0) | (state->wss_enable ? V4L2_SLICED_WSS_625 : 0) | (state->cc_enable ? V4L2_SLICED_CAPTION_525 : 0); return 0; } +static int saa7127_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) +{ + if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) + return -EINVAL; + return saa7127_g_sliced_fmt(sd, &fmt->fmt.sliced); +} + static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *data) { switch (data->id) { @@ -735,6 +739,7 @@ static const struct v4l2_subdev_video_ops saa7127_video_ops = { static const struct v4l2_subdev_vbi_ops saa7127_vbi_ops = { .s_vbi_data = saa7127_s_vbi_data, + .g_sliced_fmt = saa7127_g_sliced_fmt, }; static const struct v4l2_subdev_ops saa7127_ops = { |