diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-03-10 11:52:18 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-03-10 12:08:47 +0100 |
commit | 5cd8eb2aef0c88e18030756ba91ed3c77f045369 (patch) | |
tree | 9874d9fef88ecf0fff0fe39faaffe525cb5df862 /libavfilter/af_lv2.c | |
parent | 34715fe4a2df70a9b6010df10e97330bb347fc57 (diff) | |
download | ffmpeg-5cd8eb2aef0c88e18030756ba91ed3c77f045369.tar.gz |
avfilter/af_lv2: add commands support
Diffstat (limited to 'libavfilter/af_lv2.c')
-rw-r--r-- | libavfilter/af_lv2.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libavfilter/af_lv2.c b/libavfilter/af_lv2.c index 0f0c797989..0c23adeb15 100644 --- a/libavfilter/af_lv2.c +++ b/libavfilter/af_lv2.c @@ -538,6 +538,26 @@ static int query_formats(AVFilterContext *ctx) 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) { LV2Context *s = ctx->priv; @@ -578,6 +598,7 @@ const AVFilter ff_af_lv2 = { .priv_class = &lv2_class, .init = init, .uninit = uninit, + .process_command = process_command, .inputs = 0, FILTER_OUTPUTS(lv2_outputs), FILTER_QUERY_FUNC(query_formats), |