X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fmedia%2Fvideobuf-core.h;h=874f1340d0493d9f8f1e66a5186ae984e9e93a51;hb=bbad5d4750ab3b44a196f9bdd982972e41b7e520;hp=97f14d469595fd03e12adcd01457b266527d8d04;hpb=6e5565f949af1322f8f3d3f43d044645ae448499;p=linux-2.6 diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 97f14d4695..874f1340d0 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h @@ -13,6 +13,9 @@ * the Free Software Foundation; either version 2 */ +#ifndef _VIDEOBUF_CORE_H +#define _VIDEOBUF_CORE_H + #include #ifdef CONFIG_VIDEO_V4L1_COMPAT #include @@ -123,7 +126,8 @@ struct videobuf_queue_ops { struct videobuf_qtype_ops { u32 magic; - void* (*alloc) (size_t size); + void *(*alloc) (size_t size); + void *(*vmalloc) (struct videobuf_buffer *buf); int (*iolock) (struct videobuf_queue* q, struct videobuf_buffer *vb, struct v4l2_framebuffer *fbuf); @@ -149,9 +153,11 @@ struct videobuf_qtype_ops { }; struct videobuf_queue { - struct mutex lock; + struct mutex vb_lock; spinlock_t *irqlock; - void *dev; /* on pci, points to struct pci_dev */ + struct device *dev; + + wait_queue_head_t wait; /* wait if queue is empty */ enum v4l2_buf_type type; unsigned int inputs; /* for V4L2_BUF_FLAG_INPUT */ @@ -183,9 +189,13 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, void *videobuf_alloc(struct videobuf_queue* q); +/* Used on videobuf-dvb */ +void *videobuf_queue_to_vmalloc (struct videobuf_queue* q, + struct videobuf_buffer *buf); + void videobuf_queue_core_init(struct videobuf_queue *q, struct videobuf_queue_ops *ops, - void *dev, + struct device *dev, spinlock_t *irqlock, enum v4l2_buf_type type, enum v4l2_field field, @@ -227,14 +237,11 @@ unsigned int videobuf_poll_stream(struct file *file, int videobuf_mmap_setup(struct videobuf_queue *q, unsigned int bcount, unsigned int bsize, enum v4l2_memory memory); +int __videobuf_mmap_setup(struct videobuf_queue *q, + unsigned int bcount, unsigned int bsize, + enum v4l2_memory memory); int videobuf_mmap_free(struct videobuf_queue *q); int videobuf_mmap_mapper(struct videobuf_queue *q, struct vm_area_struct *vma); -/* --------------------------------------------------------------------- */ - -/* - * Local variables: - * c-basic-offset: 8 - * End: - */ +#endif