Skip to content

Commit

Permalink
V4L/DVB (11661): v4l2-ioctl: Check buffer types using g_fmt instead o…
Browse files Browse the repository at this point in the history
…f try_fmt

For a number of different ioctls, the v4l2-ioctl code checks that the
passed buffer type is supported by the driver.  It did this by checking
that the driver defined a method for the try_fmt handler for that buffer
type.  However, try_fmt is optional and a driver might not provide it even
though it does support that type.  So use g_fmt instead, since that isn't
optional.

This should fix a problem with VBI capture with saa7146.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed May 9, 2009
1 parent 171f48e commit 1175d61
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/media/video/v4l2-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,39 +544,39 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type)

switch (type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (ops->vidioc_try_fmt_vid_cap)
if (ops->vidioc_g_fmt_vid_cap)
return 0;
break;
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
if (ops->vidioc_try_fmt_vid_overlay)
if (ops->vidioc_g_fmt_vid_overlay)
return 0;
break;
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
if (ops->vidioc_try_fmt_vid_out)
if (ops->vidioc_g_fmt_vid_out)
return 0;
break;
case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
if (ops->vidioc_try_fmt_vid_out_overlay)
if (ops->vidioc_g_fmt_vid_out_overlay)
return 0;
break;
case V4L2_BUF_TYPE_VBI_CAPTURE:
if (ops->vidioc_try_fmt_vbi_cap)
if (ops->vidioc_g_fmt_vbi_cap)
return 0;
break;
case V4L2_BUF_TYPE_VBI_OUTPUT:
if (ops->vidioc_try_fmt_vbi_out)
if (ops->vidioc_g_fmt_vbi_out)
return 0;
break;
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
if (ops->vidioc_try_fmt_sliced_vbi_cap)
if (ops->vidioc_g_fmt_sliced_vbi_cap)
return 0;
break;
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
if (ops->vidioc_try_fmt_sliced_vbi_out)
if (ops->vidioc_g_fmt_sliced_vbi_out)
return 0;
break;
case V4L2_BUF_TYPE_PRIVATE:
if (ops->vidioc_try_fmt_type_private)
if (ops->vidioc_g_fmt_type_private)
return 0;
break;
}
Expand Down

0 comments on commit 1175d61

Please sign in to comment.