Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250211
b: refs/heads/master
c: e42e28f
h: refs/heads/master
i:
  250209: 63d39d4
  250207: e40081d
v: v3
  • Loading branch information
Sensoray Linux Development authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent 2dc6c70 commit b812daa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 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: d0ef8540f211ba7cde748ef4f0272cd49bfdb520
refs/heads/master: e42e28f9d696c6f4e7b16ad2b0f4558269b7d180
21 changes: 16 additions & 5 deletions trunk/drivers/media/video/s2255drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,17 @@ static unsigned int vid_limit = 16; /* Video memory limit, in Mb */
/* start video number */
static int video_nr = -1; /* /dev/videoN, -1 for autodetect */

/* Enable jpeg capture. */
static int jpeg_enable = 1;

module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Debug level(0-100) default 0");
module_param(vid_limit, int, 0644);
MODULE_PARM_DESC(vid_limit, "video memory limit(Mb)");
module_param(video_nr, int, 0644);
MODULE_PARM_DESC(video_nr, "start video minor(-1 default autodetect)");
module_param(jpeg_enable, int, 0644);
MODULE_PARM_DESC(jpeg_enable, "Jpeg enable(1-on 0-off) default 1");

/* USB device table */
#define USB_SENSORAY_VID 0x1943
Expand All @@ -413,6 +418,7 @@ MODULE_DEVICE_TABLE(usb, s2255_table);
#define BUFFER_TIMEOUT msecs_to_jiffies(400)

/* image formats. */
/* JPEG formats must be defined last to support jpeg_enable parameter */
static const struct s2255_fmt formats[] = {
{
.name = "4:2:2, planar, YUV422P",
Expand All @@ -428,6 +434,10 @@ static const struct s2255_fmt formats[] = {
.name = "4:2:2, packed, UYVY",
.fourcc = V4L2_PIX_FMT_UYVY,
.depth = 16
}, {
.name = "8bpp GREY",
.fourcc = V4L2_PIX_FMT_GREY,
.depth = 8
}, {
.name = "JPG",
.fourcc = V4L2_PIX_FMT_JPEG,
Expand All @@ -436,10 +446,6 @@ static const struct s2255_fmt formats[] = {
.name = "MJPG",
.fourcc = V4L2_PIX_FMT_MJPEG,
.depth = 24
}, {
.name = "8bpp GREY",
.fourcc = V4L2_PIX_FMT_GREY,
.depth = 8
}
};

Expand Down Expand Up @@ -614,6 +620,9 @@ static const struct s2255_fmt *format_by_fourcc(int fourcc)
for (i = 0; i < ARRAY_SIZE(formats); i++) {
if (-1 == formats[i].fourcc)
continue;
if (!jpeg_enable && ((formats[i].fourcc == V4L2_PIX_FMT_JPEG) ||
(formats[i].fourcc == V4L2_PIX_FMT_MJPEG)))
continue;
if (formats[i].fourcc == fourcc)
return formats + i;
}
Expand Down Expand Up @@ -861,7 +870,9 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,

if (index >= ARRAY_SIZE(formats))
return -EINVAL;

if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) ||
(formats[index].fourcc == V4L2_PIX_FMT_MJPEG)))
return -EINVAL;
dprintk(4, "name %s\n", formats[index].name);
strlcpy(f->description, formats[index].name, sizeof(f->description));
f->pixelformat = formats[index].fourcc;
Expand Down

0 comments on commit b812daa

Please sign in to comment.