History

avfilter/af_lv2: add commands support

Paul B Mahol committed 4 years ago

Commit 5cd8eb21 parent 34715fe2 files · +25 −0Browse files

Unified · Split

2 files
  1. doc/filters.texi +4 −0
  2. libavfilter/af_lv2.c +21 −0
doc/filters.texi+4−0
@@ -5433,6 +5433,10 @@ lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3 · 5432 unmodified lines
5433@end example5433@end example
5434@end itemize5434@end itemize
5435 5435
5436@subsection Commands
5437
5438This filter supports all options that are exported by plugin as commands.
5439
5436@section mcompand5440@section mcompand
5437Multiband Compress or expand the audio's dynamic range.5441Multiband Compress or expand the audio's dynamic range.
5438 5442
libavfilter/af_lv2.c+21−0
@@ -538,6 +538,26 @@ static int query_formats(AVFilterContext *ctx) · 537 unmodified lines
538 return 0;538 return 0;
539}539}
540 540
541static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
542 char *res, int res_len, int flags)
543{
544 LV2Context *s = ctx->priv;
545 const LilvPort *port;
546 LilvNode *sym;
547 int index;
548
549 sym = lilv_new_string(s->world, cmd);
550 port = lilv_plugin_get_port_by_symbol(s->plugin, sym);
551 lilv_node_free(sym);
552 if (!port) {
553 av_log(s, AV_LOG_WARNING, "Unknown option: <%s>\n", cmd);
554 } else {
555 index = lilv_port_get_index(s->plugin, port);
556 s->controls[index] = atof(args);
557 }
558 return 0;
559}
560
541static av_cold void uninit(AVFilterContext *ctx)561static av_cold void uninit(AVFilterContext *ctx)
542{562{
543 LV2Context *s = ctx->priv;563 LV2Context *s = ctx->priv;
@@ -578,6 +598,7 @@ const AVFilter ff_af_lv2 = { · 34 unmodified lines
578 .priv_class = &lv2_class,598 .priv_class = &lv2_class,
579 .init = init,599 .init = init,
580 .uninit = uninit,600 .uninit = uninit,
601 .process_command = process_command,
581 .inputs = 0,602 .inputs = 0,
582 FILTER_OUTPUTS(lv2_outputs),603 FILTER_OUTPUTS(lv2_outputs),
583 FILTER_QUERY_FUNC(query_formats),604 FILTER_QUERY_FUNC(query_formats),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t