You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avfilter/af_lv2: add commands support
This commit is contained in:
@@ -5433,6 +5433,10 @@ lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
|
|||||||
@end example
|
@end example
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
|
@subsection Commands
|
||||||
|
|
||||||
|
This filter supports all options that are exported by plugin as commands.
|
||||||
|
|
||||||
@section mcompand
|
@section mcompand
|
||||||
Multiband Compress or expand the audio's dynamic range.
|
Multiband Compress or expand the audio's dynamic range.
|
||||||
|
|
||||||
|
@@ -538,6 +538,26 @@ static int query_formats(AVFilterContext *ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
|
||||||
|
char *res, int res_len, int flags)
|
||||||
|
{
|
||||||
|
LV2Context *s = ctx->priv;
|
||||||
|
const LilvPort *port;
|
||||||
|
LilvNode *sym;
|
||||||
|
int index;
|
||||||
|
|
||||||
|
sym = lilv_new_string(s->world, cmd);
|
||||||
|
port = lilv_plugin_get_port_by_symbol(s->plugin, sym);
|
||||||
|
lilv_node_free(sym);
|
||||||
|
if (!port) {
|
||||||
|
av_log(s, AV_LOG_WARNING, "Unknown option: <%s>\n", cmd);
|
||||||
|
} else {
|
||||||
|
index = lilv_port_get_index(s->plugin, port);
|
||||||
|
s->controls[index] = atof(args);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static av_cold void uninit(AVFilterContext *ctx)
|
static av_cold void uninit(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
LV2Context *s = ctx->priv;
|
LV2Context *s = ctx->priv;
|
||||||
@@ -578,6 +598,7 @@ const AVFilter ff_af_lv2 = {
|
|||||||
.priv_class = &lv2_class,
|
.priv_class = &lv2_class,
|
||||||
.init = init,
|
.init = init,
|
||||||
.uninit = uninit,
|
.uninit = uninit,
|
||||||
|
.process_command = process_command,
|
||||||
.inputs = 0,
|
.inputs = 0,
|
||||||
FILTER_OUTPUTS(lv2_outputs),
|
FILTER_OUTPUTS(lv2_outputs),
|
||||||
FILTER_QUERY_FUNC(query_formats),
|
FILTER_QUERY_FUNC(query_formats),
|
||||||
|
Reference in New Issue
Block a user