filter: convert to C++
This commit is contained in:
parent
ec07f6ec83
commit
3894450b10
23
Makefile.am
23
Makefile.am
@ -57,9 +57,6 @@ mpd_headers = \
|
||||
src/output_internal.h \
|
||||
src/output_api.h \
|
||||
src/filter_internal.h \
|
||||
src/filter_plugin.h \
|
||||
src/filter_registry.h \
|
||||
src/filter/chain_filter_plugin.h \
|
||||
src/command.h \
|
||||
src/conf.h \
|
||||
src/decoder_plugin.h \
|
||||
@ -168,8 +165,8 @@ src_mpd_SOURCES = \
|
||||
src/ExcludeList.cxx src/ExcludeList.hxx \
|
||||
src/fd_util.c \
|
||||
src/FilterConfig.cxx src/FilterConfig.hxx \
|
||||
src/filter_plugin.c \
|
||||
src/filter_registry.c \
|
||||
src/FilterPlugin.cxx src/FilterPlugin.hxx \
|
||||
src/FilterRegistry.cxx src/FilterRegistry.hxx \
|
||||
src/UpdateGlue.cxx src/UpdateGlue.hxx \
|
||||
src/UpdateQueue.cxx src/UpdateQueue.hxx \
|
||||
src/UpdateIO.cxx src/UpdateIO.hxx \
|
||||
@ -968,14 +965,15 @@ endif
|
||||
#
|
||||
|
||||
libfilter_plugins_a_SOURCES = \
|
||||
src/filter/null_filter_plugin.c \
|
||||
src/filter/chain_filter_plugin.c \
|
||||
src/filter/NullFilterPlugin.cxx \
|
||||
src/filter/ChainFilterPlugin.cxx \
|
||||
src/filter/ChainFilterPlugin.hxx \
|
||||
src/filter/AutoConvertFilterPlugin.cxx \
|
||||
src/filter/AutoConvertFilterPlugin.hxx \
|
||||
src/filter/ConvertFilterPlugin.cxx \
|
||||
src/filter/ConvertFilterPlugin.hxx \
|
||||
src/filter/route_filter_plugin.c \
|
||||
src/filter/normalize_filter_plugin.c \
|
||||
src/filter/RouteFilterPlugin.cxx \
|
||||
src/filter/NormalizeFilterPlugin.cxx \
|
||||
src/filter/ReplayGainFilterPlugin.cxx \
|
||||
src/filter/ReplayGainFilterPlugin.hxx \
|
||||
src/filter/VolumeFilterPlugin.cxx \
|
||||
@ -1239,8 +1237,7 @@ test_run_filter_LDADD = \
|
||||
test_run_filter_SOURCES = test/run_filter.cxx \
|
||||
test/FakeReplayGainConfig.cxx \
|
||||
test/stdbin.h \
|
||||
src/filter_plugin.c \
|
||||
src/filter_registry.c \
|
||||
src/FilterPlugin.cxx src/FilterRegistry.cxx \
|
||||
src/tokenizer.c src/utils.c src/string_util.c \
|
||||
src/audio_check.c \
|
||||
src/audio_format.c \
|
||||
@ -1350,7 +1347,7 @@ test_run_output_SOURCES = test/run_output.cxx \
|
||||
src/mixer_api.c \
|
||||
src/mixer_control.c \
|
||||
src/mixer_type.c \
|
||||
src/filter_plugin.c \
|
||||
src/FilterPlugin.cxx \
|
||||
src/FilterConfig.cxx \
|
||||
src/AudioCompress/compress.c \
|
||||
src/ReplayGainInfo.cxx \
|
||||
@ -1367,7 +1364,7 @@ test_read_mixer_LDADD = \
|
||||
test_read_mixer_SOURCES = test/read_mixer.cxx \
|
||||
src/tokenizer.c src/utils.c src/string_util.c \
|
||||
src/mixer_control.c src/mixer_api.c \
|
||||
src/filter_plugin.c \
|
||||
src/FilterPlugin.cxx \
|
||||
src/filter/VolumeFilterPlugin.cxx \
|
||||
src/fd_util.c
|
||||
|
||||
|
@ -20,14 +20,10 @@
|
||||
#include "config.h"
|
||||
#include "FilterConfig.hxx"
|
||||
#include "conf.h"
|
||||
|
||||
extern "C" {
|
||||
#include "filter/chain_filter_plugin.h"
|
||||
}
|
||||
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "filter/ChainFilterPlugin.hxx"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -22,8 +22,8 @@
|
||||
* Internal stuff for the filter core and filter plugins.
|
||||
*/
|
||||
|
||||
#ifndef MPD_FILTER_INTERNAL_H
|
||||
#define MPD_FILTER_INTERNAL_H
|
||||
#ifndef MPD_FILTER_INTERNAL_HXX
|
||||
#define MPD_FILTER_INTERNAL_HXX
|
||||
|
||||
struct filter {
|
||||
const struct filter_plugin *plugin;
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "conf.h"
|
||||
#include "ConfigQuark.hxx"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -23,12 +23,11 @@
|
||||
* plugin API for objects which filter raw PCM data.
|
||||
*/
|
||||
|
||||
#ifndef MPD_FILTER_PLUGIN_H
|
||||
#define MPD_FILTER_PLUGIN_H
|
||||
#ifndef MPD_FILTER_PLUGIN_HXX
|
||||
#define MPD_FILTER_PLUGIN_HXX
|
||||
|
||||
#include "gerror.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct config_param;
|
||||
@ -74,10 +73,6 @@ struct filter_plugin {
|
||||
GError **error_r);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Creates a new instance of the specified filter plugin.
|
||||
*
|
||||
@ -151,8 +146,4 @@ filter_filter(struct filter *filter, const void *src, size_t src_size,
|
||||
size_t *dest_size_r,
|
||||
GError **error_r);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "filter_registry.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "FilterPlugin.hxx"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -23,8 +23,8 @@
|
||||
* compile time.
|
||||
*/
|
||||
|
||||
#ifndef MPD_FILTER_REGISTRY_H
|
||||
#define MPD_FILTER_REGISTRY_H
|
||||
#ifndef MPD_FILTER_REGISTRY_HXX
|
||||
#define MPD_FILTER_REGISTRY_HXX
|
||||
|
||||
extern const struct filter_plugin null_filter_plugin;
|
||||
extern const struct filter_plugin chain_filter_plugin;
|
@ -30,7 +30,7 @@ extern "C" {
|
||||
|
||||
#include "notify.hxx"
|
||||
#include "filter/ReplayGainFilterPlugin.hxx"
|
||||
#include "filter_plugin.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -23,9 +23,10 @@ extern "C" {
|
||||
#include "output_internal.h"
|
||||
#include "output_plugin.h"
|
||||
#include "mixer_control.h"
|
||||
#include "filter_plugin.h"
|
||||
}
|
||||
|
||||
#include "FilterPlugin.hxx"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
void
|
||||
|
@ -30,14 +30,14 @@ extern "C" {
|
||||
#include "mixer_control.h"
|
||||
#include "mixer_type.h"
|
||||
#include "mixer_list.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_registry.h"
|
||||
#include "filter/chain_filter_plugin.h"
|
||||
}
|
||||
|
||||
#include "mixer/SoftwareMixerPlugin.hxx"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "filter/AutoConvertFilterPlugin.hxx"
|
||||
#include "filter/ReplayGainFilterPlugin.hxx"
|
||||
#include "filter/ChainFilterPlugin.hxx"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
@ -24,10 +24,10 @@
|
||||
|
||||
extern "C" {
|
||||
#include "output_internal.h"
|
||||
#include "filter_plugin.h"
|
||||
}
|
||||
|
||||
#include "notify.hxx"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "filter/ConvertFilterPlugin.hxx"
|
||||
#include "filter/ReplayGainFilterPlugin.hxx"
|
||||
#include "PlayerControl.hxx"
|
||||
|
@ -20,9 +20,9 @@
|
||||
#include "config.h"
|
||||
#include "AutoConvertFilterPlugin.hxx"
|
||||
#include "ConvertFilterPlugin.hxx"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "audio_format.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -18,22 +18,26 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "ChainFilterPlugin.hxx"
|
||||
#include "conf.h"
|
||||
#include "filter/chain_filter_plugin.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "audio_format.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
struct filter_chain {
|
||||
struct ChainFilter {
|
||||
/** the base class */
|
||||
struct filter base;
|
||||
|
||||
GSList *children;
|
||||
|
||||
ChainFilter():children(nullptr) {
|
||||
filter_init(&base, &chain_filter_plugin);
|
||||
}
|
||||
};
|
||||
|
||||
static inline GQuark
|
||||
@ -46,10 +50,7 @@ static struct filter *
|
||||
chain_filter_init(G_GNUC_UNUSED const struct config_param *param,
|
||||
G_GNUC_UNUSED GError **error_r)
|
||||
{
|
||||
struct filter_chain *chain = g_new(struct filter_chain, 1);
|
||||
|
||||
filter_init(&chain->base, &chain_filter_plugin);
|
||||
chain->children = NULL;
|
||||
ChainFilter *chain = new ChainFilter();
|
||||
|
||||
return &chain->base;
|
||||
}
|
||||
@ -57,7 +58,7 @@ chain_filter_init(G_GNUC_UNUSED const struct config_param *param,
|
||||
static void
|
||||
chain_free_child(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
||||
{
|
||||
struct filter *filter = data;
|
||||
struct filter *filter = (struct filter *)data;
|
||||
|
||||
filter_free(filter);
|
||||
}
|
||||
@ -65,12 +66,12 @@ chain_free_child(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
||||
static void
|
||||
chain_filter_finish(struct filter *_filter)
|
||||
{
|
||||
struct filter_chain *chain = (struct filter_chain *)_filter;
|
||||
ChainFilter *chain = (ChainFilter *)_filter;
|
||||
|
||||
g_slist_foreach(chain->children, chain_free_child, NULL);
|
||||
g_slist_free(chain->children);
|
||||
|
||||
g_free(chain);
|
||||
delete chain;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,10 +79,9 @@ chain_filter_finish(struct filter *_filter)
|
||||
* itself is not closed.
|
||||
*/
|
||||
static void
|
||||
chain_close_until(struct filter_chain *chain, const struct filter *until)
|
||||
chain_close_until(ChainFilter *chain, const struct filter *until)
|
||||
{
|
||||
GSList *i = chain->children;
|
||||
struct filter *filter;
|
||||
|
||||
while (true) {
|
||||
/* this assertion fails if #until does not exist
|
||||
@ -93,7 +93,7 @@ chain_close_until(struct filter_chain *chain, const struct filter *until)
|
||||
break;
|
||||
|
||||
/* close this filter */
|
||||
filter = i->data;
|
||||
struct filter *filter = (struct filter *)i->data;
|
||||
filter_close(filter);
|
||||
|
||||
i = g_slist_next(i);
|
||||
@ -130,11 +130,11 @@ static const struct audio_format *
|
||||
chain_filter_open(struct filter *_filter, struct audio_format *in_audio_format,
|
||||
GError **error_r)
|
||||
{
|
||||
struct filter_chain *chain = (struct filter_chain *)_filter;
|
||||
ChainFilter *chain = (ChainFilter *)_filter;
|
||||
const struct audio_format *audio_format = in_audio_format;
|
||||
|
||||
for (GSList *i = chain->children; i != NULL; i = g_slist_next(i)) {
|
||||
struct filter *filter = i->data;
|
||||
struct filter *filter = (struct filter *)i->data;
|
||||
|
||||
audio_format = chain_open_child(filter, audio_format, error_r);
|
||||
if (audio_format == NULL) {
|
||||
@ -151,7 +151,7 @@ chain_filter_open(struct filter *_filter, struct audio_format *in_audio_format,
|
||||
static void
|
||||
chain_close_child(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
||||
{
|
||||
struct filter *filter = data;
|
||||
struct filter *filter = (struct filter *)data;
|
||||
|
||||
filter_close(filter);
|
||||
}
|
||||
@ -159,7 +159,7 @@ chain_close_child(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
||||
static void
|
||||
chain_filter_close(struct filter *_filter)
|
||||
{
|
||||
struct filter_chain *chain = (struct filter_chain *)_filter;
|
||||
ChainFilter *chain = (ChainFilter *)_filter;
|
||||
|
||||
g_slist_foreach(chain->children, chain_close_child, NULL);
|
||||
}
|
||||
@ -169,10 +169,10 @@ chain_filter_filter(struct filter *_filter,
|
||||
const void *src, size_t src_size,
|
||||
size_t *dest_size_r, GError **error_r)
|
||||
{
|
||||
struct filter_chain *chain = (struct filter_chain *)_filter;
|
||||
ChainFilter *chain = (ChainFilter *)_filter;
|
||||
|
||||
for (GSList *i = chain->children; i != NULL; i = g_slist_next(i)) {
|
||||
struct filter *filter = i->data;
|
||||
struct filter *filter = (struct filter *)i->data;
|
||||
|
||||
/* feed the output of the previous filter as input
|
||||
into the current one */
|
||||
@ -187,12 +187,12 @@ chain_filter_filter(struct filter *_filter,
|
||||
}
|
||||
|
||||
const struct filter_plugin chain_filter_plugin = {
|
||||
.name = "chain",
|
||||
.init = chain_filter_init,
|
||||
.finish = chain_filter_finish,
|
||||
.open = chain_filter_open,
|
||||
.close = chain_filter_close,
|
||||
.filter = chain_filter_filter,
|
||||
"chain",
|
||||
chain_filter_init,
|
||||
chain_filter_finish,
|
||||
chain_filter_open,
|
||||
chain_filter_close,
|
||||
chain_filter_filter,
|
||||
};
|
||||
|
||||
struct filter *
|
||||
@ -208,8 +208,7 @@ filter_chain_new(void)
|
||||
void
|
||||
filter_chain_append(struct filter *_chain, struct filter *filter)
|
||||
{
|
||||
struct filter_chain *chain = (struct filter_chain *)_chain;
|
||||
ChainFilter *chain = (ChainFilter *)_chain;
|
||||
|
||||
chain->children = g_slist_append(chain->children, filter);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -24,8 +24,8 @@
|
||||
* output to the next one.
|
||||
*/
|
||||
|
||||
#ifndef MPD_FILTER_CHAIN_H
|
||||
#define MPD_FILTER_CHAIN_H
|
||||
#ifndef MPD_FILTER_CHAIN_HXX
|
||||
#define MPD_FILTER_CHAIN_HXX
|
||||
|
||||
struct filter;
|
||||
|
@ -19,9 +19,9 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "ConvertFilterPlugin.hxx"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "conf.h"
|
||||
#include "PcmConvert.hxx"
|
||||
#include "util/Manual.hxx"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "pcm_buffer.h"
|
||||
#include "audio_format.h"
|
||||
#include "AudioCompress/compress.h"
|
||||
@ -90,9 +90,8 @@ normalize_filter_filter(struct filter *_filter,
|
||||
G_GNUC_UNUSED GError **error_r)
|
||||
{
|
||||
struct normalize_filter *filter = (struct normalize_filter *)_filter;
|
||||
void *dest;
|
||||
|
||||
dest = pcm_buffer_get(&filter->buffer, src_size);
|
||||
int16_t *dest = (int16_t *)pcm_buffer_get(&filter->buffer, src_size);
|
||||
|
||||
memcpy(dest, src, src_size);
|
||||
|
||||
@ -103,10 +102,10 @@ normalize_filter_filter(struct filter *_filter,
|
||||
}
|
||||
|
||||
const struct filter_plugin normalize_filter_plugin = {
|
||||
.name = "normalize",
|
||||
.init = normalize_filter_init,
|
||||
.finish = normalize_filter_finish,
|
||||
.open = normalize_filter_open,
|
||||
.close = normalize_filter_close,
|
||||
.filter = normalize_filter_filter,
|
||||
"normalize",
|
||||
normalize_filter_init,
|
||||
normalize_filter_finish,
|
||||
normalize_filter_open,
|
||||
normalize_filter_close,
|
||||
normalize_filter_filter,
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -25,9 +25,9 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
|
||||
#include <glib.h>
|
||||
#include <assert.h>
|
||||
@ -85,10 +85,10 @@ null_filter_filter(struct filter *_filter,
|
||||
}
|
||||
|
||||
const struct filter_plugin null_filter_plugin = {
|
||||
.name = "null",
|
||||
.init = null_filter_init,
|
||||
.finish = null_filter_finish,
|
||||
.open = null_filter_open,
|
||||
.close = null_filter_close,
|
||||
.filter = null_filter_filter,
|
||||
"null",
|
||||
null_filter_init,
|
||||
null_filter_finish,
|
||||
null_filter_open,
|
||||
null_filter_close,
|
||||
null_filter_filter,
|
||||
};
|
@ -19,9 +19,9 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "ReplayGainFilterPlugin.hxx"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "audio_format.h"
|
||||
#include "replay_gain_info.h"
|
||||
#include "replay_gain_config.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
||||
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -44,9 +44,9 @@
|
||||
#include "ConfigQuark.hxx"
|
||||
#include "audio_format.h"
|
||||
#include "audio_check.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "pcm_buffer.h"
|
||||
|
||||
#include <assert.h>
|
||||
@ -188,7 +188,7 @@ route_filter_parse(const struct config_param *param,
|
||||
}
|
||||
|
||||
// Allocate a map of "copy nothing to me"
|
||||
filter->sources =
|
||||
filter->sources = (signed char *)
|
||||
g_malloc(filter->min_output_channels * sizeof(signed char));
|
||||
|
||||
for (int i=0; i<filter->min_output_channels; ++i)
|
||||
@ -295,14 +295,15 @@ route_filter_filter(struct filter *_filter,
|
||||
audio_format_sample_size(&filter->input_format);
|
||||
|
||||
// A moving pointer that always refers to channel 0 in the input, at the currently handled frame
|
||||
const uint8_t *base_source = src;
|
||||
const uint8_t *base_source = (const uint8_t *)src;
|
||||
|
||||
// A moving pointer that always refers to the currently filled channel of the currently handled frame, in the output
|
||||
uint8_t *chan_destination;
|
||||
|
||||
// Grow our reusable buffer, if needed, and set the moving pointer
|
||||
*dest_size_r = number_of_frames * filter->output_frame_size;
|
||||
chan_destination = pcm_buffer_get(&filter->output_buffer, *dest_size_r);
|
||||
chan_destination = (uint8_t *)
|
||||
pcm_buffer_get(&filter->output_buffer, *dest_size_r);
|
||||
|
||||
|
||||
// Perform our copy operations, with N input channels and M output channels
|
||||
@ -340,10 +341,10 @@ route_filter_filter(struct filter *_filter,
|
||||
}
|
||||
|
||||
const struct filter_plugin route_filter_plugin = {
|
||||
.name = "route",
|
||||
.init = route_filter_init,
|
||||
.finish = route_filter_finish,
|
||||
.open = route_filter_open,
|
||||
.close = route_filter_close,
|
||||
.filter = route_filter_filter,
|
||||
"route",
|
||||
route_filter_init,
|
||||
route_filter_finish,
|
||||
route_filter_open,
|
||||
route_filter_close,
|
||||
route_filter_filter,
|
||||
};
|
@ -19,9 +19,9 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "VolumeFilterPlugin.hxx"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_internal.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterInternal.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "conf.h"
|
||||
#include "pcm_buffer.h"
|
||||
#include "PcmVolume.hxx"
|
||||
|
@ -20,8 +20,8 @@
|
||||
#include "config.h"
|
||||
#include "SoftwareMixerPlugin.hxx"
|
||||
#include "mixer_api.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "filter_registry.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "filter/VolumeFilterPlugin.hxx"
|
||||
#include "PcmVolume.hxx"
|
||||
|
||||
|
@ -22,9 +22,9 @@
|
||||
extern "C" {
|
||||
#include "mixer_control.h"
|
||||
#include "mixer_list.h"
|
||||
#include "filter_registry.h"
|
||||
}
|
||||
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "PcmVolume.hxx"
|
||||
#include "GlobalEvents.hxx"
|
||||
#include "Main.hxx"
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "fs/Path.hxx"
|
||||
#include "AudioParser.hxx"
|
||||
#include "audio_format.h"
|
||||
#include "filter_plugin.h"
|
||||
#include "FilterPlugin.hxx"
|
||||
#include "PcmVolume.hxx"
|
||||
#include "mixer_control.h"
|
||||
#include "stdbin.h"
|
||||
|
@ -32,9 +32,9 @@
|
||||
extern "C" {
|
||||
#include "output_plugin.h"
|
||||
#include "output_internal.h"
|
||||
#include "filter_registry.h"
|
||||
}
|
||||
|
||||
#include "FilterRegistry.hxx"
|
||||
#include "PlayerControl.hxx"
|
||||
#include "stdbin.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user