Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138362
b: refs/heads/master
c: 6174523
h: refs/heads/master
v: v3
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 066790c commit a10b05f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 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: 185cda966633fc18b9df09b6d84d5ec2db4a57ff
refs/heads/master: 6174523c5948f8a36f778f0abdfc648a5d73bf46
29 changes: 3 additions & 26 deletions trunk/drivers/media/video/meye.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,18 +1256,13 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh,
if (f->index > 1)
return -EINVAL;

if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (f->index == 0) {
/* standard YUV 422 capture */
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
f->flags = 0;
strcpy(f->description, "YUV422");
f->pixelformat = V4L2_PIX_FMT_YUYV;
} else {
/* compressed MJPEG capture */
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
f->flags = V4L2_FMT_FLAG_COMPRESSED;
strcpy(f->description, "MJPEG");
f->pixelformat = V4L2_PIX_FMT_MJPEG;
Expand All @@ -1279,9 +1274,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh,
static int vidioc_try_fmt_vid_cap(struct file *file, void *fh,
struct v4l2_format *f)
{
if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (f->fmt.pix.pixelformat != V4L2_PIX_FMT_YUYV &&
f->fmt.pix.pixelformat != V4L2_PIX_FMT_MJPEG)
return -EINVAL;
Expand Down Expand Up @@ -1312,9 +1304,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *fh,
static int vidioc_g_fmt_vid_cap(struct file *file, void *fh,
struct v4l2_format *f)
{
if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

switch (meye.mchip_mode) {
case MCHIP_HIC_MODE_CONT_OUT:
default:
Expand All @@ -1338,9 +1327,6 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *fh,
static int vidioc_s_fmt_vid_cap(struct file *file, void *fh,
struct v4l2_format *f)
{
if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (f->fmt.pix.pixelformat != V4L2_PIX_FMT_YUYV &&
f->fmt.pix.pixelformat != V4L2_PIX_FMT_MJPEG)
return -EINVAL;
Expand Down Expand Up @@ -1386,9 +1372,6 @@ static int vidioc_reqbufs(struct file *file, void *fh,
{
int i;

if (req->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (req->memory != V4L2_MEMORY_MMAP)
return -EINVAL;

Expand Down Expand Up @@ -1429,9 +1412,9 @@ static int vidioc_reqbufs(struct file *file, void *fh,

static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *buf)
{
int index = buf->index;
unsigned int index = buf->index;

if (index < 0 || index >= gbuffers)
if (index >= gbuffers)
return -EINVAL;

buf->bytesused = meye.grab_buffer[index].size;
Expand All @@ -1455,13 +1438,10 @@ static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *buf)

static int vidioc_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
{
if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (buf->memory != V4L2_MEMORY_MMAP)
return -EINVAL;

if (buf->index < 0 || buf->index >= gbuffers)
if (buf->index >= gbuffers)
return -EINVAL;

if (meye.grab_buffer[buf->index].state != MEYE_BUF_UNUSED)
Expand All @@ -1481,9 +1461,6 @@ static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
{
int reqnr;

if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (buf->memory != V4L2_MEMORY_MMAP)
return -EINVAL;

Expand Down

0 comments on commit a10b05f

Please sign in to comment.