diff mbox series

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

Message ID 20240305000033.10379-2-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/9,v2] fftools/ffprobe: fix printing side data components and pieces | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer March 5, 2024, midnight UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
Missing version bump and APIChanges entry.

 libavformat/avformat.c | 10 ++++++++++
 libavformat/avformat.h |  5 +++++
 2 files changed, 15 insertions(+)

Comments

Stefano Sabatini March 5, 2024, 2:50 p.m. UTC | #1
On date Monday 2024-03-04 21:00:22 -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial@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).
Stefano Sabatini March 5, 2024, 2:52 p.m. UTC | #2
On date Tuesday 2024-03-05 15:50:23 +0100, Stefano Sabatini wrote:
> On date Monday 2024-03-04 21:00:22 -0300, James Almer wrote:
> > Signed-off-by: James Almer <jamrial@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
> > + */

Also add a note that this will return NULL in case of unknown 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).
James Almer March 5, 2024, 2:56 p.m. UTC | #3
On 3/5/2024 11:52 AM, Stefano Sabatini wrote:
> On date Tuesday 2024-03-05 15:50:23 +0100, Stefano Sabatini wrote:
>> On date Monday 2024-03-04 21:00:22 -0300, James Almer wrote:
>>> Signed-off-by: James Almer <jamrial@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
>>> + */
> 
> Also add a note that this will return NULL in case of unknown 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).

Applied with the suggestion.

Thanks.
diff mbox series

Patch

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);
+
 /**
  * Add a new empty stream group to a media file.
  *