Commit 773f7f2f authored by Stelian Pop's avatar Stelian Pop Committed by Linus Torvalds

[PATCH] meye: add v4l2 support

Signed-off-by: default avatarStelian Pop <stelian@popies.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4a5f5e21
...@@ -46,6 +46,8 @@ module argument syntax (<param>=<value> when passing the option to the ...@@ -46,6 +46,8 @@ module argument syntax (<param>=<value> when passing the option to the
module or meye.<param>=<value> on the kernel boot line when meye is module or meye.<param>=<value> on the kernel boot line when meye is
statically linked into the kernel). Those options are: statically linked into the kernel). Those options are:
forcev4l1: force use of V4L1 API instead of V4L2
gbuffers: number of capture buffers, default is 2 (32 max) gbuffers: number of capture buffers, default is 2 (32 max)
gbufsize: size of each capture buffer, default is 614400 gbufsize: size of each capture buffer, default is 614400
...@@ -78,8 +80,9 @@ Usage: ...@@ -78,8 +80,9 @@ Usage:
Private API: Private API:
------------ ------------
The driver supports frame grabbing with the video4linux API, so The driver supports frame grabbing with the video4linux API
all video4linux tools (like xawtv) should work with this driver. (either v4l1 or v4l2), so all video4linux tools (like xawtv)
should work with this driver.
Besides the video4linux interface, the driver has a private interface Besides the video4linux interface, the driver has a private interface
for accessing the Motion Eye extended parameters (camera sharpness, for accessing the Motion Eye extended parameters (camera sharpness,
...@@ -121,13 +124,7 @@ Private API: ...@@ -121,13 +124,7 @@ Private API:
Bugs / Todo: Bugs / Todo:
------------ ------------
- overlay output is not supported (although the camera is capable of). - the driver could be much cleaned up by removing the v4l1 support.
(it should not be too hard to to it, provided we found how...) However, this means all v4l1-only applications will stop working.
- mjpeg hardware playback doesn't work (depends on overlay...)
- rewrite the driver to use some common video4linux API for snapshot - 'motioneye' still uses the meye private v4l1 API extensions.
and mjpeg capture. Unfortunately, video4linux1 does not permit it,
the BUZ API seems to be targeted to TV cards only. The video4linux 2
API may be an option, if it goes into the kernel (maybe 2.5
material ?).
This diff is collapsed.
...@@ -279,6 +279,8 @@ ...@@ -279,6 +279,8 @@
struct meye_grab_buffer { struct meye_grab_buffer {
int state; /* state of buffer */ int state; /* state of buffer */
unsigned long size; /* size of jpg frame */ unsigned long size; /* size of jpg frame */
struct timeval timestamp; /* timestamp */
unsigned long sequence; /* sequence number */
}; };
/* size of kfifos containings buffer indices */ /* size of kfifos containings buffer indices */
...@@ -302,6 +304,7 @@ struct meye { ...@@ -302,6 +304,7 @@ struct meye {
unsigned char *grab_temp; /* temporary buffer */ unsigned char *grab_temp; /* temporary buffer */
/* list of buffers */ /* list of buffers */
struct meye_grab_buffer grab_buffer[MEYE_MAX_BUFNBRS]; struct meye_grab_buffer grab_buffer[MEYE_MAX_BUFNBRS];
int vma_use_count[MEYE_MAX_BUFNBRS]; /* mmap count */
/* other */ /* other */
struct semaphore lock; /* semaphore for open/mmap... */ struct semaphore lock; /* semaphore for open/mmap... */
......
...@@ -56,4 +56,11 @@ struct meye_params { ...@@ -56,4 +56,11 @@ struct meye_params {
/* get a jpeg compressed snapshot */ /* get a jpeg compressed snapshot */
#define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOCPRIVATE+5, int) #define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOCPRIVATE+5, int)
/* V4L2 private controls */
#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE
#define V4L2_CID_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1)
#define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2)
#define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3)
#define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment