Re: [PATCHv2 02/12] videodev2.h: add V4L2_FMT_FLAG_DYN_RESOLUTION

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon 12 Aug 19, 13:05, Hans Verkuil wrote:
> From: Maxime Jourdan <mjourdan@xxxxxxxxxxxx>
> 
> Add an enum_fmt format flag to specifically tag coded formats where
> dynamic resolution switching is supported by the device.
> 
> This is useful for some codec drivers that can support dynamic
> resolution switching for one or more of their listed coded formats. It
> allows userspace to know whether it should extract the video parameters
> itself, or if it can rely on the device to send V4L2_EVENT_SOURCE_CHANGE
> when such changes are detected.

Makes sense and looks good to me:
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@xxxxxxxxxxx>

The docs aren't saying that this only applies to stateful decoders, but I think
it is quite clear that this can't apply to stateless decoders.

Cheers,

Paul

> Signed-off-by: Maxime Jourdan <mjourdan@xxxxxxxxxxxx>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
> [hverkuil-cisco@xxxxxxxxx: added flag to videodev2.h.rst.exceptions]
> [hverkuil-cisco@xxxxxxxxx: updated commit text: 'one or more' instead of 'all']
> Acked-by: Tomasz Figa <tfiga@xxxxxxxxxxxx>
> ---
>  Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 8 ++++++++
>  Documentation/media/videodev2.h.rst.exceptions   | 1 +
>  include/uapi/linux/videodev2.h                   | 1 +
>  3 files changed, 10 insertions(+)
> 
> diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
> index ebc05ce74bdf..719f1ed64f7d 100644
> --- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
> +++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
> @@ -135,6 +135,14 @@ one until ``EINVAL`` is returned.
>  	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. This flag is valid for stateful decoders only.
> +    * - ``V4L2_FMT_FLAG_DYN_RESOLUTION``
> +      - 0x0008
> +      - Dynamic resolution switching is supported by the device for this
> +	compressed bytestream format (aka coded format). It will notify the user
> +	via the event ``V4L2_EVENT_SOURCE_CHANGE`` when changes in the video
> +	parameters are detected. This flag can only be used in combination
> +	with the ``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to
> +	compressed formats only.
>  
>  
>  Return Value
> diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
> index a0640b6d0f68..adeb6b7a15cb 100644
> --- a/Documentation/media/videodev2.h.rst.exceptions
> +++ b/Documentation/media/videodev2.h.rst.exceptions
> @@ -181,6 +181,7 @@ replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats
>  replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags
>  replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags
>  replace define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM fmtdesc-flags
> +replace define V4L2_FMT_FLAG_DYN_RESOLUTION fmtdesc-flags
>  
>  # V4L2 timecode types
>  replace define V4L2_TC_TYPE_24FPS timecode-type
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 67077d52c59d..530638dffd93 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -777,6 +777,7 @@ struct v4l2_fmtdesc {
>  #define V4L2_FMT_FLAG_COMPRESSED		0x0001
>  #define V4L2_FMT_FLAG_EMULATED			0x0002
>  #define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM	0x0004
> +#define V4L2_FMT_FLAG_DYN_RESOLUTION		0x0008
>  
>  	/* Frame Size and frame rate enumeration */
>  /*
> -- 
> 2.20.1
> 

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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux