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/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 }
}

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

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

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

Definition at line 591 of file af_lv2.c.

lv2_outputs
static const AVFilterPad lv2_outputs[]
Definition: af_lv2.c:581
OFFSET
#define OFFSET(x)
Definition: af_lv2.c:91
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:239
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_lv2.c:390
sample_rate
sample_rate
Definition: ffmpeg_filter.c:170
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:106
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_lv2.c:477
duration
int64_t duration
Definition: movenc.c:64
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
FLAGS
#define FLAGS
Definition: af_lv2.c:92
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_lv2.c:554
NULL
#define NULL
Definition: coverity.c:32
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
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:229
LV2Context
Definition: af_lv2.c:44
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_lv2.c:264
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229