[FFmpeg-devel] [PATCH 001/293 v8] avutil/channel_layout: Add a new channel layout API

James Almer jamrial at gmail.com
Mon Jan 24 23:21:35 EET 2022



On 1/24/2022 6:08 PM, Marton Balint wrote:
> 
> 
> On Mon, 24 Jan 2022, James Almer wrote:
> 
>> From: Anton Khirnov <anton at khirnov.net>
>>
>> The new API is more extensible and allows for custom layouts.
>> More accurate information is exported, eg for decoders that do not
>> set a channel layout, lavc will not make one up for them.
>>
>> Deprecate the old API working with just uint64_t bitmasks.
>>
>> Expanded and completed by Vittorio Giovara <vittorio.giovara at gmail.com>
>> and James Almer <jamrial at gmail.com>.
>> Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>> Changes since last version:
>>
>> *Both av_channel_layout_describe() and av_channel_layout_from_string() 
>> now
>> support a "2 channels (FL+LFE)" syntax, to signal native (usually
>> non-standard) or custom order layouts.
>> *a single decimal value is now interpreted as a mask by
>> av_channel_layout_from_string(), same as a single hexadecimal value.
>> *De-duplicated code by simplifying 
>> av_channel_layout_channel_from_string().
> 
> AV_CHAN_UNKWNOWN is fixed in the Amibsonic patch, but it should be fixed 
> in this patch.

Constant rebases and amends can do that, sorry. Fixed in the github branch.

> 
>> +/**
>> + * Check whether a channel layout is valid, i.e. can possibly 
>> describe audio
>> + * data.
>> + *
>> + * @param channel_layout input channel layout
>> + * @return 1 if channel_layout is valid, 0 otherwise.
>> + */
>> +int av_channel_layout_check(const AVChannelLayout *channel_layout);
> 
> I still find the name av_channel_layout_valid() more readable, but feel 
> free to keep it as is if you disagree.

If others also prefer it then I'll change it. I personally don't find
av_channel_layout_check() worse than av_channel_layout_valid().

> 
> Thanks,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list