From patchwork Tue May 22 15:33:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 11373 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SWr6I-0002IU-1V for patchwork@linuxtv.org; Tue, 22 May 2012 17:34:18 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1SWr6H-0000R5-EV; Tue, 22 May 2012 17:34:18 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758990Ab2EVPeN (ORCPT ); Tue, 22 May 2012 11:34:13 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:27056 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932209Ab2EVPeK (ORCPT ); Tue, 22 May 2012 11:34:10 -0400 Received: from euspt2 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M4F00GIOKH2Q8@mailout1.w1.samsung.com> for linux-media@vger.kernel.org; Tue, 22 May 2012 16:31:50 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M4F00BS4KKUEY@spt2.w1.samsung.com> for linux-media@vger.kernel.org; Tue, 22 May 2012 16:34:06 +0100 (BST) Received: from localhost.localdomain (unknown [106.116.48.198]) by linux.samsung.com (Postfix) with ESMTP id 2741527004B; Tue, 22 May 2012 17:45:02 +0200 (CEST) Date: Tue, 22 May 2012 17:33:54 +0200 From: Andrzej Hajda Subject: [PATCH 1/2] v4l: added V4L2_BUF_FLAG_EOS flag indicating the last frame in the stream In-reply-to: <1337700835-13634-1-git-send-email-a.hajda@samsung.com> To: linux-media@vger.kernel.org Cc: hans.verkuil@cisco.com, m.szyprowski@samsung.com, k.debski@samsung.com, a.hajda@samsung.com Message-id: <1337700835-13634-2-git-send-email-a.hajda@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.0.4 Content-type: TEXT/PLAIN Content-transfer-encoding: 7BIT References: <1337700835-13634-1-git-send-email-a.hajda@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.22.152719 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_NO_HTTP 0.1, MULTIPLE_RCPTS 0.1, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_HTML 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Some devices requires indicator if the buffer is the last one in the stream. Applications and drivers can use this flag in such case. Signed-off-by: Andrzej Hajda Signed-off-by: Kyungmin Park --- Documentation/DocBook/media/v4l/io.xml | 7 +++++++ Documentation/DocBook/media/v4l/vidioc-qbuf.xml | 2 ++ include/linux/videodev2.h | 1 + 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml index fd6aca2..dcbf1e0 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml @@ -956,6 +956,13 @@ Typically applications shall use this flag for output buffers if the data in this buffer has not been created by the CPU but by some DMA-capable unit, in which case caches have not been used. + + V4L2_BUF_FLAG_EOS + 0x2000 + Application should set this flag in the output buffer +in order to inform the driver about the last frame of the stream. Some +drivers may require it to properly finish processing the stream. + diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml index 9caa49a..ad49f7d 100644 --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml @@ -76,6 +76,8 @@ supports capturing from specific video inputs and you want to specify a video input, then flags should be set to V4L2_BUF_FLAG_INPUT and the field input must be initialized to the desired input. +Some drivers expects applications set V4L2_BUF_FLAG_EOS +flag on the last buffer of the stream. The reserved field must be set to 0. When using the multi-planar API, the m.planes field must contain a userspace pointer diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 370d111..e44a7cd 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -676,6 +676,7 @@ struct v4l2_buffer { /* Cache handling flags */ #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 +#define V4L2_BUF_FLAG_EOS 0x2000 /* The last buffer in the stream */ /* * O V E R L A Y P R E V I E W