mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
pipewire: module-filter-chain: dsp_ops_init(): take cpu_flags
Instead of relying on the caller to initialize `dsp_ops::cpu_flags`, take it as an argument.
This commit is contained in:
parent
75c77b9116
commit
539115fc59
3 changed files with 5 additions and 5 deletions
|
|
@ -2995,8 +2995,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu_iface = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_CPU);
|
cpu_iface = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_CPU);
|
||||||
impl->dsp.cpu_flags = cpu_iface ? spa_cpu_get_flags(cpu_iface) : 0;
|
dsp_ops_init(&impl->dsp, cpu_iface ? spa_cpu_get_flags(cpu_iface) : 0);
|
||||||
dsp_ops_init(&impl->dsp);
|
|
||||||
|
|
||||||
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
||||||
pw_properties_setf(props, PW_KEY_NODE_GROUP, "filter-chain-%u-%u", pid, id);
|
pw_properties_setf(props, PW_KEY_NODE_GROUP, "filter-chain-%u-%u", pid, id);
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,15 @@ static void impl_dsp_ops_free(struct dsp_ops *ops)
|
||||||
spa_zero(*ops);
|
spa_zero(*ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dsp_ops_init(struct dsp_ops *ops)
|
int dsp_ops_init(struct dsp_ops *ops, uint32_t cpu_flags)
|
||||||
{
|
{
|
||||||
const struct dsp_info *info;
|
const struct dsp_info *info;
|
||||||
|
|
||||||
info = find_dsp_info(ops->cpu_flags);
|
info = find_dsp_info(cpu_flags);
|
||||||
if (info == NULL)
|
if (info == NULL)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
|
ops->cpu_flags = cpu_flags;
|
||||||
ops->priv = info;
|
ops->priv = info;
|
||||||
ops->free = impl_dsp_ops_free;
|
ops->free = impl_dsp_ops_free;
|
||||||
ops->funcs = info->funcs;
|
ops->funcs = info->funcs;
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ struct dsp_ops {
|
||||||
const void *priv;
|
const void *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
int dsp_ops_init(struct dsp_ops *ops);
|
int dsp_ops_init(struct dsp_ops *ops, uint32_t cpu_flags);
|
||||||
|
|
||||||
#define dsp_ops_free(ops) (ops)->free(ops)
|
#define dsp_ops_free(ops) (ops)->free(ops)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue