FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_ladspa.c File Reference

LADSPA wrapper. More...

#include <dlfcn.h>
#include <ladspa.h>
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  LADSPAContext
 

Macros

#define OFFSET(x)   offsetof(LADSPAContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (ladspa)
 
static void print_ctl_info (AVFilterContext *ctx, int level, LADSPAContext *s, int ctl, unsigned long *map, LADSPA_Data *values, int print)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 
static void set_default_ctl_value (LADSPAContext *s, int ctl, unsigned long *map, LADSPA_Data *values)
 
static int connect_ports (AVFilterContext *ctx, AVFilterLink *link)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static void count_ports (const LADSPA_Descriptor *desc, unsigned long *nb_inputs, unsigned long *nb_outputs)
 
static voidtry_load (const char *dir, const char *soname)
 
static int set_control (AVFilterContext *ctx, unsigned long port, LADSPA_Data value)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 

Variables

static const AVOption ladspa_options []
 
static const AVFilterPad ladspa_outputs []
 
AVFilter ff_af_ladspa
 

Detailed Description

LADSPA wrapper.

Definition in file af_ladspa.c.

Macro Definition Documentation

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

Definition at line 68 of file af_ladspa.c.

Definition at line 69 of file af_ladspa.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( ladspa  )
static void print_ctl_info ( AVFilterContext ctx,
int  level,
LADSPAContext s,
int  ctl,
unsigned long *  map,
LADSPA_Data *  values,
int  print 
)
static

Definition at line 88 of file af_ladspa.c.

Referenced by filter_frame(), init(), and request_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 140 of file af_ladspa.c.

Referenced by init().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 183 of file af_ladspa.c.

static void set_default_ctl_value ( LADSPAContext s,
int  ctl,
unsigned long *  map,
LADSPA_Data *  values 
)
static

Definition at line 218 of file af_ladspa.c.

Referenced by init().

static int connect_ports ( AVFilterContext ctx,
AVFilterLink link 
)
static

Definition at line 255 of file af_ladspa.c.

Referenced by config_input(), and config_output().

static int config_input ( AVFilterLink inlink)
static

Definition at line 289 of file af_ladspa.c.

Referenced by init().

static int config_output ( AVFilterLink outlink)
static

Definition at line 296 of file af_ladspa.c.

static void count_ports ( const LADSPA_Descriptor *  desc,
unsigned long *  nb_inputs,
unsigned long *  nb_outputs 
)
static

Definition at line 320 of file af_ladspa.c.

Referenced by init().

static void* try_load ( const char *  dir,
const char *  soname 
)
static

Definition at line 339 of file af_ladspa.c.

Referenced by init().

static int set_control ( AVFilterContext ctx,
unsigned long  port,
LADSPA_Data  value 
)
static

Definition at line 352 of file af_ladspa.c.

Referenced by init(), and process_command().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 386 of file af_ladspa.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 584 of file af_ladspa.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 643 of file af_ladspa.c.

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 671 of file af_ladspa.c.

Variable Documentation

const AVOption ladspa_options[]
static
Initial value:
= {
{ "file", "set library name or full path", OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "f", "set library name or full path", OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "plugin", "set plugin name", OFFSET(plugin), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "p", "set plugin name", OFFSET(plugin), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "controls", "set plugin options", OFFSET(options), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "c", "set plugin options", OFFSET(options), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100}, 1, INT32_MAX, FLAGS },
{ "s", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100}, 1, INT32_MAX, FLAGS },
{ "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
{ "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
{ "duration", "set audio duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=-1}, -1, INT64_MAX, FLAGS },
{ "d", "set audio duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=-1}, -1, INT64_MAX, FLAGS },
{ NULL }
}

Definition at line 70 of file af_ladspa.c.

const AVFilterPad ladspa_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
}

Definition at line 683 of file af_ladspa.c.

AVFilter ff_af_ladspa
Initial value:
= {
.name = "ladspa",
.description = NULL_IF_CONFIG_SMALL("Apply LADSPA effect."),
.priv_size = sizeof(LADSPAContext),
.priv_class = &ladspa_class,
.init = init,
.inputs = 0,
}

Definition at line 693 of file af_ladspa.c.