mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-14 20:02:38 +00:00
filter-chain: add copy function
This commit is contained in:
parent
fb6db4a1f9
commit
2017de6da8
|
@ -61,6 +61,42 @@ static void builtin_cleanup(LADSPA_Handle Instance)
|
||||||
free(impl);
|
free(impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** copy */
|
||||||
|
static void copy_run(LADSPA_Handle Instance, unsigned long SampleCount)
|
||||||
|
{
|
||||||
|
struct builtin *impl = Instance;
|
||||||
|
float *in = impl->port[1], *out = impl->port[0];
|
||||||
|
memcpy(out, in, SampleCount * sizeof(float));
|
||||||
|
}
|
||||||
|
|
||||||
|
static const LADSPA_PortDescriptor copy_port_desc[] = {
|
||||||
|
LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO,
|
||||||
|
LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char * const copy_port_names[] = {
|
||||||
|
"Out", "In"
|
||||||
|
};
|
||||||
|
|
||||||
|
static const LADSPA_PortRangeHint copy_range_hints[] = {
|
||||||
|
{ 0, }, { 0, },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const LADSPA_Descriptor copy_desc = {
|
||||||
|
.Label = "copy",
|
||||||
|
.Name = "Copy input to output",
|
||||||
|
.Maker = "PipeWire",
|
||||||
|
.Copyright = "MIT",
|
||||||
|
.PortCount = 2,
|
||||||
|
.PortDescriptors = copy_port_desc,
|
||||||
|
.PortNames = copy_port_names,
|
||||||
|
.PortRangeHints = copy_range_hints,
|
||||||
|
.instantiate = builtin_instantiate,
|
||||||
|
.connect_port = builtin_connect_port,
|
||||||
|
.run = copy_run,
|
||||||
|
.cleanup = builtin_cleanup,
|
||||||
|
};
|
||||||
|
|
||||||
/** mixer */
|
/** mixer */
|
||||||
static void mixer_run(LADSPA_Handle Instance, unsigned long SampleCount)
|
static void mixer_run(LADSPA_Handle Instance, unsigned long SampleCount)
|
||||||
{
|
{
|
||||||
|
@ -377,6 +413,8 @@ static const LADSPA_Descriptor * builtin_ladspa_descriptor(unsigned long Index)
|
||||||
return &bq_notch_desc;
|
return &bq_notch_desc;
|
||||||
case 8:
|
case 8:
|
||||||
return &bq_allpass_desc;
|
return &bq_allpass_desc;
|
||||||
|
case 9:
|
||||||
|
return ©_desc;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue