FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
af_channelmap.c File Reference
#include <ctype.h>
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ChannelMap
 
struct  ChannelMapContext
 

Macros

#define MAX_CH   64
 
#define OFFSET(x)   offsetof(ChannelMapContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  MappingMode {
  MAP_NONE, MAP_ONE_INT, MAP_ONE_STR, MAP_PAIR_INT_INT,
  MAP_PAIR_INT_STR, MAP_PAIR_STR_INT, MAP_PAIR_STR_STR
}
 

Functions

 AVFILTER_DEFINE_CLASS (channelmap)
 
static char * split (char *message, char delim)
 
static int get_channel_idx (char **map, int *ch, char delim, int max_ch)
 
static int get_channel (char **map, int *ch, char delim)
 
static av_cold int channelmap_init (AVFilterContext *ctx)
 
static int channelmap_query_formats (AVFilterContext *ctx)
 
static int channelmap_filter_frame (AVFilterLink *inlink, AVFrame *buf)
 
static int channelmap_config_input (AVFilterLink *inlink)
 

Variables

static const AVOption channelmap_options []
 
static const AVFilterPad avfilter_af_channelmap_inputs []
 
static const AVFilterPad avfilter_af_channelmap_outputs []
 
const AVFilter ff_af_channelmap
 

Detailed Description

audio channel mapping filter

Definition in file af_channelmap.c.

Macro Definition Documentation

◆ MAX_CH

#define MAX_CH   64

Definition at line 57 of file af_channelmap.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(ChannelMapContext, x)

Definition at line 68 of file af_channelmap.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 69 of file af_channelmap.c.

◆ F

Definition at line 70 of file af_channelmap.c.

Enumeration Type Documentation

◆ MappingMode

Enumerator
MAP_NONE 
MAP_ONE_INT 
MAP_ONE_STR 
MAP_PAIR_INT_INT 
MAP_PAIR_INT_STR 
MAP_PAIR_STR_INT 
MAP_PAIR_STR_STR 

Definition at line 47 of file af_channelmap.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( channelmap  )

◆ split()

static char* split ( char *  message,
char  delim 
)
static

◆ get_channel_idx()

static int get_channel_idx ( char **  map,
int ch,
char  delim,
int  max_ch 
)
static

Definition at line 88 of file af_channelmap.c.

Referenced by channelmap_init().

◆ get_channel()

static int get_channel ( char **  map,
int ch,
char  delim 
)
static

Definition at line 108 of file af_channelmap.c.

Referenced by channelmap_init().

◆ channelmap_init()

static av_cold int channelmap_init ( AVFilterContext ctx)
static

Definition at line 120 of file af_channelmap.c.

◆ channelmap_query_formats()

static int channelmap_query_formats ( AVFilterContext ctx)
static

Definition at line 295 of file af_channelmap.c.

◆ channelmap_filter_frame()

static int channelmap_filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 312 of file af_channelmap.c.

◆ channelmap_config_input()

static int channelmap_config_input ( AVFilterLink inlink)
static

Definition at line 366 of file af_channelmap.c.

Variable Documentation

◆ channelmap_options

const AVOption channelmap_options[]
static
Initial value:
= {
{ "map", "A comma-separated list of input channel numbers in output order.",
OFFSET(mapping_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ "channel_layout", "Output channel layout.",
OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ NULL }
}

Definition at line 71 of file af_channelmap.c.

◆ avfilter_af_channelmap_inputs

const AVFilterPad avfilter_af_channelmap_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = channelmap_filter_frame,
.config_props = channelmap_config_input,
},
}

Definition at line 402 of file af_channelmap.c.

◆ avfilter_af_channelmap_outputs

const AVFilterPad avfilter_af_channelmap_outputs[]
static
Initial value:
= {
{
.name = "default",
},
}

Definition at line 412 of file af_channelmap.c.

◆ ff_af_channelmap

const AVFilter ff_af_channelmap
Initial value:
= {
.name = "channelmap",
.description = NULL_IF_CONFIG_SMALL("Remap audio channels."),
.init = channelmap_init,
.priv_size = sizeof(ChannelMapContext),
.priv_class = &channelmap_class,
}

Definition at line 419 of file af_channelmap.c.

channelmap_filter_frame
static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_channelmap.c:312
F
#define F
Definition: af_channelmap.c:70
channelmap_init
static av_cold int channelmap_init(AVFilterContext *ctx)
Definition: af_channelmap.c:120
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:171
avfilter_af_channelmap_outputs
static const AVFilterPad avfilter_af_channelmap_outputs[]
Definition: af_channelmap.c:412
A
#define A
Definition: af_channelmap.c:69
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:194
NULL
#define NULL
Definition: coverity.c:32
channelmap_query_formats
static int channelmap_query_formats(AVFilterContext *ctx)
Definition: af_channelmap.c:295
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:115
ChannelMapContext
Definition: af_channelmap.c:58
avfilter_af_channelmap_inputs
static const AVFilterPad avfilter_af_channelmap_inputs[]
Definition: af_channelmap.c:402
channelmap_config_input
static int channelmap_config_input(AVFilterLink *inlink)
Definition: af_channelmap.c:366
OFFSET
#define OFFSET(x)
Definition: af_channelmap.c:68
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:195
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
AVFILTERPAD_FLAG_NEEDS_WRITABLE
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition: internal.h:68