From: Philipp Zabel <p.zabel@pengutronix.de>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
Pawel Osciak <pawel@osciak.com>,
Kamil Debski <k.debski@samsung.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
kernel@pengutronix.de, Peter Seiderer <ps.report@gmx.net>,
Philipp Zabel <p.zabel@pengutronix.de>
Subject: [PATCH v3 1/5] [media] videodev2: Add V4L2_BUF_FLAG_LAST
Date: Fri, 6 Mar 2015 11:18:26 +0100 [thread overview]
Message-ID: <1425637110-12100-2-git-send-email-p.zabel@pengutronix.de> (raw)
In-Reply-To: <1425637110-12100-1-git-send-email-p.zabel@pengutronix.de>
From: Peter Seiderer <ps.report@gmx.net>
This v4l2_buffer flag can be used by drivers to mark a capture buffer
as the last generated buffer, for example after a V4L2_DEC_CMD_STOP
command was issued.
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
Changes since v2:
- Made V4L2_BUF_FLAG_LAST known to trace events
---
Documentation/DocBook/media/v4l/io.xml | 10 ++++++++++
include/trace/events/v4l2.h | 3 ++-
include/uapi/linux/videodev2.h | 2 ++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
index 1c17f80..f3b8bc0 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -1129,6 +1129,16 @@ in this buffer has not been created by the CPU but by some DMA-capable unit,
in which case caches have not been used.</entry>
</row>
<row>
+ <entry><constant>V4L2_BUF_FLAG_LAST</constant></entry>
+ <entry>0x00100000</entry>
+ <entry>Last buffer produced by the hardware. mem2mem codec drivers
+set this flag on the capture queue for the last buffer when the
+<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link> or
+<link linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl is called. After the
+queue is drained, the <link linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl will
+not block anymore, but return an &EPIPE;.</entry>
+ </row>
+ <row>
<entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MASK</constant></entry>
<entry>0x0000e000</entry>
<entry>Mask for timestamp types below. To test the
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h
index b9bb1f2..32c33aa 100644
--- a/include/trace/events/v4l2.h
+++ b/include/trace/events/v4l2.h
@@ -58,7 +58,8 @@
{ V4L2_BUF_FLAG_TIMESTAMP_MASK, "TIMESTAMP_MASK" }, \
{ V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN, "TIMESTAMP_UNKNOWN" }, \
{ V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC, "TIMESTAMP_MONOTONIC" }, \
- { V4L2_BUF_FLAG_TIMESTAMP_COPY, "TIMESTAMP_COPY" })
+ { V4L2_BUF_FLAG_TIMESTAMP_COPY, "TIMESTAMP_COPY" }, \
+ { V4L2_BUF_FLAG_LAST, "LAST" })
#define show_timecode_flags(flags) \
__print_flags(flags, "|", \
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index fbdc360..c642c10 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -809,6 +809,8 @@ struct v4l2_buffer {
#define V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000
#define V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000
#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
+/* mem2mem encoder/decoder */
+#define V4L2_BUF_FLAG_LAST 0x00100000
/**
* struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
--
2.1.4
next prev parent reply other threads:[~2015-03-06 10:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 10:18 [PATCH v3 0/5] Signalling last decoded frame by V4L2_BUF_FLAG_LAST and -EPIPE Philipp Zabel
2015-03-06 10:18 ` Philipp Zabel [this message]
2015-03-06 10:18 ` [PATCH v3 2/5] [media] videobuf2: return -EPIPE from DQBUF after the last buffer Philipp Zabel
2015-03-06 10:18 ` [PATCH v3 3/5] [media] coda: Set last buffer flag and fix EOS event Philipp Zabel
2015-03-06 10:18 ` [PATCH v3 4/5] [media] s5p-mfc: Set last buffer flag Philipp Zabel
2015-03-06 10:18 ` [PATCH v3 5/5] [media] DocBooc: mention mem2mem codecs for encoder/decoder commands Philipp Zabel
2015-03-17 10:46 ` [PATCH v3 0/5] Signalling last decoded frame by V4L2_BUF_FLAG_LAST and -EPIPE Philipp Zabel
2015-03-17 16:09 ` Hans Verkuil
2015-03-18 16:20 ` Kamil Debski
2015-03-18 16:27 ` Philipp Zabel
2015-04-07 14:44 ` Kamil Debski
2015-04-08 10:09 ` Hans Verkuil
2015-04-08 10:19 ` Pawel Osciak
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=1425637110-12100-2-git-send-email-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=hverkuil@xs4all.nl \
--cc=k.debski@samsung.com \
--cc=kernel@pengutronix.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=pawel@osciak.com \
--cc=ps.report@gmx.net \
--cc=sakari.ailus@linux.intel.com \
/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).