af_pan.c File Reference

Audio panning filter (channels mixing) Original code written by Anders Johansson for MPlayer, reimplemented for FFmpeg. More...

#include <stdio.h>
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libswresample/swresample.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
Include dependency graph for af_pan.c:

Go to the source code of this file.

Data Structures

struct  PanContext
 

Macros

#define MAX_CHANNELS   63
 
#define OFFSET(x)   offsetof(PanContext, x)
 

Typedefs

typedef struct PanContext PanContext
 

Functions

static void skip_spaces (char **arg)
 
static int parse_channel_name (char **arg, int *rchannel, int *rnamed)
 
static av_cold int init (AVFilterContext *ctx)
 
static int are_gains_pure (const PanContext *pan)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *link)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *insamples)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (pan)
 

Variables

static const AVOption pan_options []
 
static const AVFilterPad pan_inputs []
 
static const AVFilterPad pan_outputs []
 
AVFilter avfilter_af_pan
 

Detailed Description

Audio panning filter (channels mixing) Original code written by Anders Johansson for MPlayer, reimplemented for FFmpeg.

Definition in file af_pan.c.

Macro Definition Documentation

#define MAX_CHANNELS   63

Definition at line 40 of file af_pan.c.

Referenced by are_gains_pure(), config_props(), and parse_channel_name().

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

Definition at line 385 of file af_pan.c.

Typedef Documentation

typedef struct PanContext PanContext

Function Documentation

static int are_gains_pure ( const PanContext pan)
static

Definition at line 202 of file af_pan.c.

Referenced by query_formats().

AVFILTER_DEFINE_CLASS ( pan  )
static int config_props ( AVFilterLink link)
static

Definition at line 252 of file af_pan.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame insamples 
)
static

Definition at line 359 of file af_pan.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 102 of file af_pan.c.

static int parse_channel_name ( char **  arg,
int *  rchannel,
int *  rnamed 
)
static

Definition at line 66 of file af_pan.c.

Referenced by init().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 224 of file af_pan.c.

static void skip_spaces ( char **  arg)
static

Definition at line 58 of file af_pan.c.

Referenced by init(), and parse_channel_name().

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 379 of file af_pan.c.

Variable Documentation

AVFilter avfilter_af_pan
Initial value:
= {
.name = "pan",
.description = NULL_IF_CONFIG_SMALL("Remix channels with coefficients (panning)."),
.priv_size = sizeof(PanContext),
.priv_class = &pan_class,
.init = init,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
static const AVFilterPad pan_inputs[]
Definition: af_pan.c:395
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int query_formats(AVFilterContext *ctx)
Definition: af_pan.c:224
struct PanContext PanContext
static av_cold int init(AVFilterContext *ctx)
Definition: af_pan.c:102
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
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_pan.c:379
static const AVFilterPad pan_outputs[]
Definition: af_pan.c:405

Definition at line 413 of file af_pan.c.

const AVFilterPad pan_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
.filter_frame = filter_frame,
},
{ NULL }
}
static int config_props(AVFilterLink *link)
Definition: af_pan.c:252
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
Definition: af_pan.c:359
NULL
Definition: eval.c:55

Definition at line 395 of file af_pan.c.

const AVOption pan_options[]
static
Initial value:
= {
{ "args", NULL, OFFSET(args), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
{ NULL }
}
#define AV_OPT_FLAG_AUDIO_PARAM
Definition: opt.h:284
#define AV_OPT_FLAG_FILTERING_PARAM
a generic parameter which can be set by the user for filtering
Definition: opt.h:287
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: af_pan.c:385

Definition at line 387 of file af_pan.c.

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

Definition at line 405 of file af_pan.c.