diff options
author | Marton Balint <cus@passwd.hu> | 2024-01-29 21:35:41 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2024-02-12 21:03:45 +0100 |
commit | 4569b861322671dae4de2b48bdf455ea353a570f (patch) | |
tree | 135cb2bfcfd050c4ba49053f1c98510e93cf23a7 /libavutil/channel_layout.h | |
parent | 0748d2bbc79a77abb7ea49cdc3ef55ac2605eaa0 (diff) | |
download | ffmpeg-4569b861322671dae4de2b48bdf455ea353a570f.tar.gz |
avutil/channel_layout: add av_channel_layout_custom_init()
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavutil/channel_layout.h')
-rw-r--r-- | libavutil/channel_layout.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h index 8dc1a91401..dcc320cbfe 100644 --- a/libavutil/channel_layout.h +++ b/libavutil/channel_layout.h @@ -618,6 +618,23 @@ void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_i enum AVChannel av_channel_from_string(const char *name); /** + * Initialize a custom channel layout with the specified number of channels. + * The channel map will be allocated and the designation of all channels will + * be set to AV_CHAN_UNKNOWN. + * + * This is only a convenience helper function, a custom channel layout can also + * be constructed without using this. + * + * @param channel_layout the layout structure to be initialized + * @param nb_channels the number of channels + * + * @return 0 on success + * AVERROR(EINVAL) if the number of channels <= 0 + * AVERROR(ENOMEM) if the channel map could not be allocated + */ +int av_channel_layout_custom_init(AVChannelLayout *channel_layout, int nb_channels); + +/** * Initialize a native channel layout from a bitmask indicating which channels * are present. * |