summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-08-15 10:44:45 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-19 13:41:45 -0400
commit2b770bee787daec66ed86baf4fc83275f949c8ac (patch)
tree95b91f9db7577ea76939a0c9c3992441a1be43f8
parent760327930e10f6108ce9e44854ec3b5ef30cdcbd (diff)
media: videodev2.h: add V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM
Add an enum_fmt format flag to specifically tag coded formats where full bytestream parsing is supported by the device. Some stateful decoders are capable of fully parsing a bytestream, but others require that userspace pre-parses the bytestream into frames or fields (see the corresponding pixelformat descriptions for details). If this flag is set, then this pre-parsing step is not required (but still possible, of course). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--Documentation/media/uapi/v4l/vidioc-enum-fmt.rst8
-rw-r--r--Documentation/media/videodev2.h.rst.exceptions1
-rw-r--r--include/uapi/linux/videodev2.h5
3 files changed, 12 insertions, 2 deletions
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
index 822d6730e7d2..ebc05ce74bdf 100644
--- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
@@ -127,6 +127,14 @@ one until ``EINVAL`` is returned.
127 - This format is not native to the device but emulated through 127 - This format is not native to the device but emulated through
128 software (usually libv4l2), where possible try to use a native 128 software (usually libv4l2), where possible try to use a native
129 format instead for better performance. 129 format instead for better performance.
130 * - ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
131 - 0x0004
132 - The hardware decoder for this compressed bytestream format (aka coded
133 format) is capable of parsing a continuous bytestream. Applications do
134 not need to parse the bytestream themselves to find the boundaries
135 between frames/fields. This flag can only be used in combination with
136 the ``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to compressed
137 formats only. This flag is valid for stateful decoders only.
130 138
131 139
132Return Value 140Return Value
diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
index 8e7d3492d248..a0640b6d0f68 100644
--- a/Documentation/media/videodev2.h.rst.exceptions
+++ b/Documentation/media/videodev2.h.rst.exceptions
@@ -180,6 +180,7 @@ replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats
180# V4L2 format flags 180# V4L2 format flags
181replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags 181replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags
182replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags 182replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags
183replace define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM fmtdesc-flags
183 184
184# V4L2 timecode types 185# V4L2 timecode types
185replace define V4L2_TC_TYPE_24FPS timecode-type 186replace define V4L2_TC_TYPE_24FPS timecode-type
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 2427bc4d8eba..67077d52c59d 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -774,8 +774,9 @@ struct v4l2_fmtdesc {
774 __u32 reserved[4]; 774 __u32 reserved[4];
775}; 775};
776 776
777#define V4L2_FMT_FLAG_COMPRESSED 0x0001 777#define V4L2_FMT_FLAG_COMPRESSED 0x0001
778#define V4L2_FMT_FLAG_EMULATED 0x0002 778#define V4L2_FMT_FLAG_EMULATED 0x0002
779#define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM 0x0004
779 780
780 /* Frame Size and frame rate enumeration */ 781 /* Frame Size and frame rate enumeration */
781/* 782/*