mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
filter-apply: Mark modules as being autoloaded
(Based on Colin's review) We mark modules as being autoloaded so that they can handle this as a special case if needed (which is required by module-echo-cancel for now). This inverts how things were done and makes using these modules manually less error-prone.
This commit is contained in:
parent
6e319e5182
commit
233ef98bf1
5 changed files with 28 additions and 11 deletions
|
|
@ -83,14 +83,18 @@ PA_MODULE_USAGE(
|
|||
"format=<sample format> "
|
||||
"rate=<sample rate> "
|
||||
"channels=<number of channels> "
|
||||
"channel_map=<channel map>"));
|
||||
"channel_map=<channel map> "
|
||||
"autoloaded=<set if this module is being loaded automatically> "
|
||||
));
|
||||
|
||||
#define MEMBLOCKQ_MAXLENGTH (16*1024*1024)
|
||||
#define DEFAULT_AUTOLOADED FALSE
|
||||
|
||||
struct userdata {
|
||||
pa_module *module;
|
||||
pa_sink *sink;
|
||||
pa_sink_input *sink_input;
|
||||
pa_bool_t autoloaded;
|
||||
|
||||
size_t channels;
|
||||
size_t fft_size;//length (res) of fft
|
||||
|
|
@ -138,6 +142,7 @@ static const char* const valid_modargs[] = {
|
|||
"rate",
|
||||
"channels",
|
||||
"channel_map",
|
||||
"autoloaded",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -1170,6 +1175,12 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
u->autoloaded = DEFAULT_AUTOLOADED;
|
||||
if (pa_modargs_get_value_boolean(ma, "autoloaded", &u->autoloaded) < 0) {
|
||||
pa_log("Failed to parse autoloaded value");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
u->sink = pa_sink_new(m->core, &sink_data,
|
||||
PA_SINK_HW_MUTE_CTRL|PA_SINK_HW_VOLUME_CTRL|PA_SINK_DECIBEL_VOLUME|
|
||||
(master->flags & (PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue