linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baoyou Xie <baoyou.xie@linaro.org>
To: laurent.pinchart@ideasonboard.com, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	shawnguo@kernel.org, baoyou.xie@gmail.com, baoyou.xie@zte.com.cn,
	jun.nie@linaro.org, broonie@kernel.org, arnd@arndb.de,
	Baoyou Xie <baoyou.xie@linaro.org>
Subject: [PATCH v1] [media] uvcvideo: mark buffer error where overflow
Date: Fri, 18 Aug 2017 15:17:56 +0800	[thread overview]
Message-ID: <1503040676-28802-1-git-send-email-baoyou.xie@linaro.org> (raw)

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

             reply	other threads:[~2017-08-18  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  7:17 Baoyou Xie [this message]
2017-09-07  2:59 [PATCH v1] [media] uvcvideo: mark buffer error where overflow Baoyou Xie
2017-10-16 14:41 ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503040676-28802-1-git-send-email-baoyou.xie@linaro.org \
    --to=baoyou.xie@linaro.org \
    --cc=arnd@arndb.de \
    --cc=baoyou.xie@gmail.com \
    --cc=baoyou.xie@zte.com.cn \
    --cc=broonie@kernel.org \
    --cc=jun.nie@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).