[FFmpeg-devel] [PATCH 2/9] avformat/avformat: add a function to return the name of stream groups

Stefano Sabatini stefasab at gmail.com
Tue Mar 5 16:50:23 EET 2024


On date Monday 2024-03-04 21:00:22 -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> Missing version bump and APIChanges entry.
> 
>  libavformat/avformat.c | 10 ++++++++++
>  libavformat/avformat.h |  5 +++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/libavformat/avformat.c b/libavformat/avformat.c
> index eb898223d2..98dfac2f89 100644
> --- a/libavformat/avformat.c
> +++ b/libavformat/avformat.c
> @@ -321,6 +321,16 @@ AVStream *ff_stream_clone(AVFormatContext *dst_ctx, const AVStream *src)
>      return st;
>  }
>  
> +const char *avformat_stream_group_name(enum AVStreamGroupParamsType type)
> +{
> +    switch(type) {
> +    case AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT:        return "IAMF Audio Element";
> +    case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION:     return "IAMF Mix Presentation";
> +    case AV_STREAM_GROUP_PARAMS_TILE_GRID:                 return "Tile Grid";
> +    }
> +    return NULL;
> +}
> +
>  AVProgram *av_new_program(AVFormatContext *ac, int id)
>  {
>      AVProgram *program = NULL;
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index f4506f4cf1..c41041b1bc 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -2120,6 +2120,11 @@ const AVClass *av_stream_get_class(void);
>   */
>  const AVClass *av_stream_group_get_class(void);
>  
> +/**
> + * @return a string identifying the stream group type
> + */
> +const char *avformat_stream_group_name(enum AVStreamGroupParamsType type);
> +

LGTM (remember to bump minor and add entry to doc/APIchanges before
pushing).


More information about the ffmpeg-devel mailing list