From: Ming Qian <ming.qian@nxp.com>
To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl
Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] media: videobuf2: add V4L2_BUF_FLAG_CODECCONFIG flag
Date: Tue, 28 Jun 2022 10:19:09 +0800 [thread overview]
Message-ID: <20220628021909.14620-1-ming.qian@nxp.com> (raw)
By setting the V4L2_BUF_FLAG_CODECCONFIG flag,
user-space should be able to hint decoder
the vb2 only contains codec config header,
but does not contain any frame data.
It's only used for parsing header, and can't be decoded.
Current, it's usually used by android.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
---
Documentation/userspace-api/media/v4l/buffer.rst | 9 +++++++++
include/uapi/linux/videodev2.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/Documentation/userspace-api/media/v4l/buffer.rst b/Documentation/userspace-api/media/v4l/buffer.rst
index 4638ec64db00..acdc4556f4f4 100644
--- a/Documentation/userspace-api/media/v4l/buffer.rst
+++ b/Documentation/userspace-api/media/v4l/buffer.rst
@@ -607,6 +607,15 @@ Buffer Flags
the format. Any subsequent call to the
:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will not block anymore,
but return an ``EPIPE`` error code.
+ * .. _`V4L2-BUF-FLAG-CODECCONFIG`:
+
+ - ``V4L2_BUF_FLAG_CODECCONFIG``
+ - 0x00200000
+ - This flag may be set when the buffer only contains codec config
+ header, but does not contain any frame data. Usually the codec config
+ header is merged to the next idr frame, with the flag
+ ``V4L2_BUF_FLAG_KEYFRAME``, but there is still some scenes that will
+ split the header and queue it separately.
* .. _`V4L2-BUF-FLAG-REQUEST-FD`:
- ``V4L2_BUF_FLAG_REQUEST_FD``
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 5311ac4fde35..8708ef257710 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1131,6 +1131,8 @@ static inline __u64 v4l2_timeval_to_ns(const struct timeval *tv)
#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
/* mem2mem encoder/decoder */
#define V4L2_BUF_FLAG_LAST 0x00100000
+/* Buffer only contains codec header */
+#define V4L2_BUF_FLAG_CODECCONFIG 0x00200000
/* request_fd is valid */
#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000
--
2.36.1
next reply other threads:[~2022-06-28 2:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 2:19 Ming Qian [this message]
2022-07-04 15:52 ` Nicolas Dufresne
2022-07-05 1:52 ` [EXT] " Ming Qian
2022-07-05 11:34 ` Ming Qian
2022-07-05 13:12 ` Nicolas Dufresne
2022-07-06 8:46 ` Ming Qian
2022-07-05 12:34 ` Dave Stevenson
2022-07-05 13:25 ` Nicolas Dufresne
2022-07-05 15:23 ` kernel test robot
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=20220628021909.14620-1-ming.qian@nxp.com \
--to=ming.qian@nxp.com \
--cc=festevam@gmail.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--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
all inboxes | Powered by JetHome®