diff options
author | Laurent Pinchart <laurent.pinchart@skynet.be> | 2008-12-06 14:25:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:38:33 -0500 |
commit | 0fbd8ee6de6ac3d0b93c96da848c5bc3ccc1dc83 (patch) | |
tree | c0f3cba859ee51d84c9cafcc38f2a998f9a070fc /drivers/media/video/uvc | |
parent | af009cf635141858642864a26602e379e97bf7d6 (diff) |
V4L/DVB (9809): uvcvideo: Add nodrop module parameter to turn incomplete frame drop off.
The driver drops incomplete uncompressed video frames to avoid confusing
userspace with corrupt data. Add a nodrop module parameter to turn that
behaviour off and make all frames available to userspace.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r-- | drivers/media/video/uvc/uvc_driver.c | 3 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvc_video.c | 3 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvcvideo.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c index 7fe3ae954c19..a67533f11f2e 100644 --- a/drivers/media/video/uvc/uvc_driver.c +++ b/drivers/media/video/uvc/uvc_driver.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #define DRIVER_VERSION "v0.1.0" | 44 | #define DRIVER_VERSION "v0.1.0" |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | unsigned int uvc_no_drop_param; | ||
47 | static unsigned int uvc_quirks_param; | 48 | static unsigned int uvc_quirks_param; |
48 | unsigned int uvc_trace_param; | 49 | unsigned int uvc_trace_param; |
49 | 50 | ||
@@ -1939,6 +1940,8 @@ static void __exit uvc_cleanup(void) | |||
1939 | module_init(uvc_init); | 1940 | module_init(uvc_init); |
1940 | module_exit(uvc_cleanup); | 1941 | module_exit(uvc_cleanup); |
1941 | 1942 | ||
1943 | module_param_named(nodrop, uvc_no_drop_param, uint, S_IRUGO|S_IWUSR); | ||
1944 | MODULE_PARM_DESC(nodrop, "Don't drop incomplete frames"); | ||
1942 | module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR); | 1945 | module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR); |
1943 | MODULE_PARM_DESC(quirks, "Forced device quirks"); | 1946 | MODULE_PARM_DESC(quirks, "Forced device quirks"); |
1944 | module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR); | 1947 | module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR); |
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 186ef9fad80b..b7160b15e780 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c | |||
@@ -1003,7 +1003,8 @@ int uvc_video_enable(struct uvc_video_device *video, int enable) | |||
1003 | return 0; | 1003 | return 0; |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | if (video->streaming->cur_format->flags & UVC_FMT_FLAG_COMPRESSED) | 1006 | if ((video->streaming->cur_format->flags & UVC_FMT_FLAG_COMPRESSED) || |
1007 | uvc_no_drop_param) | ||
1007 | video->queue.flags &= ~UVC_QUEUE_DROP_INCOMPLETE; | 1008 | video->queue.flags &= ~UVC_QUEUE_DROP_INCOMPLETE; |
1008 | else | 1009 | else |
1009 | video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE; | 1010 | video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE; |
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index 595b90ee6528..437df60e0dae 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h | |||
@@ -683,6 +683,7 @@ struct uvc_driver { | |||
683 | #define UVC_WARN_MINMAX 0 | 683 | #define UVC_WARN_MINMAX 0 |
684 | #define UVC_WARN_PROBE_DEF 1 | 684 | #define UVC_WARN_PROBE_DEF 1 |
685 | 685 | ||
686 | extern unsigned int uvc_no_drop_param; | ||
686 | extern unsigned int uvc_trace_param; | 687 | extern unsigned int uvc_trace_param; |
687 | 688 | ||
688 | #define uvc_trace(flag, msg...) \ | 689 | #define uvc_trace(flag, msg...) \ |