Commit 0e3bd2b9 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (7948): videodev: add missing vidioc_try_fmt_sliced_vbi_output and...

V4L/DVB (7948): videodev: add missing vidioc_try_fmt_sliced_vbi_output and VIDIOC_ENUMOUTPUT handling

There was no vidioc_try_fmt_sliced_vbi_output, instead vidioc_try_fmt_vbi_output
was reused.

The VIDIOC_ENUMOUTPUT handling was missing altogether, even though the callback
existed.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent b2de2313
...@@ -840,8 +840,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ...@@ -840,8 +840,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
ret=vfd->vidioc_enum_fmt_vbi(file, fh, f); ret=vfd->vidioc_enum_fmt_vbi(file, fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
if (vfd->vidioc_enum_fmt_vbi_output) if (vfd->vidioc_enum_fmt_sliced_vbi_output)
ret=vfd->vidioc_enum_fmt_vbi_output(file, ret = vfd->vidioc_enum_fmt_sliced_vbi_output(file,
fh, f); fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
...@@ -905,8 +905,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ...@@ -905,8 +905,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
ret=vfd->vidioc_g_fmt_vbi(file, fh, f); ret=vfd->vidioc_g_fmt_vbi(file, fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
if (vfd->vidioc_g_fmt_vbi_output) if (vfd->vidioc_g_fmt_sliced_vbi_output)
ret=vfd->vidioc_g_fmt_vbi_output(file, fh, f); ret = vfd->vidioc_g_fmt_sliced_vbi_output(file, fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
if (vfd->vidioc_g_fmt_vbi_capture) if (vfd->vidioc_g_fmt_vbi_capture)
...@@ -957,8 +957,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ...@@ -957,8 +957,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
ret=vfd->vidioc_s_fmt_vbi(file, fh, f); ret=vfd->vidioc_s_fmt_vbi(file, fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
if (vfd->vidioc_s_fmt_vbi_output) if (vfd->vidioc_s_fmt_sliced_vbi_output)
ret=vfd->vidioc_s_fmt_vbi_output(file, fh, f); ret = vfd->vidioc_s_fmt_sliced_vbi_output(file, fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
if (vfd->vidioc_s_fmt_vbi_capture) if (vfd->vidioc_s_fmt_vbi_capture)
...@@ -1009,8 +1009,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ...@@ -1009,8 +1009,8 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
ret=vfd->vidioc_try_fmt_vbi(file, fh, f); ret=vfd->vidioc_try_fmt_vbi(file, fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
if (vfd->vidioc_try_fmt_vbi_output) if (vfd->vidioc_try_fmt_sliced_vbi_output)
ret=vfd->vidioc_try_fmt_vbi_output(file, ret = vfd->vidioc_try_fmt_sliced_vbi_output(file,
fh, f); fh, f);
break; break;
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
...@@ -1297,6 +1297,25 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ...@@ -1297,6 +1297,25 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
} }
/* ------ output switching ---------- */ /* ------ output switching ---------- */
case VIDIOC_ENUMOUTPUT:
{
struct v4l2_output *p = arg;
int i = p->index;
if (!vfd->vidioc_enum_output)
break;
memset(p, 0, sizeof(*p));
p->index = i;
ret = vfd->vidioc_enum_output(file, fh, p);
if (!ret)
dbgarg(cmd, "index=%d, name=%s, type=%d, "
"audioset=%d, "
"modulator=%d, std=%08Lx\n",
p->index, p->name, p->type, p->audioset,
p->modulator, (unsigned long long)p->std);
break;
}
case VIDIOC_G_OUTPUT: case VIDIOC_G_OUTPUT:
{ {
unsigned int *i = arg; unsigned int *i = arg;
......
...@@ -132,6 +132,8 @@ struct video_device ...@@ -132,6 +132,8 @@ struct video_device
struct v4l2_fmtdesc *f); struct v4l2_fmtdesc *f);
int (*vidioc_enum_fmt_vbi_output) (struct file *file, void *fh, int (*vidioc_enum_fmt_vbi_output) (struct file *file, void *fh,
struct v4l2_fmtdesc *f); struct v4l2_fmtdesc *f);
int (*vidioc_enum_fmt_sliced_vbi_output) (struct file *file, void *fh,
struct v4l2_fmtdesc *f);
int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh, int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh,
struct v4l2_fmtdesc *f); struct v4l2_fmtdesc *f);
...@@ -144,6 +146,8 @@ struct video_device ...@@ -144,6 +146,8 @@ struct video_device
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_g_fmt_vbi_output) (struct file *file, void *fh, int (*vidioc_g_fmt_vbi_output) (struct file *file, void *fh,
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_g_fmt_sliced_vbi_output) (struct file *file, void *fh,
struct v4l2_format *f);
int (*vidioc_g_fmt_vbi_capture)(struct file *file, void *fh, int (*vidioc_g_fmt_vbi_capture)(struct file *file, void *fh,
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_g_fmt_video_output)(struct file *file, void *fh, int (*vidioc_g_fmt_video_output)(struct file *file, void *fh,
...@@ -163,6 +167,8 @@ struct video_device ...@@ -163,6 +167,8 @@ struct video_device
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_s_fmt_vbi_output) (struct file *file, void *fh, int (*vidioc_s_fmt_vbi_output) (struct file *file, void *fh,
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_s_fmt_sliced_vbi_output) (struct file *file, void *fh,
struct v4l2_format *f);
int (*vidioc_s_fmt_vbi_capture)(struct file *file, void *fh, int (*vidioc_s_fmt_vbi_capture)(struct file *file, void *fh,
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_s_fmt_video_output)(struct file *file, void *fh, int (*vidioc_s_fmt_video_output)(struct file *file, void *fh,
...@@ -181,6 +187,8 @@ struct video_device ...@@ -181,6 +187,8 @@ struct video_device
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_try_fmt_vbi_output) (struct file *file, void *fh, int (*vidioc_try_fmt_vbi_output) (struct file *file, void *fh,
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_try_fmt_sliced_vbi_output) (struct file *file, void *fh,
struct v4l2_format *f);
int (*vidioc_try_fmt_vbi_capture)(struct file *file, void *fh, int (*vidioc_try_fmt_vbi_capture)(struct file *file, void *fh,
struct v4l2_format *f); struct v4l2_format *f);
int (*vidioc_try_fmt_video_output)(struct file *file, void *fh, int (*vidioc_try_fmt_video_output)(struct file *file, void *fh,
...@@ -225,7 +233,7 @@ struct video_device ...@@ -225,7 +233,7 @@ struct video_device
int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i); int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i);
/* Output handling */ /* Output handling */
int (*vidioc_enumoutput) (struct file *file, void *fh, int (*vidioc_enum_output) (struct file *file, void *fh,
struct v4l2_output *a); struct v4l2_output *a);
int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i); int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i);
int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i); int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment