History

avfilter/af_lv2: add commands support

Paul B Mahol committed 4 years ago

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

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/af_lv2.c+21−0
@@ -538,6 +538,26 @@ static int query_formats(AVFilterContext *ctx) · 537 unmodified lines
538538 return 0;
539539 }
540540
541+static 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+
541561 static av_cold void uninit(AVFilterContext *ctx)
542562 {
543563 LV2Context *s = ctx->priv;
@@ -578,6 +598,7 @@ const AVFilter ff_af_lv2 = { · 34 unmodified lines
578598 .priv_class = &lv2_class,
579599 .init = init,
580600 .uninit = uninit,
601+ .process_command = process_command,
581602 .inputs = 0,
582603 FILTER_OUTPUTS(lv2_outputs),
583604 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