diff options
author | Laurent Pinchart <laurent.pinchart@skynet.be> | 2008-12-06 20:25:14 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@skynet.be> | 2008-12-06 20:25:14 +0100 |
commit | 3ccc9245fe4ae35845a4d5ed89581bf56165ae78 (patch) | |
tree | b4c810f54890068670cd053b6259485c3345d52a /linux/drivers/media | |
parent | 4d8582967a124a215baac71664035b0d6d4a346f (diff) | |
download | mediapointer-dvb-s2-3ccc9245fe4ae35845a4d5ed89581bf56165ae78.tar.gz mediapointer-dvb-s2-3ccc9245fe4ae35845a4d5ed89581bf56165ae78.tar.bz2 |
uvcvideo: Add nodrop module parameter to turn incomplete frame drop off.
From: Laurent Pinchart <laurent.pinchart@skynet.be>
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.
Priority: normal
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/uvc/uvc_driver.c | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/uvc/uvc_video.c | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/uvc/uvcvideo.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/linux/drivers/media/video/uvc/uvc_driver.c b/linux/drivers/media/video/uvc/uvc_driver.c index 0a0ef6611..424a02965 100644 --- a/linux/drivers/media/video/uvc/uvc_driver.c +++ b/linux/drivers/media/video/uvc/uvc_driver.c @@ -44,6 +44,7 @@ #define DRIVER_VERSION "v0.1.0" #endif +unsigned int uvc_no_drop_param; static unsigned int uvc_quirks_param; unsigned int uvc_trace_param; @@ -1945,6 +1946,8 @@ static void __exit uvc_cleanup(void) module_init(uvc_init); module_exit(uvc_cleanup); +module_param_named(nodrop, uvc_no_drop_param, uint, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(nodrop, "Don't drop incomplete frames"); module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(quirks, "Forced device quirks"); module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR); diff --git a/linux/drivers/media/video/uvc/uvc_video.c b/linux/drivers/media/video/uvc/uvc_video.c index 3be776a47..b19e91dd5 100644 --- a/linux/drivers/media/video/uvc/uvc_video.c +++ b/linux/drivers/media/video/uvc/uvc_video.c @@ -1007,7 +1007,8 @@ int uvc_video_enable(struct uvc_video_device *video, int enable) return 0; } - if (video->streaming->cur_format->flags & UVC_FMT_FLAG_COMPRESSED) + if ((video->streaming->cur_format->flags & UVC_FMT_FLAG_COMPRESSED) || + uvc_no_drop_param) video->queue.flags &= ~UVC_QUEUE_DROP_INCOMPLETE; else video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE; diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h index 09b169b69..4533e34ef 100644 --- a/linux/drivers/media/video/uvc/uvcvideo.h +++ b/linux/drivers/media/video/uvc/uvcvideo.h @@ -683,6 +683,7 @@ struct uvc_driver { #define UVC_WARN_MINMAX 0 #define UVC_WARN_PROBE_DEF 1 +extern unsigned int uvc_no_drop_param; extern unsigned int uvc_trace_param; #define uvc_trace(flag, msg...) \ |