Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115635
b: refs/heads/master
c: def5239
h: refs/heads/master
i:
  115633: 5dd1146
  115631: 91e3458
v: v3
  • Loading branch information
Magnus Damm authored and Mauro Carvalho Chehab committed Oct 17, 2008
1 parent e73b9d6 commit 76c833f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aeadb5d4e590ed0d678ab0bb5fe068160a49e79d
refs/heads/master: def52393205cbd22b0b4a59096db2a0dcc72cd0a
40 changes: 40 additions & 0 deletions trunk/drivers/media/video/vivi.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ static struct vivi_fmt formats[] = {
.fourcc = V4L2_PIX_FMT_RGB565X, /* rrrrrggg gggbbbbb */
.depth = 16,
},
{
.name = "RGB555 (LE)",
.fourcc = V4L2_PIX_FMT_RGB555, /* gggbbbbb arrrrrgg */
.depth = 16,
},
{
.name = "RGB555 (BE)",
.fourcc = V4L2_PIX_FMT_RGB555X, /* arrrrrgg gggbbbbb */
.depth = 16,
},
};

static struct vivi_fmt *get_format(struct v4l2_format *f)
Expand Down Expand Up @@ -335,6 +345,30 @@ static void gen_twopix(struct vivi_fh *fh, unsigned char *buf, int colorpos)
break;
}
break;
case V4L2_PIX_FMT_RGB555:
switch (color) {
case 0:
case 2:
*p = (g_u << 5) | b_v;
break;
case 1:
case 3:
*p = (r_y << 2) | (g_u >> 3);
break;
}
break;
case V4L2_PIX_FMT_RGB555X:
switch (color) {
case 0:
case 2:
*p = (r_y << 2) | (g_u >> 3);
break;
case 1:
case 3:
*p = (g_u << 5) | b_v;
break;
}
break;
}
}
}
Expand Down Expand Up @@ -818,6 +852,12 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
g >>= 2;
b >>= 3;
break;
case V4L2_PIX_FMT_RGB555:
case V4L2_PIX_FMT_RGB555X:
r >>= 3;
g >>= 3;
b >>= 3;
break;
}

if (is_yuv) {
Expand Down

0 comments on commit 76c833f

Please sign in to comment.