Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154946
b: refs/heads/master
c: 43cb9fe
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jul 5, 2009
1 parent 5749366 commit 663f877
Show file tree
Hide file tree
Showing 2 changed files with 19 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: 02e7804b2135ff941b8846f5820cf48fbfdadd54
refs/heads/master: 43cb9fe3291bb96390c1d188eb61c2d1581bb61e
19 changes: 18 additions & 1 deletion trunk/drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ static struct em28xx_fmt format[] = {
.fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16,
.reg = EM28XX_OUTFMT_YUV422_Y0UY1V,
}, {
.name = "16 bpp RGB, le",
.fourcc = V4L2_PIX_FMT_RGB565,
.depth = 16,
.reg = EM28XX_OUTFMT_YUV211,
},
};

Expand Down Expand Up @@ -694,14 +699,22 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
unsigned int hscale, vscale;
struct em28xx_fmt *fmt;

/* FIXME: This is the only supported fmt */
if (dev->board.is_27xx)
f->fmt.pix.pixelformat = V4L2_PIX_FMT_RGB565;

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

if (dev->board.is_em2800) {
if (dev->board.is_27xx) {
/* FIXME: This is the only supported fmt */
width = 640;
height = 480;
} else if (dev->board.is_em2800) {
/* the em2800 can only scale down to 50% */
height = height > (3 * maxh / 4) ? maxh : maxh / 2;
width = width > (3 * maxw / 4) ? maxw : maxw / 2;
Expand Down Expand Up @@ -747,6 +760,10 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,

mutex_lock(&dev->lock);

/* FIXME: This is the only supported fmt */
if (dev->board.is_27xx)
f->fmt.pix.pixelformat = V4L2_PIX_FMT_RGB565;

vidioc_try_fmt_vid_cap(file, priv, f);

fmt = format_by_fourcc(f->fmt.pix.pixelformat);
Expand Down

0 comments on commit 663f877

Please sign in to comment.