summaryrefslogtreecommitdiff
path: root/src/filter
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-24 16:31:52 +0100
committerMax Kellermann <max@duempel.org>2014-01-24 16:43:57 +0100
commit7c52a1c04bccac68f4220c8bf3d3a59c16ed58db (patch)
tree6c1f8b99225343974584817b3278958599e2e12a /src/filter
parent9d34fc394ce30a28ec0e43f2ad7172b8de8b3be6 (diff)
Filter*: move to filter/
Diffstat (limited to 'src/filter')
-rw-r--r--src/filter/FilterConfig.cxx108
-rw-r--r--src/filter/FilterConfig.hxx43
-rw-r--r--src/filter/FilterInternal.hxx74
-rw-r--r--src/filter/FilterPlugin.cxx58
-rw-r--r--src/filter/FilterPlugin.hxx67
-rw-r--r--src/filter/FilterRegistry.cxx43
-rw-r--r--src/filter/FilterRegistry.hxx43
-rw-r--r--src/filter/plugins/AutoConvertFilterPlugin.cxx (renamed from src/filter/AutoConvertFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/AutoConvertFilterPlugin.hxx (renamed from src/filter/AutoConvertFilterPlugin.hxx)0
-rw-r--r--src/filter/plugins/ChainFilterPlugin.cxx (renamed from src/filter/ChainFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/ChainFilterPlugin.hxx (renamed from src/filter/ChainFilterPlugin.hxx)0
-rw-r--r--src/filter/plugins/ConvertFilterPlugin.cxx (renamed from src/filter/ConvertFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/ConvertFilterPlugin.hxx (renamed from src/filter/ConvertFilterPlugin.hxx)0
-rw-r--r--src/filter/plugins/NormalizeFilterPlugin.cxx (renamed from src/filter/NormalizeFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/NullFilterPlugin.cxx (renamed from src/filter/NullFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/ReplayGainFilterPlugin.cxx (renamed from src/filter/ReplayGainFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/ReplayGainFilterPlugin.hxx (renamed from src/filter/ReplayGainFilterPlugin.hxx)0
-rw-r--r--src/filter/plugins/RouteFilterPlugin.cxx (renamed from src/filter/RouteFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/VolumeFilterPlugin.cxx (renamed from src/filter/VolumeFilterPlugin.cxx)6
-rw-r--r--src/filter/plugins/VolumeFilterPlugin.hxx (renamed from src/filter/VolumeFilterPlugin.hxx)0
20 files changed, 460 insertions, 24 deletions
diff --git a/src/filter/FilterConfig.cxx b/src/filter/FilterConfig.cxx
new file mode 100644
index 000000000..5f2c3a95b
--- /dev/null
+++ b/src/filter/FilterConfig.cxx
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "FilterConfig.hxx"
+#include "plugins/ChainFilterPlugin.hxx"
+#include "FilterPlugin.hxx"
+#include "config/ConfigData.hxx"
+#include "config/ConfigOption.hxx"
+#include "config/ConfigGlobal.hxx"
+#include "config/ConfigError.hxx"
+#include "util/Error.hxx"
+
+#include <algorithm>
+
+#include <string.h>
+
+/**
+ * Find the "filter" configuration block for the specified name.
+ *
+ * @param filter_template_name the name of the filter template
+ * @param error space to return an error description
+ * @return the configuration block, or nullptr if none was configured
+ */
+static const struct config_param *
+filter_plugin_config(const char *filter_template_name, Error &error)
+{
+ const struct config_param *param = nullptr;
+
+ while ((param = config_get_next_param(CONF_AUDIO_FILTER, param)) != nullptr) {
+ const char *name = param->GetBlockValue("name");
+ if (name == nullptr) {
+ error.Format(config_domain,
+ "filter configuration without 'name' name in line %d",
+ param->line);
+ return nullptr;
+ }
+
+ if (strcmp(name, filter_template_name) == 0)
+ return param;
+ }
+
+ error.Format(config_domain,
+ "filter template not found: %s",
+ filter_template_name);
+ return nullptr;
+}
+
+static bool
+filter_chain_append_new(Filter &chain, const char *template_name, Error &error)
+{
+ const struct config_param *cfg =
+ filter_plugin_config(template_name, error);
+ if (cfg == nullptr)
+ // The error has already been set, just stop.
+ return false;
+
+ // Instantiate one of those filter plugins with the template name as a hint
+ Filter *f = filter_configured_new(*cfg, error);
+ if (f == nullptr)
+ // The error has already been set, just stop.
+ return false;
+
+ const char *plugin_name = cfg->GetBlockValue("plugin",
+ "unknown");
+ filter_chain_append(chain, plugin_name, f);
+
+ return true;
+}
+
+bool
+filter_chain_parse(Filter &chain, const char *spec, Error &error)
+{
+ const char *const end = spec + strlen(spec);
+
+ while (true) {
+ const char *comma = std::find(spec, end, ',');
+ if (comma > spec) {
+ const std::string name(spec, comma);
+ if (!filter_chain_append_new(chain, name.c_str(),
+ error))
+ return false;
+ }
+
+ if (comma == end)
+ break;
+
+ spec = comma + 1;
+ }
+
+ return true;
+}
diff --git a/src/filter/FilterConfig.hxx b/src/filter/FilterConfig.hxx
new file mode 100644
index 000000000..1018eed51
--- /dev/null
+++ b/src/filter/FilterConfig.hxx
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/** \file
+ *
+ * Utility functions for filter configuration
+ */
+
+#ifndef MPD_FILTER_CONFIG_HXX
+#define MPD_FILTER_CONFIG_HXX
+
+class Filter;
+class Error;
+
+/**
+ * Builds a filter chain from a configuration string on the form
+ * "name1, name2, name3, ..." by looking up each name among the
+ * configured filter sections.
+ * @param chain the chain to append filters on
+ * @param spec the filter chain specification
+ * @param error_r space to return an error description
+ * @return true on success
+ */
+bool
+filter_chain_parse(Filter &chain, const char *spec, Error &error);
+
+#endif
diff --git a/src/filter/FilterInternal.hxx b/src/filter/FilterInternal.hxx
new file mode 100644
index 000000000..131c3b3f5
--- /dev/null
+++ b/src/filter/FilterInternal.hxx
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/** \file
+ *
+ * Internal stuff for the filter core and filter plugins.
+ */
+
+#ifndef MPD_FILTER_INTERNAL_HXX
+#define MPD_FILTER_INTERNAL_HXX
+
+#include <stddef.h>
+
+struct AudioFormat;
+class Error;
+
+class Filter {
+public:
+ virtual ~Filter() {}
+
+ /**
+ * Opens the filter, preparing it for FilterPCM().
+ *
+ * @param filter the filter object
+ * @param audio_format the audio format of incoming data; the
+ * plugin may modify the object to enforce another input
+ * format
+ * @param error location to store the error occurring, or nullptr
+ * to ignore errors.
+ * @return the format of outgoing data or
+ * AudioFormat::Undefined() on error
+ */
+ virtual AudioFormat Open(AudioFormat &af, Error &error) = 0;
+
+ /**
+ * Closes the filter. After that, you may call Open() again.
+ */
+ virtual void Close() = 0;
+
+ /**
+ * Filters a block of PCM data.
+ *
+ * @param filter the filter object
+ * @param src the input buffer
+ * @param src_size the size of #src_buffer in bytes
+ * @param dest_size_r the size of the returned buffer
+ * @param error location to store the error occurring, or nullptr
+ * to ignore errors.
+ * @return the destination buffer on success (will be
+ * invalidated by filter_close() or filter_filter()), nullptr on
+ * error
+ */
+ virtual const void *FilterPCM(const void *src, size_t src_size,
+ size_t *dest_size_r,
+ Error &error) = 0;
+};
+
+#endif
diff --git a/src/filter/FilterPlugin.cxx b/src/filter/FilterPlugin.cxx
new file mode 100644
index 000000000..98314f771
--- /dev/null
+++ b/src/filter/FilterPlugin.cxx
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "FilterPlugin.hxx"
+#include "FilterRegistry.hxx"
+#include "config/ConfigData.hxx"
+#include "config/ConfigError.hxx"
+#include "util/Error.hxx"
+
+#include <assert.h>
+
+Filter *
+filter_new(const struct filter_plugin *plugin,
+ const config_param &param, Error &error)
+{
+ assert(plugin != nullptr);
+ assert(!error.IsDefined());
+
+ return plugin->init(param, error);
+}
+
+Filter *
+filter_configured_new(const config_param &param, Error &error)
+{
+ assert(!error.IsDefined());
+
+ const char *plugin_name = param.GetBlockValue("plugin");
+ if (plugin_name == nullptr) {
+ error.Set(config_domain, "No filter plugin specified");
+ return nullptr;
+ }
+
+ const filter_plugin *plugin = filter_plugin_by_name(plugin_name);
+ if (plugin == nullptr) {
+ error.Format(config_domain,
+ "No such filter plugin: %s", plugin_name);
+ return nullptr;
+ }
+
+ return filter_new(plugin, param, error);
+}
diff --git a/src/filter/FilterPlugin.hxx b/src/filter/FilterPlugin.hxx
new file mode 100644
index 000000000..443d29881
--- /dev/null
+++ b/src/filter/FilterPlugin.hxx
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/** \file
+ *
+ * This header declares the filter_plugin class. It describes a
+ * plugin API for objects which filter raw PCM data.
+ */
+
+#ifndef MPD_FILTER_PLUGIN_HXX
+#define MPD_FILTER_PLUGIN_HXX
+
+struct config_param;
+class Filter;
+class Error;
+
+struct filter_plugin {
+ const char *name;
+
+ /**
+ * Allocates and configures a filter.
+ */
+ Filter *(*init)(const config_param &param, Error &error);
+};
+
+/**
+ * Creates a new instance of the specified filter plugin.
+ *
+ * @param plugin the filter plugin
+ * @param param optional configuration section
+ * @param error location to store the error occurring, or nullptr to
+ * ignore errors.
+ * @return a new filter object, or nullptr on error
+ */
+Filter *
+filter_new(const struct filter_plugin *plugin,
+ const config_param &param, Error &error);
+
+/**
+ * Creates a new filter, loads configuration and the plugin name from
+ * the specified configuration section.
+ *
+ * @param param the configuration section
+ * @param error location to store the error occurring, or nullptr to
+ * ignore errors.
+ * @return a new filter object, or nullptr on error
+ */
+Filter *
+filter_configured_new(const config_param &param, Error &error);
+
+#endif
diff --git a/src/filter/FilterRegistry.cxx b/src/filter/FilterRegistry.cxx
new file mode 100644
index 000000000..286fb8db3
--- /dev/null
+++ b/src/filter/FilterRegistry.cxx
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "FilterRegistry.hxx"
+#include "FilterPlugin.hxx"
+
+#include <string.h>
+
+const struct filter_plugin *const filter_plugins[] = {
+ &null_filter_plugin,
+ &route_filter_plugin,
+ &normalize_filter_plugin,
+ &volume_filter_plugin,
+ &replay_gain_filter_plugin,
+ nullptr,
+};
+
+const struct filter_plugin *
+filter_plugin_by_name(const char *name)
+{
+ for (unsigned i = 0; filter_plugins[i] != nullptr; ++i)
+ if (strcmp(filter_plugins[i]->name, name) == 0)
+ return filter_plugins[i];
+
+ return nullptr;
+}
diff --git a/src/filter/FilterRegistry.hxx b/src/filter/FilterRegistry.hxx
new file mode 100644
index 000000000..24618a87a
--- /dev/null
+++ b/src/filter/FilterRegistry.hxx
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/** \file
+ *
+ * This library manages all filter plugins which are enabled at
+ * compile time.
+ */
+
+#ifndef MPD_FILTER_REGISTRY_HXX
+#define MPD_FILTER_REGISTRY_HXX
+
+#include "Compiler.h"
+
+extern const struct filter_plugin null_filter_plugin;
+extern const struct filter_plugin chain_filter_plugin;
+extern const struct filter_plugin convert_filter_plugin;
+extern const struct filter_plugin route_filter_plugin;
+extern const struct filter_plugin normalize_filter_plugin;
+extern const struct filter_plugin volume_filter_plugin;
+extern const struct filter_plugin replay_gain_filter_plugin;
+
+gcc_pure
+const struct filter_plugin *
+filter_plugin_by_name(const char *name);
+
+#endif
diff --git a/src/filter/AutoConvertFilterPlugin.cxx b/src/filter/plugins/AutoConvertFilterPlugin.cxx
index b9bc12f31..cdeeefdc6 100644
--- a/src/filter/AutoConvertFilterPlugin.cxx
+++ b/src/filter/plugins/AutoConvertFilterPlugin.cxx
@@ -20,9 +20,9 @@
#include "config.h"
#include "AutoConvertFilterPlugin.hxx"
#include "ConvertFilterPlugin.hxx"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "AudioFormat.hxx"
#include "config/ConfigData.hxx"
diff --git a/src/filter/AutoConvertFilterPlugin.hxx b/src/filter/plugins/AutoConvertFilterPlugin.hxx
index c5dfdd2f6..c5dfdd2f6 100644
--- a/src/filter/AutoConvertFilterPlugin.hxx
+++ b/src/filter/plugins/AutoConvertFilterPlugin.hxx
diff --git a/src/filter/ChainFilterPlugin.cxx b/src/filter/plugins/ChainFilterPlugin.cxx
index 528661163..7dc6db667 100644
--- a/src/filter/ChainFilterPlugin.cxx
+++ b/src/filter/plugins/ChainFilterPlugin.cxx
@@ -19,9 +19,9 @@
#include "config.h"
#include "ChainFilterPlugin.hxx"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "AudioFormat.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
diff --git a/src/filter/ChainFilterPlugin.hxx b/src/filter/plugins/ChainFilterPlugin.hxx
index b36aa3322..b36aa3322 100644
--- a/src/filter/ChainFilterPlugin.hxx
+++ b/src/filter/plugins/ChainFilterPlugin.hxx
diff --git a/src/filter/ConvertFilterPlugin.cxx b/src/filter/plugins/ConvertFilterPlugin.cxx
index 2004fe303..27e6774f8 100644
--- a/src/filter/ConvertFilterPlugin.cxx
+++ b/src/filter/plugins/ConvertFilterPlugin.cxx
@@ -19,9 +19,9 @@
#include "config.h"
#include "ConvertFilterPlugin.hxx"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "pcm/PcmConvert.hxx"
#include "util/Manual.hxx"
#include "AudioFormat.hxx"
diff --git a/src/filter/ConvertFilterPlugin.hxx b/src/filter/plugins/ConvertFilterPlugin.hxx
index bb4673651..bb4673651 100644
--- a/src/filter/ConvertFilterPlugin.hxx
+++ b/src/filter/plugins/ConvertFilterPlugin.hxx
diff --git a/src/filter/NormalizeFilterPlugin.cxx b/src/filter/plugins/NormalizeFilterPlugin.cxx
index fa3a18aec..58eb0c6a2 100644
--- a/src/filter/NormalizeFilterPlugin.cxx
+++ b/src/filter/plugins/NormalizeFilterPlugin.cxx
@@ -18,9 +18,9 @@
*/
#include "config.h"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "pcm/PcmBuffer.hxx"
#include "AudioFormat.hxx"
#include "AudioCompress/compress.h"
diff --git a/src/filter/NullFilterPlugin.cxx b/src/filter/plugins/NullFilterPlugin.cxx
index 971598920..f79aa19f7 100644
--- a/src/filter/NullFilterPlugin.cxx
+++ b/src/filter/plugins/NullFilterPlugin.cxx
@@ -25,9 +25,9 @@
*/
#include "config.h"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "AudioFormat.hxx"
#include "Compiler.h"
diff --git a/src/filter/ReplayGainFilterPlugin.cxx b/src/filter/plugins/ReplayGainFilterPlugin.cxx
index 0b96b1d6d..d89e79480 100644
--- a/src/filter/ReplayGainFilterPlugin.cxx
+++ b/src/filter/plugins/ReplayGainFilterPlugin.cxx
@@ -19,9 +19,9 @@
#include "config.h"
#include "ReplayGainFilterPlugin.hxx"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "AudioFormat.hxx"
#include "ReplayGainInfo.hxx"
#include "ReplayGainConfig.hxx"
diff --git a/src/filter/ReplayGainFilterPlugin.hxx b/src/filter/plugins/ReplayGainFilterPlugin.hxx
index 346541b97..346541b97 100644
--- a/src/filter/ReplayGainFilterPlugin.hxx
+++ b/src/filter/plugins/ReplayGainFilterPlugin.hxx
diff --git a/src/filter/RouteFilterPlugin.cxx b/src/filter/plugins/RouteFilterPlugin.cxx
index 50073778a..38c4ec43b 100644
--- a/src/filter/RouteFilterPlugin.cxx
+++ b/src/filter/plugins/RouteFilterPlugin.cxx
@@ -43,9 +43,9 @@
#include "config/ConfigError.hxx"
#include "config/ConfigData.hxx"
#include "AudioFormat.hxx"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "pcm/PcmBuffer.hxx"
#include "util/StringUtil.hxx"
#include "util/Error.hxx"
diff --git a/src/filter/VolumeFilterPlugin.cxx b/src/filter/plugins/VolumeFilterPlugin.cxx
index 8d3de3eb9..c9b7aa89e 100644
--- a/src/filter/VolumeFilterPlugin.cxx
+++ b/src/filter/plugins/VolumeFilterPlugin.cxx
@@ -19,9 +19,9 @@
#include "config.h"
#include "VolumeFilterPlugin.hxx"
-#include "FilterPlugin.hxx"
-#include "FilterInternal.hxx"
-#include "FilterRegistry.hxx"
+#include "filter/FilterPlugin.hxx"
+#include "filter/FilterInternal.hxx"
+#include "filter/FilterRegistry.hxx"
#include "pcm/Volume.hxx"
#include "AudioFormat.hxx"
#include "util/ConstBuffer.hxx"
diff --git a/src/filter/VolumeFilterPlugin.hxx b/src/filter/plugins/VolumeFilterPlugin.hxx
index b5317dc6f..b5317dc6f 100644
--- a/src/filter/VolumeFilterPlugin.hxx
+++ b/src/filter/plugins/VolumeFilterPlugin.hxx