Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367180
b: refs/heads/master
c: 4c1d0f7
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 16, 2013
1 parent 2899cd8 commit 0ec3416
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 42 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: 1f1988706d77083040113094a4bee2e9e1bdc34f
refs/heads/master: 4c1d0f73021393dda4a226b5c4c86b2d730d656c
84 changes: 43 additions & 41 deletions trunk/drivers/media/pci/cx25821/cx25821-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,19 @@ static int video_release(struct file *file)
}

/* VIDEO IOCTLS */

static int cx25821_vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
if (unlikely(f->index >= ARRAY_SIZE(formats)))
return -EINVAL;

strlcpy(f->description, formats[f->index].name, sizeof(f->description));
f->pixelformat = formats[f->index].fourcc;

return 0;
}

static int cx25821_vidioc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
Expand Down Expand Up @@ -607,35 +620,6 @@ static int cx25821_vidioc_try_fmt_vid_cap(struct file *file, void *priv,

return 0;
}
static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{
struct cx25821_channel *chan = video_drvdata(file);

if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (chan->streaming_fh && chan->streaming_fh != priv)
return -EBUSY;
chan->streaming_fh = priv;

return videobuf_streamon(&chan->vidq);
}

static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
{
struct cx25821_channel *chan = video_drvdata(file);

if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (chan->streaming_fh && chan->streaming_fh != priv)
return -EBUSY;
if (chan->streaming_fh == NULL)
return 0;

chan->streaming_fh = NULL;
return videobuf_streamoff(&chan->vidq);
}

static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
Expand Down Expand Up @@ -673,6 +657,36 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
return 0;
}

static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{
struct cx25821_channel *chan = video_drvdata(file);

if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (chan->streaming_fh && chan->streaming_fh != priv)
return -EBUSY;
chan->streaming_fh = priv;

return videobuf_streamon(&chan->vidq);
}

static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
{
struct cx25821_channel *chan = video_drvdata(file);

if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

if (chan->streaming_fh && chan->streaming_fh != priv)
return -EBUSY;
if (chan->streaming_fh == NULL)
return 0;

chan->streaming_fh = NULL;
return videobuf_streamoff(&chan->vidq);
}

static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
{
int ret_val = 0;
Expand Down Expand Up @@ -718,18 +732,6 @@ static int cx25821_vidioc_querycap(struct file *file, void *priv,
return 0;
}

static int cx25821_vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
if (unlikely(f->index >= ARRAY_SIZE(formats)))
return -EINVAL;

strlcpy(f->description, formats[f->index].name, sizeof(f->description));
f->pixelformat = formats[f->index].fourcc;

return 0;
}

static int cx25821_vidioc_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p)
{
Expand Down

0 comments on commit 0ec3416

Please sign in to comment.