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/mem.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.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 int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
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 92 of file af_lv2.c.

◆ FLAGS

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

Referenced by config_output().

◆ uri_table_destroy()

static void uri_table_destroy ( URITable table)
static

Definition at line 117 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 128 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 158 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 169 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 202 of file af_lv2.c.

Referenced by init().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 230 of file af_lv2.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 265 of file af_lv2.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 392 of file af_lv2.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 477 of file af_lv2.c.

◆ process_command()

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

Definition at line 544 of file af_lv2.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 564 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 95 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 259 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 588 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 597 of file af_lv2.c.

process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_lv2.c:544
lv2_outputs
static const AVFilterPad lv2_outputs[]
Definition: af_lv2.c:588
OFFSET
#define OFFSET(x)
Definition: af_lv2.c:92
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:159
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:249
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_lv2.c:392
sample_rate
sample_rate
Definition: ffmpeg_filter.c:424
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:65
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FLAGS
#define FLAGS
Definition: af_lv2.c:93
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_lv2.c:564
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:94
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: af_lv2.c:230
LV2Context
Definition: af_lv2.c:45
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_lv2.c:265
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239