aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc
diff options
context:
space:
mode:
authorJayakrishnan <jayakrishnan.memana@maxim-ic.com>2012-03-09 08:10:49 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 14:26:46 -0400
commitc854a48a97feb94ccd4501593badd1b9907326c2 (patch)
tree51fc8e2e321964e9fc03d269fd61b2e980ab27b3 /drivers/media/video/uvc
parent7078daa020db5ba501fa3de64b8653c221a640b4 (diff)
[media] uvcvideo: Fix frame drop in bulk video stream
When video endpoint is configured as bulk, a ZLP is sent after every video frames with size as multiple of 512 bytes. This is done so that host can detect end of transfer and pass data for processing. Still, frames that are multiple of 16K in size gets dropped. The ZLP sent by camera is ignored by uvc_video_decode_bulk(). The makes sure that the ZLP is not part of a video frame before ignoring it. If ZLP follows a video frame, then it triggers completion callback. [mchehab@redhat.com: Fix a small CodingStyle issue] Signed-off-by: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r--drivers/media/video/uvc/uvc_video.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index b76b0ac0958f..39f5c85dd4b4 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -1188,7 +1188,11 @@ static void uvc_video_decode_bulk(struct urb *urb, struct uvc_streaming *stream,
1188 u8 *mem; 1188 u8 *mem;
1189 int len, ret; 1189 int len, ret;
1190 1190
1191 if (urb->actual_length == 0) 1191 /*
1192 * Ignore ZLPs if they're not part of a frame, otherwise process them
1193 * to trigger the end of payload detection.
1194 */
1195 if (urb->actual_length == 0 && stream->bulk.header_size == 0)
1192 return; 1196 return;
1193 1197
1194 mem = urb->transfer_buffer; 1198 mem = urb->transfer_buffer;