[FFmpeg-devel] [PATCH 16/38] lavc: add a decoder option for configuring side data preference

Marton Balint cus at passwd.hu
Fri Feb 23 19:51:45 EET 2024



On Fri, 23 Feb 2024, Anton Khirnov wrote:

> This and the following commits fix #10857
> ---
> doc/APIchanges             |  3 +++
> libavcodec/avcodec.h       | 20 ++++++++++++++++++++
> libavcodec/decode.c        | 36 ++++++++++++++++++++++++++++++++++++
> libavcodec/options_table.h | 12 ++++++++++++
> 4 files changed, 71 insertions(+)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 371fd2f465..78744a674a 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
>
> API changes, most recent first:
>
> +2024-02-xx - xxxxxxxxxx - lavc 60.xx.100 - avcodec.h
> +  Add AVCodecContext.[nb_]side_data_prefer_global.
> +
> 2024-02-xx - xxxxxxxxxx - lavu 58.xx.100 - opt.h
>   Add AV_OPT_FLAG_ARRAY and AVOption.array_max_size.
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 43859251cc..307a3e99db 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2120,6 +2120,26 @@ typedef struct AVCodecContext {
>      *   an error.
>      */
>     int64_t frame_num;
> +
> +    /**
> +     * Decoding only. May be set by the caller before avcodec_open2() to an
> +     * av_malloc()'ed array (or via AVOptions). Owned and freed by the decoder
> +     * afterwards.
> +     *
> +     * By default, when some side data type is present both in global
> +     * user-supplied coded_side_data and inside the coded bitstream, avcodec
> +     * will propagate the latter to the decoded frame.
> +     *
> +     * This array contains a list of AVPacketSideDataType for which this
> +     * preference should be switched, i.e. avcodec will prefer global side data
> +     * over those in stored in the bytestream. It may also contain a single -1,
> +     * in which case the preference is switched for all side data types.
> +     */
> +    int        *side_data_prefer_global;

Why is this a list and AV_OPT_FLAG_ARRAY? This simply should be a mask, so 
AV_OPT_TYPE_FLAGS.

Regards,
Marton


More information about the ffmpeg-devel mailing list