FFmpeg
Data Structures | Macros | Functions | Variables
af_lv2.c File Reference
#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/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 []
 
const 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 90 of file af_lv2.c.

◆ FLAGS

Definition at line 91 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 109 of file af_lv2.c.

Referenced by config_output().

◆ uri_table_destroy()

static void uri_table_destroy ( URITable table)
static

Definition at line 115 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 126 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 156 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 167 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 200 of file af_lv2.c.

Referenced by init().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 228 of file af_lv2.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 263 of file af_lv2.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 389 of file af_lv2.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 474 of file af_lv2.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 541 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 }
}

Definition at line 93 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 },
}

Definition at line 257 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,
},
}

Definition at line 565 of file af_lv2.c.

◆ ff_af_lv2

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

Definition at line 574 of file af_lv2.c.

lv2_outputs
static const AVFilterPad lv2_outputs[]
Definition: af_lv2.c:565
OFFSET
#define OFFSET(x)
Definition: af_lv2.c:90
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:168
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:238
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_lv2.c:389
sample_rate
sample_rate
Definition: ffmpeg_filter.c:156
AVFILTER_FLAG_DYNAMIC_INPUTS
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:110
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_lv2.c:474
inputs
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: filter_design.txt:243
duration
int64_t duration
Definition: movenc.c:64
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FLAGS
#define FLAGS
Definition: af_lv2.c:91
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_lv2.c:541
NULL
#define NULL
Definition: coverity.c:32
options
const OptionDef options[]
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:117
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: af_lv2.c:228
LV2Context
Definition: af_lv2.c:43
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_lv2.c:263
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228