af_channelmap.c File Reference

audio channel mapping filter More...

#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"
Include dependency graph for af_channelmap.c:

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
 

Typedefs

typedef struct ChannelMapContext ChannelMapContext
 

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

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, uint64_t *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 options []
 
static const AVClass channelmap_class
 
static const AVFilterPad avfilter_af_channelmap_inputs []
 
static const AVFilterPad avfilter_af_channelmap_outputs []
 
AVFilter avfilter_af_channelmap
 

Detailed Description

audio channel mapping filter

Definition in file af_channelmap.c.

Macro Definition Documentation

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 70 of file af_channelmap.c.

Definition at line 71 of file af_channelmap.c.

#define MAX_CH   64

Definition at line 57 of file af_channelmap.c.

Referenced by channelmap_filter_frame(), and channelmap_init().

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

Definition at line 69 of file af_channelmap.c.

Typedef Documentation

Enumeration Type Documentation

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

static int channelmap_config_input ( AVFilterLink inlink)
static

Definition at line 356 of file af_channelmap.c.

static int channelmap_filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 311 of file af_channelmap.c.

static av_cold int channelmap_init ( AVFilterContext ctx)
static

Definition at line 123 of file af_channelmap.c.

static int channelmap_query_formats ( AVFilterContext ctx)
static

Definition at line 299 of file af_channelmap.c.

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

Definition at line 111 of file af_channelmap.c.

Referenced by channelmap_init().

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

Definition at line 94 of file af_channelmap.c.

Referenced by channelmap_init().

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

Definition at line 87 of file af_channelmap.c.

Referenced by get_channel(), and get_channel_idx().

Variable Documentation

AVFilter avfilter_af_channelmap
Initial value:
= {
.name = "channelmap",
.description = NULL_IF_CONFIG_SMALL("Remap audio channels."),
.init = channelmap_init,
.query_formats = channelmap_query_formats,
.priv_size = sizeof(ChannelMapContext),
.priv_class = &channelmap_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
static int channelmap_query_formats(AVFilterContext *ctx)
struct ChannelMapContext ChannelMapContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const AVClass channelmap_class
Definition: af_channelmap.c:80
static const AVFilterPad avfilter_af_channelmap_inputs[]
static av_cold int channelmap_init(AVFilterContext *ctx)
static const AVFilterPad avfilter_af_channelmap_outputs[]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs

Definition at line 412 of file af_channelmap.c.

const AVFilterPad avfilter_af_channelmap_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = channelmap_filter_frame,
.config_props = channelmap_config_input,
.needs_writable = 1,
},
{ NULL }
}
static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf)
NULL
Definition: eval.c:55
static int channelmap_config_input(AVFilterLink *inlink)

Definition at line 393 of file af_channelmap.c.

const AVFilterPad avfilter_af_channelmap_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
NULL
Definition: eval.c:55

Definition at line 404 of file af_channelmap.c.

const AVClass channelmap_class
static
Initial value:
= {
.class_name = "channel map filter",
.item_name = av_default_item_name,
.option = options,
}
static const AVOption options[]
Definition: af_channelmap.c:72
av_default_item_name
LIBAVUTIL_VERSION_INT
Definition: eval.c:55

Definition at line 80 of file af_channelmap.c.

const AVOption 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 },
}
#define OFFSET(x)
Definition: af_channelmap.c:69
#define A
Definition: af_channelmap.c:70
NULL
Definition: eval.c:55
#define F
Definition: af_channelmap.c:71

Definition at line 72 of file af_channelmap.c.