summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-video.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index 8d3dc06ba..31137f14e 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-video.c,v 1.41 2004/10/13 10:39:00 kraxel Exp $
+ * $Id: cx88-video.c,v 1.42 2004/10/15 10:29:24 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* video4linux video interface
@@ -1032,7 +1032,8 @@ static unsigned int
video_poll(struct file *file, struct poll_table_struct *wait)
{
struct cx8800_fh *fh = file->private_data;
-
+ struct cx88_buffer *buf;
+
if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
if (!res_get(fh->dev,fh,RESOURCE_VBI))
return POLLERR;
@@ -1040,8 +1041,22 @@ video_poll(struct file *file, struct poll_table_struct *wait)
&fh->vbiq, wait);
}
- /* FIXME */
- return POLLERR;
+ if (res_check(fh,RESOURCE_VIDEO)) {
+ /* streaming capture */
+ if (list_empty(&fh->vidq.stream))
+ return POLLERR;
+ buf = list_entry(fh->vidq.stream.next,struct cx88_buffer,vb.stream);
+ } else {
+ /* read() capture */
+ buf = (struct cx88_buffer*)fh->vidq.read_buf;
+ if (NULL == buf)
+ return POLLERR;
+ }
+ poll_wait(file, &buf->vb.done, wait);
+ if (buf->vb.state == STATE_DONE ||
+ buf->vb.state == STATE_ERROR)
+ return POLLIN|POLLRDNORM;
+ return 0;
}
static int video_release(struct inode *inode, struct file *file)