V4L/DVB (9809): uvcvideo: Add nodrop module parameter to turn incomplete frame drop...
authorLaurent Pinchart <laurent.pinchart@skynet.be>
Sat, 6 Dec 2008 19:25:14 +0000 (16:25 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 30 Dec 2008 11:38:33 +0000 (09:38 -0200)
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>
drivers/media/video/uvc/uvc_driver.c
drivers/media/video/uvc/uvc_video.c
drivers/media/video/uvc/uvcvideo.h

index 7fe3ae954c190cea14c272fc21e33206aa1f8bda..a67533f11f2ecf0693f0c93c775fcc6a03a2df8e 100644 (file)
@@ -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;
 
@@ -1939,6 +1940,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);
index 186ef9fad80bae87056c1ddb1c783b61d7e28c60..b7160b15e78046b5944e318437e33373c67c906f 100644 (file)
@@ -1003,7 +1003,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;
index 595b90ee6528ba90158b32c050f16b2dde4892df..437df60e0daebf04b701ca225052a4fc1b2b05c7 100644 (file)
@@ -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...) \