[FFmpeg-devel] [PATCH 001/279] Add a new channel layout API

Marton Balint cus at passwd.hu
Wed Dec 15 11:05:15 EET 2021



On Wed, 15 Dec 2021, Marton Balint wrote:

>
>
> On Tue, 14 Dec 2021, James Almer wrote:
>
>>>
>>>> 
>>>>>
>>>>>>        return channel_names[channel_id].name;
>>>>>>    }
>>>>>>
>>>>>>    -static const struct {
>>>>>>    +static inline void get_channel_str(AVBPrint *bp, const char *str,
>>>>>>    +                                   enum AVChannel channel_id)
>>>>>>    +{
>>>>>>    +    if (str)
>>>>>>    +        av_bprintf(bp, "%s", str);
>>>>>>    +    else
>>>>>>    +        av_bprintf(bp, "?");
>>>>>
>>>>>    If this is not allowed, then you should propagate back
>>>>>   AVERROR(EINVAL)
>>>>>   if
>>>>>    it does. If it is allowed, because the user can use some custom
>>>>>    channel_id-s, then something like "USER%d" should be returned IMHO.
>>>>
>>>>   How about Ch%d? It would also further improve the usefulness of
>>>>   av_channel_layout_from_string() by looking for such strings.
>>>
>>>   I find "Ch%d" a bit confusing, beacuse "Ch%d" would normally mean the
>>>   n-th
>>>   channel in a layout, not a channel with the n-th ID.
>>
>>  What do you suggest? USER%d is IMO ugly. Maybe ChID%d? Although both are a
>>  bit long.
>
> Can be Usr%d, Dsg%d if you like these better. If not then, I don't mind too 
> much Ch%d, I just find it a bit confusing.

One more thing, don't we want to follow existing convention?

E.g. for channel name a abbriviated name with all capital letters, (that 
is why I suggested USER%d as a first), and for channel desription, a 
longer one, with lowercase, e.g. "user %d".

I noticed the same inconsistency for ambisonic, because as far as I see 
for that now both the short name is "ambisonic %d" and the description is 
also. It would be more consistent to have "AMBI%d" and "amibisonic %d" 
for name and description.

Regards,
Marton


More information about the ffmpeg-devel mailing list