[FFmpeg-devel] [PATCH v7 05/14] avutil/frame: add helper for adding side data to array

James Almer jamrial at gmail.com
Fri Mar 1 18:07:59 EET 2024


On 2/29/2024 1:42 PM, Jan Ekström wrote:
> diff --git a/libavutil/frame.h b/libavutil/frame.h
> index 921f2212cf..726ca19a03 100644
> --- a/libavutil/frame.h
> +++ b/libavutil/frame.h
> @@ -1060,6 +1060,27 @@ const char *av_frame_side_data_name(enum AVFrameSideDataType type);
>    */
>   void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd);
>   
> +#define AV_FRAME_SIDE_DATA_SET_FLAG_NO_DUPLICATES (1 << 0)
> +
> +/**
> + * Add a new side data entry to a set.
> + *
> + * @param sd    pointer to array of side data to which to add another entry.

Or to NULL, to start a new array.

> + * @param nb_sd pointer to an integer containing the number of entries in
> + *              the array.
> + * @param type  type of the added side data
> + * @param size  size of the side data
> + * @param flags Some combination of AV_FRAME_SIDE_DATA_SET_FLAG_* flags, or 0.
> + *
> + * @return newly added side data on success, NULL on error. In case of
> + *         AV_FRAME_SIDE_DATA_SET_FLAG_NO_DUPLICATES being set, entries
> + *         of matching AVFrameSideDataType will be removed before the
> + *         addition is attempted.
> + */
> +AVFrameSideData *av_frame_side_data_new(AVFrameSideData ***sd, int *nb_sd,
> +                                        enum AVFrameSideDataType type,
> +                                        size_t size, unsigned int flags);
> +
>   /**
>    * @}
>    */


More information about the ffmpeg-devel mailing list