From b7101de3fff596b35e45cd9fb7007caa07e97c9a Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Wed, 6 Apr 2011 08:32:56 -0300 Subject: [media] cx18: mmap() support for raw YUV video capture Add support for mmap method streaming of raw YUV video on cx18-based hardware, in addition to the existing support for read() streaming of raw YUV and MPEG-2 encoded video. [simon.farnsworth@onelan.co.uk: I forward-ported this from Steven's original work, done under contract to ONELAN. The original code is at http://www.kernellabs.com/hg/~stoth/cx18-videobuf] Signed-off-by: Steven Toth Signed-off-by: Simon Farnsworth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx18/cx18-driver.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'drivers/media/video/cx18/cx18-driver.h') diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index b86a740c68df..70e1e0401645 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h @@ -65,6 +65,10 @@ #include "dvb_net.h" #include "dvbdev.h" +/* Videobuf / YUV support */ +#include +#include + #ifndef CONFIG_PCI # error "This driver requires kernel PCI support." #endif @@ -403,6 +407,23 @@ struct cx18_stream { struct cx18_queue q_idle; /* idle - not in rotation */ struct work_struct out_work_order; + + /* Videobuf for YUV video */ + u32 pixelformat; + struct list_head vb_capture; /* video capture queue */ + spinlock_t vb_lock; + struct v4l2_framebuffer fbuf; + v4l2_std_id tvnorm; /* selected tv norm */ + struct timer_list vb_timeout; + int vbwidth; + int vbheight; +}; + +struct cx18_videobuf_buffer { + /* Common video buffer sub-system struct */ + struct videobuf_buffer vb; + v4l2_std_id tvnorm; /* selected tv norm */ + u32 bytes_used; }; struct cx18_open_id { @@ -410,6 +431,10 @@ struct cx18_open_id { u32 open_id; int type; struct cx18 *cx; + + struct videobuf_queue vbuf_q; + spinlock_t s_lock; /* Protect vbuf_q */ + enum v4l2_buf_type vb_type; }; static inline struct cx18_open_id *fh2id(struct v4l2_fh *fh) -- cgit v1.2.3