Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271979
b: refs/heads/master
c: 1c5c506
h: refs/heads/master
i:
  271977: bfd3b65
  271975: ef78053
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Oct 19, 2011
1 parent 5e90759 commit 6855f17
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a461e0ad3d27b6342140566909a80db30d151a91
refs/heads/master: 1c5c50685a04668a4a4431534bca804969fac3c6
41 changes: 40 additions & 1 deletion trunk/drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,45 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
return 0;
}

static int vidioc_enum_framesizes(struct file *file, void *priv,
struct v4l2_frmsizeenum *fsize)
{
struct em28xx_fh *fh = priv;
struct em28xx *dev = fh->dev;
struct em28xx_fmt *fmt;
unsigned int maxw = norm_maxw(dev);
unsigned int maxh = norm_maxh(dev);

fmt = format_by_fourcc(fsize->pixel_format);
if (!fmt) {
em28xx_videodbg("Fourcc format (%08x) invalid.\n",
fsize->pixel_format);
return -EINVAL;
}

if (dev->board.is_em2800) {
if (fsize->index > 1)
return -EINVAL;
fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
fsize->discrete.width = maxw / (1 + fsize->index);
fsize->discrete.height = maxh / (1 + fsize->index);
return 0;
}

if (fsize->index != 0)
return -EINVAL;

/* Report a continuous range */
fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
fsize->stepwise.min_width = 48;
fsize->stepwise.min_height = 32;
fsize->stepwise.max_width = maxw;
fsize->stepwise.max_height = maxh;
fsize->stepwise.step_width = 1;
fsize->stepwise.step_height = 1;
return 0;
}

/* Sliced VBI ioctls */
static int vidioc_g_fmt_sliced_vbi_cap(struct file *file, void *priv,
struct v4l2_format *f)
Expand Down Expand Up @@ -2356,10 +2395,10 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
.vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap,
.vidioc_s_fmt_vbi_cap = vidioc_s_fmt_vbi_cap,
.vidioc_enum_framesizes = vidioc_enum_framesizes,
.vidioc_g_audio = vidioc_g_audio,
.vidioc_s_audio = vidioc_s_audio,
.vidioc_cropcap = vidioc_cropcap,

.vidioc_g_fmt_sliced_vbi_cap = vidioc_g_fmt_sliced_vbi_cap,
.vidioc_try_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap,
.vidioc_s_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap,
Expand Down

0 comments on commit 6855f17

Please sign in to comment.