From: Jayakrishnan Date: Fri, 9 Mar 2012 13:10:49 +0000 (-0300) Subject: [media] uvcvideo: Fix frame drop in bulk video stream X-Git-Tag: staging/for_v3.6~233 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c854a48a97feb94ccd4501593badd1b9907326c2;p=profile%2Fivi%2Fkernel-x86-ivi.git [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 Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index b76b0ac..39f5c85 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, u8 *mem; int len, ret; - if (urb->actual_length == 0) + /* + * Ignore ZLPs if they're not part of a frame, otherwise process them + * to trigger the end of payload detection. + */ + if (urb->actual_length == 0 && stream->bulk.header_size == 0) return; mem = urb->transfer_buffer;