Libav
Modules | Functions

Modules

 Audio FIFO Buffer
 
 Audio channel masks
 
 Audio channel convenience macros
 
 Audio downmix metadata
 
 Audio sample formats
 Audio sample format enumeration and related convenience functions.
 
 Samples manipulation
 Functions that manipulate audio samples.
 

Functions

uint64_t av_get_channel_layout (const char *name)
 Return a channel layout id that matches name, or 0 if no match is found. More...
 
void av_get_channel_layout_string (char *buf, int buf_size, int nb_channels, uint64_t channel_layout)
 Return a description of a channel layout. More...
 
int av_get_channel_layout_nb_channels (uint64_t channel_layout)
 Return the number of channels in the channel layout. More...
 
uint64_t av_get_default_channel_layout (int nb_channels)
 Return default channel layout for a given number of channels. More...
 
int av_get_channel_layout_channel_index (uint64_t channel_layout, uint64_t channel)
 Get the index of a channel in channel_layout. More...
 
uint64_t av_channel_layout_extract_channel (uint64_t channel_layout, int index)
 Get the channel with the given index in channel_layout. More...
 
const char * av_get_channel_name (uint64_t channel)
 Get the name of a given channel. More...
 

Detailed Description

Function Documentation

uint64_t av_get_channel_layout ( const char *  name)

Return a channel layout id that matches name, or 0 if no match is found.

name can be one or several of the following notations, separated by '+' or '|':

  • the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
  • the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
  • a number of channels, in decimal, optionally followed by 'c', yielding the default channel layout for that number of channels (
    See also
    av_get_default_channel_layout);
  • a channel layout mask, in hexadecimal starting with "0x" (see the AV_CH_* macros).

Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"

Definition at line 130 of file channel_layout.c.

Referenced by channelmap_init(), get_channel(), init(), init_audio(), join_init(), and opt_channel_layout().

void av_get_channel_layout_string ( char *  buf,
int  buf_size,
int  nb_channels,
uint64_t  channel_layout 
)

Return a description of a channel layout.

If nb_channels is <= 0, it is guessed from the channel_layout.

Parameters
bufput here the string containing the channel layout
buf_sizesize in bytes of the buffer

Definition at line 146 of file channel_layout.c.

Referenced by avcodec_string(), channelmap_config_input(), channelmap_init(), config_output(), decode_audio(), dprint_options(), ff_alsa_open(), ff_audio_mix_set_matrix(), ff_dlog_link(), filter_frame(), guess_input_channel_layout(), init_filter_graph(), and print_digraph().

int av_get_channel_layout_nb_channels ( uint64_t  channel_layout)
uint64_t av_get_default_channel_layout ( int  nb_channels)
int av_get_channel_layout_channel_index ( uint64_t  channel_layout,
uint64_t  channel 
)

Get the index of a channel in channel_layout.

Parameters
channela channel layout describing exactly one channel which must be present in channel_layout.
Returns
index of channel in channel_layout on success, a negative AVERROR on error.

Definition at line 200 of file channel_layout.c.

Referenced by channelmap_config_input(), channelmap_init(), join_config_output(), parse_maps(), and read_restart_header().

uint64_t av_channel_layout_extract_channel ( uint64_t  channel_layout,
int  index 
)

Get the channel with the given index in channel_layout.

Definition at line 221 of file channel_layout.c.

Referenced by filter_frame(), guess_map_any(), init(), join_config_output(), join_init(), and query_formats().

const char* av_get_channel_name ( uint64_t  channel)

Get the name of a given channel.

Returns
channel name on success, NULL on error.

Definition at line 210 of file channel_layout.c.

Referenced by channelmap_config_input(), dump_paramchange(), init(), and join_config_output().