FFmpeg 5.1.6
|
An AVChannelLayout holds information about the channel layout of audio data. More...
#include <libavutil/channel_layout.h>
Data Fields | |
enum AVChannelOrder | order |
Channel order used in this layout. More... | |
int | nb_channels |
Number of channels in this layout. More... | |
union { | |
uint64_t mask | |
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels. More... | |
AVChannelCustom * map | |
This member must be used when the channel order is AV_CHANNEL_ORDER_CUSTOM. More... | |
} | u |
Details about which channels are present in this layout. More... | |
void * | opaque |
For some private data of the user. More... | |
An AVChannelLayout holds information about the channel layout of audio data.
A channel layout here is defined as a set of channels ordered in a specific way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an AVChannelLayout carries only the channel count).
Unlike most structures in Libav, sizeof(AVChannelLayout) is a part of the public ABI and may be used by the caller. E.g. it may be allocated on stack or embedded in caller-defined structs.
AVChannelLayout can be initialized as follows:
The channel layout must be unitialized with av_channel_layout_uninit()
Copying an AVChannelLayout via assigning is forbidden, av_channel_layout_copy() must be used instead (and its return value should be checked)
No new fields may be added to it without a major version bump, except for new elements of the union fitting in sizeof(uint64_t).
Definition at line 290 of file channel_layout.h.
enum AVChannelOrder AVChannelLayout::order |
Channel order used in this layout.
This is a mandatory field.
Definition at line 295 of file channel_layout.h.
Referenced by init_filter(), and init_filters().
int AVChannelLayout::nb_channels |
Number of channels in this layout.
Mandatory field.
Definition at line 300 of file channel_layout.h.
Referenced by decode(), init_converted_samples(), init_fifo(), init_filter(), init_filters(), main(), print_frame(), process_output(), and select_channel_layout().
uint64_t AVChannelLayout::mask |
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels.
It is a bitmask, where the position of each set bit means that the AVChannel with the corresponding value is present.
I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then AV_CHAN_FOO is present in the layout. Otherwise it is not present.
Definition at line 322 of file channel_layout.h.
AVChannelCustom* AVChannelLayout::map |
This member must be used when the channel order is AV_CHANNEL_ORDER_CUSTOM.
It is a nb_channels-sized array, with each element signalling the presence of the AVChannel with the corresponding value in map[i].id.
I.e. when map[i].id is equal to AV_CHAN_FOO, then AV_CH_FOO is the i-th channel in the audio data.
When map[i].id is in the range between AV_CHAN_AMBISONIC_BASE and AV_CHAN_AMBISONIC_END (inclusive), the channel contains an ambisonic component with ACN index (as defined above) n = map[i].id - AV_CHAN_AMBISONIC_BASE.
map[i].name may be filled with a 0-terminated string, in which case it will be used for the purpose of identifying the channel with the convenience functions below. Otherise it must be zeroed.
Definition at line 341 of file channel_layout.h.
union { ... } AVChannelLayout::u |
Details about which channels are present in this layout.
For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not be used.
void* AVChannelLayout::opaque |
For some private data of the user.
Definition at line 347 of file channel_layout.h.