diff options
author | Steven Toth <stoth@kernellabs.com> | 2011-04-06 07:32:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 08:28:43 -0400 |
commit | b7101de3fff596b35e45cd9fb7007caa07e97c9a (patch) | |
tree | 1c11baca827c290a1e312180204e8dc0472eabb9 /drivers/media/video/cx18/cx18-driver.h | |
parent | 5ed9bd02444a00bb1e8ecc1baa8ecdb633afc126 (diff) |
[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 <stoth@kernellabs.com>
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.h')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 25 |
1 files changed, 25 insertions, 0 deletions
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 @@ | |||
65 | #include "dvb_net.h" | 65 | #include "dvb_net.h" |
66 | #include "dvbdev.h" | 66 | #include "dvbdev.h" |
67 | 67 | ||
68 | /* Videobuf / YUV support */ | ||
69 | #include <media/videobuf-core.h> | ||
70 | #include <media/videobuf-vmalloc.h> | ||
71 | |||
68 | #ifndef CONFIG_PCI | 72 | #ifndef CONFIG_PCI |
69 | # error "This driver requires kernel PCI support." | 73 | # error "This driver requires kernel PCI support." |
70 | #endif | 74 | #endif |
@@ -403,6 +407,23 @@ struct cx18_stream { | |||
403 | struct cx18_queue q_idle; /* idle - not in rotation */ | 407 | struct cx18_queue q_idle; /* idle - not in rotation */ |
404 | 408 | ||
405 | struct work_struct out_work_order; | 409 | struct work_struct out_work_order; |
410 | |||
411 | /* Videobuf for YUV video */ | ||
412 | u32 pixelformat; | ||
413 | struct list_head vb_capture; /* video capture queue */ | ||
414 | spinlock_t vb_lock; | ||
415 | struct v4l2_framebuffer fbuf; | ||
416 | v4l2_std_id tvnorm; /* selected tv norm */ | ||
417 | struct timer_list vb_timeout; | ||
418 | int vbwidth; | ||
419 | int vbheight; | ||
420 | }; | ||
421 | |||
422 | struct cx18_videobuf_buffer { | ||
423 | /* Common video buffer sub-system struct */ | ||
424 | struct videobuf_buffer vb; | ||
425 | v4l2_std_id tvnorm; /* selected tv norm */ | ||
426 | u32 bytes_used; | ||
406 | }; | 427 | }; |
407 | 428 | ||
408 | struct cx18_open_id { | 429 | struct cx18_open_id { |
@@ -410,6 +431,10 @@ struct cx18_open_id { | |||
410 | u32 open_id; | 431 | u32 open_id; |
411 | int type; | 432 | int type; |
412 | struct cx18 *cx; | 433 | struct cx18 *cx; |
434 | |||
435 | struct videobuf_queue vbuf_q; | ||
436 | spinlock_t s_lock; /* Protect vbuf_q */ | ||
437 | enum v4l2_buf_type vb_type; | ||
413 | }; | 438 | }; |
414 | 439 | ||
415 | static inline struct cx18_open_id *fh2id(struct v4l2_fh *fh) | 440 | static inline struct cx18_open_id *fh2id(struct v4l2_fh *fh) |