From 44c6ec146e1f03281c2654aed089013ba0f37466 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 10 Aug 2021 23:50:24 +0200 Subject: [PATCH] filter-chain: parse config options Remove LADSPA dependencies, only use it in ladspa_plugin.c Parse convolver config, like filename --- spa/include/spa/utils/json.h | 2 + src/daemon/filter-chain/sink-convolver.conf | 4 + src/modules/module-filter-chain.c | 101 +++++++++++++----- .../module-filter-chain/builtin_plugin.c | 79 +++++++++----- src/modules/module-filter-chain/convolver.c | 7 -- .../module-filter-chain/ladspa_plugin.c | 2 +- src/modules/module-filter-chain/plugin.h | 12 ++- 7 files changed, 147 insertions(+), 60 deletions(-) diff --git a/spa/include/spa/utils/json.h b/spa/include/spa/utils/json.h index b3e69eaa7..671918d6f 100644 --- a/spa/include/spa/utils/json.h +++ b/spa/include/spa/utils/json.h @@ -67,6 +67,8 @@ static inline void spa_json_enter(struct spa_json * iter, struct spa_json * sub) *sub = SPA_JSON_ENTER(iter); } +#define SPA_JSON_SAVE(iter) (struct spa_json) { (iter)->cur, (iter)->end, } + /** Get the next token. \a value points to the token and the return value * is the length. */ static inline int spa_json_next(struct spa_json * iter, const char **value) diff --git a/src/daemon/filter-chain/sink-convolver.conf b/src/daemon/filter-chain/sink-convolver.conf index 7c7c5865f..aa84b9801 100644 --- a/src/daemon/filter-chain/sink-convolver.conf +++ b/src/daemon/filter-chain/sink-convolver.conf @@ -36,6 +36,10 @@ context.modules = [ type = builtin name = convolver label = convolver + config = { + filename = "src/modules/module-filter-chain/street2-L.wav" + blocksize = 512 + } } ] } diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index c9601e297..bce541aac 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -69,6 +69,9 @@ static const struct spa_dict_item module_props[] = { " name = " " plugin = " " label =