Showing the changes to libavfilter (1 of 2 files). Show all
Unified · Split
| @@ -538,6 +538,26 @@ static int query_formats(AVFilterContext *ctx) · 537 unmodified lines | |||
| 538 | return 0; | 538 | return 0; |
| 539 | } | 539 | } |
| 540 | 540 | ||
| 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 | |||
| 541 | static av_cold void uninit(AVFilterContext *ctx) | 561 | static 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), |