From patchwork Tue Apr 10 09:50:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10624 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SHXj3-0001oM-9P for patchwork@linuxtv.org; Tue, 10 Apr 2012 11:51:01 +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-2) with esmtp for id 1SHXj2-0004cZ-I5; Tue, 10 Apr 2012 11:51:01 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755355Ab2DJJu6 (ORCPT ); Tue, 10 Apr 2012 05:50:58 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:56567 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754857Ab2DJJu5 (ORCPT ); Tue, 10 Apr 2012 05:50:57 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: TEXT/PLAIN Received: from euspt1 ([210.118.77.14]) by mailout4.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M29005H3CP1LM40@mailout4.w1.samsung.com> for linux-media@vger.kernel.org; Tue, 10 Apr 2012 10:51:01 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M29004TLCOVEV@spt1.w1.samsung.com> for linux-media@vger.kernel.org; Tue, 10 Apr 2012 10:50:55 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id CA3E6270056; Tue, 10 Apr 2012 11:59:56 +0200 (CEST) Date: Tue, 10 Apr 2012 11:50:42 +0200 From: Andrzej Hajda Subject: [RFC/PATCH] v4l: added V4L2_BUF_FLAG_EOS flag indicating the last frame in the stream To: linux-media@vger.kernel.org Cc: hans.verkuil@cisco.com, m.szyprowski@samsung.com, k.debski@samsung.com, Andrzej Hajda , Kyungmin Park Message-id: <1334051442-28359-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.7.9.1 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.4.10.94217 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_NO_HTTP 0.1, MULTIPLE_RCPTS 0.1, BODY_SIZE_3000_3999 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 ' v4l: added V4L2_BUF_FLAG_EOS flag indicating the last frame in the stream 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 --- Hello, This patch adds new v4l2_buffer flag V4L2_BUF_FLAG_EOS. This flag is set by applications on the output buffer to indicate the last buffer of the stream. Some devices (eg. s5p_mfc) requires presence of the end-of-stream indicator together with the last buffer. Common practice of sending empty buffer to indicate end-of-strem do not work in such case. I would like to ask for review and comments. Apologies for duplicated e-mails - sendmail problems. Regards Andrzej Hajda --- 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 b815929..7985ca9 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml @@ -954,6 +954,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 c9c9a46..d1d3406 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -671,6 +671,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