Libav
Functions | Variables
channel_layout.c File Reference

audio channel layout utility functions More...

#include <stdint.h>
#include "avstring.h"
#include "avutil.h"
#include "channel_layout.h"
#include "common.h"

Go to the source code of this file.

Functions

static const char * get_channel_name (int channel_id)
static uint64_t get_channel_layout_single (const char *name, int name_len)
uint64_t av_get_channel_layout (const char *name)
 Return a channel layout id that matches name, or 0 if no match is found.
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.
int av_get_channel_layout_nb_channels (uint64_t channel_layout)
 Return the number of channels in the channel layout.
uint64_t av_get_default_channel_layout (int nb_channels)
 Return default channel layout for a given number of channels.
int av_get_channel_layout_channel_index (uint64_t channel_layout, uint64_t channel)
 Get the index of a channel in channel_layout.
const char * av_get_channel_name (uint64_t channel)
 Get the name of a given channel.
uint64_t av_channel_layout_extract_channel (uint64_t channel_layout, int index)
 Get the channel with the given index in channel_layout.

Variables

static const char *const channel_names []
struct {
   const char *   name
   int   nb_channels
   uint64_t   layout
channel_layout_map []

Detailed Description

audio channel layout utility functions

Definition in file channel_layout.c.

Function Documentation

static const char* get_channel_name ( int  channel_id)
static

Definition at line 61 of file channel_layout.c.

Referenced by av_get_channel_layout_string(), and av_get_channel_name().

static uint64_t get_channel_layout_single ( const char *  name,
int  name_len 
)
static

Definition at line 104 of file channel_layout.c.

Referenced by av_get_channel_layout().

Variable Documentation

const char* const channel_names[]
static
Initial value:
{
[0] = "FL",
[1] = "FR",
[2] = "FC",
[3] = "LFE",
[4] = "BL",
[5] = "BR",
[6] = "FLC",
[7] = "FRC",
[8] = "BC",
[9] = "SL",
[10] = "SR",
[11] = "TC",
[12] = "TFL",
[13] = "TFC",
[14] = "TFR",
[15] = "TBL",
[16] = "TBC",
[17] = "TBR",
[29] = "DL",
[30] = "DR",
[31] = "WL",
[32] = "WR",
[33] = "SDL",
[34] = "SDR",
[35] = "LFE2",
}

Definition at line 33 of file channel_layout.c.

Referenced by get_channel_layout_single(), and get_channel_name().

const char* name
int nb_channels
uint64_t layout
struct { ... } channel_layout_map[]