FFmpeg
Data Structures | Macros | Functions | Variables
af_pan.c File Reference
#include <stdio.h>
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libswresample/swresample.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"

Go to the source code of this file.

Data Structures

struct  PanContext
 

Macros

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

Functions

static void skip_spaces (char **arg)
 
static int parse_channel_name (char **arg, int *rchannel, int *rnamed)
 
static int are_gains_pure (const PanContext *pan)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
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 []
 
const AVFilter ff_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

◆ MAX_CHANNELS

#define MAX_CHANNELS   64

Definition at line 41 of file af_pan.c.

◆ OFFSET

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

Definition at line 401 of file af_pan.c.

Function Documentation

◆ skip_spaces()

static void skip_spaces ( char **  arg)
static

Definition at line 58 of file af_pan.c.

Referenced by init(), and parse_channel_name().

◆ parse_channel_name()

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

Definition at line 66 of file af_pan.c.

Referenced by init().

◆ are_gains_pure()

static int are_gains_pure ( const PanContext pan)
static

Definition at line 94 of file af_pan.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 116 of file af_pan.c.

◆ query_formats()

static int query_formats ( const AVFilterContext ctx,
AVFilterFormatsConfig **  cfg_in,
AVFilterFormatsConfig **  cfg_out 
)
static

Definition at line 246 of file af_pan.c.

◆ config_props()

static int config_props ( AVFilterLink link)
static

Definition at line 266 of file af_pan.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame insamples 
)
static

Definition at line 369 of file af_pan.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 394 of file af_pan.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( pan  )

Variable Documentation

◆ pan_options

const AVOption pan_options[]
static
Initial value:
= {
{ NULL }
}

Definition at line 403 of file af_pan.c.

◆ pan_inputs

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

Definition at line 410 of file af_pan.c.

◆ ff_af_pan

const AVFilter ff_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,
}

Definition at line 419 of file af_pan.c.

FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
config_props
static int config_props(AVFilterLink *link)
Definition: af_pan.c:266
AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_AUDIO_PARAM
Definition: opt.h:357
query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: af_pan.c:246
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
Definition: af_pan.c:369
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:34
pan_inputs
static const AVFilterPad pan_inputs[]
Definition: af_pan.c:410
OFFSET
#define OFFSET(x)
Definition: af_pan.c:401
AV_OPT_FLAG_FILTERING_PARAM
#define AV_OPT_FLAG_FILTERING_PARAM
A generic parameter which can be set by the user for filtering.
Definition: opt.h:381
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:94
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_pan.c:116
PanContext
Definition: af_pan.c:43
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_pan.c:394
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276