FFmpeg  4.0
Data Structures | Macros | Functions | Variables
af_lv2.c File Reference

LV2 wrapper. More...

#include <lilv/lilv.h>
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
#include <lv2/lv2plug.in/ns/ext/buf-size/buf-size.h>
#include "libavutil/avassert.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  URITable
 
struct  LV2Context
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (lv2)
 
static void uri_table_init (URITable *table)
 
static void uri_table_destroy (URITable *table)
 
static LV2_URID uri_table_map (LV2_URID_Map_Handle handle, const char *uri)
 
static const char * uri_table_unmap (LV2_URID_Map_Handle handle, LV2_URID urid)
 
static void connect_ports (LV2Context *s, AVFrame *in, AVFrame *out)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption lv2_options []
 
static const LV2_Feature buf_size_features [3]
 
static const AVFilterPad lv2_outputs []
 
AVFilter ff_af_lv2
 

Detailed Description

LV2 wrapper.

Definition in file af_lv2.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 91 of file af_lv2.c.

◆ FLAGS

Definition at line 92 of file af_lv2.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( lv2  )

◆ uri_table_init()

static void uri_table_init ( URITable table)
static

Definition at line 110 of file af_lv2.c.

Referenced by config_output().

◆ uri_table_destroy()

static void uri_table_destroy ( URITable table)
static

Definition at line 116 of file af_lv2.c.

Referenced by uninit().

◆ uri_table_map()

static LV2_URID uri_table_map ( LV2_URID_Map_Handle  handle,
const char *  uri 
)
static

Definition at line 127 of file af_lv2.c.

Referenced by config_output(), and connect_ports().

◆ uri_table_unmap()

static const char* uri_table_unmap ( LV2_URID_Map_Handle  handle,
LV2_URID  urid 
)
static

Definition at line 157 of file af_lv2.c.

Referenced by config_output().

◆ connect_ports()

static void connect_ports ( LV2Context s,
AVFrame in,
AVFrame out 
)
static

Definition at line 168 of file af_lv2.c.

Referenced by filter_frame(), and request_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 201 of file af_lv2.c.

Referenced by init().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 229 of file af_lv2.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 264 of file af_lv2.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 390 of file af_lv2.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 477 of file af_lv2.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 554 of file af_lv2.c.

Variable Documentation

◆ lv2_options

const AVOption lv2_options[]
static
Initial value:
= {
{ "plugin", "set plugin uri", OFFSET(plugin_uri), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "p", "set plugin uri", OFFSET(plugin_uri), 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 }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_lv2.c:91
int64_t duration
Definition: movenc.c:63
#define FLAGS
Definition: af_lv2.c:92
sample_rate
const OptionDef options[]
Definition: ffmpeg_opt.c:3292

Definition at line 94 of file af_lv2.c.

◆ buf_size_features

const LV2_Feature buf_size_features[3]
static
Initial value:
= {
{ LV2_BUF_SIZE__powerOf2BlockLength, NULL },
{ LV2_BUF_SIZE__fixedBlockLength, NULL },
{ LV2_BUF_SIZE__boundedBlockLength, NULL },
}
#define NULL
Definition: coverity.c:32

Definition at line 258 of file af_lv2.c.

Referenced by config_output().

◆ lv2_outputs

const AVFilterPad lv2_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: af_lv2.c:229
static int config_output(AVFilterLink *outlink)
Definition: af_lv2.c:264

Definition at line 581 of file af_lv2.c.

◆ ff_af_lv2

AVFilter ff_af_lv2
Initial value:
= {
.name = "lv2",
.description = NULL_IF_CONFIG_SMALL("Apply LV2 effect."),
.priv_size = sizeof(LV2Context),
.priv_class = &lv2_class,
.init = init,
.inputs = 0,
}
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:105
static int query_formats(AVFilterContext *ctx)
Definition: af_lv2.c:477
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_lv2.c:554
static const AVFilterPad lv2_outputs[]
Definition: af_lv2.c:581
static int flags
Definition: log.c:55
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold int init(AVFilterContext *ctx)
Definition: af_lv2.c:390

Definition at line 591 of file af_lv2.c.