public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] [media] uvcvideo: mark buffer error where overflow
@ 2017-09-07  2:59 Baoyou Xie
  2017-10-16 14:41 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Baoyou Xie @ 2017-09-07  2:59 UTC (permalink / raw)
  To: laurent.pinchart, mchehab
  Cc: linux-media, linux-kernel, baoyou.xie, xie.baoyou, Baoyou Xie

Some cameras post inaccurate frame where next frame data overlap
it. this results in screen flicker, and it need to be prevented.

So this patch marks the buffer error to discard the frame where
buffer overflow.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/media/usb/uvc/uvc_video.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index fb86d6a..81a3530 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1077,6 +1077,7 @@ static void uvc_video_decode_data(struct uvc_streaming *stream,
 	/* Complete the current frame if the buffer size was exceeded. */
 	if (len > maxlen) {
 		uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");
+		buf->error = 1;
 		buf->state = UVC_BUF_STATE_READY;
 	}
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH v1] [media] uvcvideo: mark buffer error where overflow
@ 2017-08-18  7:17 Baoyou Xie
  0 siblings, 0 replies; 3+ messages in thread
From: Baoyou Xie @ 2017-08-18  7:17 UTC (permalink / raw)
  To: laurent.pinchart, mchehab
  Cc: linux-media, linux-kernel, shawnguo, baoyou.xie, baoyou.xie,
	jun.nie, broonie, arnd, Baoyou Xie

Some cameras post inaccurate frame where next frame data overlap
it. this results in screen flicker, and it need to be prevented.

So this patch marks the buffer error to discard the frame where
buffer overflow.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/media/usb/uvc/uvc_video.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index fb86d6a..81a3530 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1077,6 +1077,7 @@ static void uvc_video_decode_data(struct uvc_streaming *stream,
 	/* Complete the current frame if the buffer size was exceeded. */
 	if (len > maxlen) {
 		uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");
+		buf->error = 1;
 		buf->state = UVC_BUF_STATE_READY;
 	}
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-16 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-07  2:59 [PATCH v1] [media] uvcvideo: mark buffer error where overflow Baoyou Xie
2017-10-16 14:41 ` Laurent Pinchart
  -- strict thread matches above, loose matches on Subject: below --
2017-08-18  7:17 Baoyou Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox