public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org,
	Maxime Jourdan <mjourdan@baylibre.com>,
	Tomasz Figa <tfiga@chromium.org>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Alexandre Courbot <acourbot@chromium.org>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Nicolas Dufresne <nicolas@ndufresne.ca>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [PATCH 02/14] videodev2.h: add V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER
Date: Sat, 27 Jul 2019 11:37:45 +0200	[thread overview]
Message-ID: <20190727093745.GB16618@aptenodytes> (raw)
In-Reply-To: <20190724110523.29248-3-hverkuil-cisco@xs4all.nl>

Hi,

On Wed 24 Jul 19, 13:05, Hans Verkuil wrote:
> Add an enum_fmt format flag to specifically tag coded formats where
> full bitstream parsing is supported by the device.
> 
> Some stateful decoders are capable of fully parsing a bitstream,
> but others require that userspace pre-parses the bitstream 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>
> ---
>  Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 8 ++++++++
>  Documentation/media/videodev2.h.rst.exceptions   | 1 +
>  include/uapi/linux/videodev2.h                   | 5 +++--
>  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..4e24e671f32e 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.
>        - This format is not native to the device but emulated through
>  	software (usually libv4l2), where possible try to use a native
>  	format instead for better performance.
> +    * - ``V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER``
> +      - 0x0004
> +      - The hardware decoder for this compressed bitstream format (aka coded
> +	format) is capable of parsing the bitstream. Applications do not
> +	need to parse the bitstream themselves to find the boundaries between
> +	frames/fields. This flag can only be used in combination with the
> +	``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to compressed
> +	formats only.

Should this flag be set for stateless codecs as well? It seems a bit over-kill
for this case. I am not sure whether "compressed bitstream format" clearly only
covers the formats used by stateful decoders and not the ones for stateless
decoders.

Cheers,

Paul

>  
>  Return Value
> diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
> index 55cbe324b9fc..74fb9f00c12d 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
>  # V4L2 format flags
>  replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags
>  replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags
> +replace define V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER fmtdesc-flags
>  
>  # V4L2 tymecode types
>  replace define V4L2_TC_TYPE_24FPS timecode-type
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 2427bc4d8eba..8c5a28666b16 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -774,8 +774,9 @@ struct v4l2_fmtdesc {
>  	__u32		    reserved[4];
>  };
>  
> -#define V4L2_FMT_FLAG_COMPRESSED 0x0001
> -#define V4L2_FMT_FLAG_EMULATED   0x0002
> +#define V4L2_FMT_FLAG_COMPRESSED		0x0001
> +#define V4L2_FMT_FLAG_EMULATED			0x0002
> +#define V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER	0x0004
>  
>  	/* Frame Size and frame rate enumeration */
>  /*
> -- 
> 2.20.1
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

  reply	other threads:[~2019-07-27  9:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 11:05 [PATCH 00/14] Stateful/stateless codec core support Hans Verkuil
2019-07-24 11:05 ` [PATCH 01/14] v4l2-ioctl.c: OR flags in v4l_fill_fmtdesc(), not don't overwrite Hans Verkuil
2019-07-24 13:22   ` Philipp Zabel
2019-07-24 13:30     ` Hans Verkuil
2019-07-24 14:34       ` Philipp Zabel
2019-07-24 11:05 ` [PATCH 02/14] videodev2.h: add V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER Hans Verkuil
2019-07-27  9:37   ` Paul Kocialkowski [this message]
2019-07-28 14:05     ` Tomasz Figa
2019-07-29 13:12       ` Paul Kocialkowski
2019-07-29 13:18         ` Tomasz Figa
2019-07-30  7:21           ` Hans Verkuil
2019-08-01 14:24             ` Nicolas Dufresne
2019-07-24 11:05 ` [PATCH 03/14] videodev2.h: add V4L2_FMT_FLAG_DYN_RESOLUTION Hans Verkuil
2019-07-24 11:05 ` [PATCH 04/14] videodev2.h.rst.exceptions: tymecode -> timecode Hans Verkuil
2019-07-27  9:43   ` Paul Kocialkowski
2019-07-24 11:05 ` [PATCH 05/14] media: venus: vdec: flag OUTPUT formats with V4L2_FMT_FLAG_DYN_RESOLUTION Hans Verkuil
2019-07-24 11:05 ` [PATCH 06/14] media: s5p_mfc_dec: set flags for OUTPUT coded formats Hans Verkuil
2019-07-26  9:12 ` [PATCH 00/14] Stateful/stateless codec core support Hans Verkuil
  -- strict thread matches above, loose matches on Subject: below --
2019-07-24 11:10 Hans Verkuil
2019-07-24 11:10 ` [PATCH 02/14] videodev2.h: add V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER Hans Verkuil
2019-07-24 11:27 [PATCH 00/14] Stateful/stateless codec core support (resend) Hans Verkuil
2019-07-24 11:27 ` [PATCH 02/14] videodev2.h: add V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER Hans Verkuil

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=20190727093745.GB16618@aptenodytes \
    --to=paul.kocialkowski@bootlin.com \
    --cc=acourbot@chromium.org \
    --cc=boris.brezillon@collabora.com \
    --cc=ezequiel@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=mjourdan@baylibre.com \
    --cc=nicolas@ndufresne.ca \
    --cc=p.zabel@pengutronix.de \
    --cc=s.nawrocki@samsung.com \
    --cc=stanimir.varbanov@linaro.org \
    --cc=tfiga@chromium.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