mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
filter-graph: pass void * to connect_port
This makes it a bit more generic and allows us to connect other things that float arrays. Add a SPA_FGA_PORT_SEQUENCE as a new port type. The data to connect to this port is a Sequence type with the size field set to the max/size of the data.
This commit is contained in:
parent
7359491b97
commit
e3cc44966b
8 changed files with 16 additions and 15 deletions
|
|
@ -9,7 +9,6 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <spa/utils/defs.h>
|
#include <spa/utils/defs.h>
|
||||||
#include <spa/utils/hook.h>
|
|
||||||
#include <spa/support/plugin.h>
|
#include <spa/support/plugin.h>
|
||||||
|
|
||||||
#define SPA_TYPE_INTERFACE_FILTER_GRAPH_AudioPlugin SPA_TYPE_INFO_INTERFACE_BASE "FilterGraph:AudioPlugin"
|
#define SPA_TYPE_INTERFACE_FILTER_GRAPH_AudioPlugin SPA_TYPE_INFO_INTERFACE_BASE "FilterGraph:AudioPlugin"
|
||||||
|
|
@ -32,6 +31,7 @@ struct spa_fga_port {
|
||||||
#define SPA_FGA_PORT_CONTROL (1ULL << 2)
|
#define SPA_FGA_PORT_CONTROL (1ULL << 2)
|
||||||
#define SPA_FGA_PORT_AUDIO (1ULL << 3)
|
#define SPA_FGA_PORT_AUDIO (1ULL << 3)
|
||||||
#define SPA_FGA_PORT_SUPPORTS_NULL_DATA (1ULL << 4)
|
#define SPA_FGA_PORT_SUPPORTS_NULL_DATA (1ULL << 4)
|
||||||
|
#define SPA_FGA_PORT_SEQUENCE (1ULL << 5)
|
||||||
uint64_t flags;
|
uint64_t flags;
|
||||||
|
|
||||||
#define SPA_FGA_HINT_BOOLEAN (1ULL << 0)
|
#define SPA_FGA_HINT_BOOLEAN (1ULL << 0)
|
||||||
|
|
@ -49,6 +49,7 @@ struct spa_fga_port {
|
||||||
#define SPA_FGA_IS_PORT_CONTROL(x) ((x) & SPA_FGA_PORT_CONTROL)
|
#define SPA_FGA_IS_PORT_CONTROL(x) ((x) & SPA_FGA_PORT_CONTROL)
|
||||||
#define SPA_FGA_IS_PORT_AUDIO(x) ((x) & SPA_FGA_PORT_AUDIO)
|
#define SPA_FGA_IS_PORT_AUDIO(x) ((x) & SPA_FGA_PORT_AUDIO)
|
||||||
#define SPA_FGA_SUPPORTS_NULL_DATA(x) ((x) & SPA_FGA_PORT_SUPPORTS_NULL_DATA)
|
#define SPA_FGA_SUPPORTS_NULL_DATA(x) ((x) & SPA_FGA_PORT_SUPPORTS_NULL_DATA)
|
||||||
|
#define SPA_FGA_IS_PORT_SEQUENCE(x) ((x) & SPA_FGA_PORT_SEQUENCE)
|
||||||
|
|
||||||
struct spa_fga_descriptor {
|
struct spa_fga_descriptor {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
@ -66,7 +67,7 @@ struct spa_fga_descriptor {
|
||||||
|
|
||||||
void (*cleanup) (void *instance);
|
void (*cleanup) (void *instance);
|
||||||
|
|
||||||
void (*connect_port) (void *instance, unsigned long port, float *data);
|
void (*connect_port) (void *instance, unsigned long port, void *data);
|
||||||
void (*control_changed) (void *instance);
|
void (*control_changed) (void *instance);
|
||||||
|
|
||||||
void (*activate) (void *instance);
|
void (*activate) (void *instance);
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ static void *builtin_instantiate(const struct spa_fga_plugin *plugin, const stru
|
||||||
return impl;
|
return impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void builtin_connect_port(void *Instance, unsigned long Port, float * DataLocation)
|
static void builtin_connect_port(void *Instance, unsigned long Port, void * DataLocation)
|
||||||
{
|
{
|
||||||
struct builtin *impl = Instance;
|
struct builtin *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
@ -1103,7 +1103,7 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void convolver_connect_port(void * Instance, unsigned long Port,
|
static void convolver_connect_port(void * Instance, unsigned long Port,
|
||||||
float * DataLocation)
|
void * DataLocation)
|
||||||
{
|
{
|
||||||
struct convolver_impl *impl = Instance;
|
struct convolver_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
@ -1259,7 +1259,7 @@ static void *delay_instantiate(const struct spa_fga_plugin *plugin, const struct
|
||||||
}
|
}
|
||||||
|
|
||||||
static void delay_connect_port(void * Instance, unsigned long Port,
|
static void delay_connect_port(void * Instance, unsigned long Port,
|
||||||
float * DataLocation)
|
void * DataLocation)
|
||||||
{
|
{
|
||||||
struct delay_impl *impl = Instance;
|
struct delay_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
@ -2057,7 +2057,7 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void param_eq_connect_port(void * Instance, unsigned long Port,
|
static void param_eq_connect_port(void * Instance, unsigned long Port,
|
||||||
float * DataLocation)
|
void * DataLocation)
|
||||||
{
|
{
|
||||||
struct param_eq_impl *impl = Instance;
|
struct param_eq_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
@ -2276,7 +2276,7 @@ static void dcblock_run(void * Instance, unsigned long SampleCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dcblock_connect_port(void * Instance, unsigned long Port,
|
static void dcblock_connect_port(void * Instance, unsigned long Port,
|
||||||
float * DataLocation)
|
void * DataLocation)
|
||||||
{
|
{
|
||||||
struct dcblock_impl *impl = Instance;
|
struct dcblock_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
@ -2736,7 +2736,7 @@ static void *pipe_instantiate(const struct spa_fga_plugin *plugin, const struct
|
||||||
return impl;
|
return impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pipe_connect_port(void *Instance, unsigned long Port, float * DataLocation)
|
static void pipe_connect_port(void *Instance, unsigned long Port, void * DataLocation)
|
||||||
{
|
{
|
||||||
struct pipe_impl *impl = Instance;
|
struct pipe_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ static void ebur128_run(void * Instance, unsigned long SampleCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ebur128_connect_port(void * Instance, unsigned long Port,
|
static void ebur128_connect_port(void * Instance, unsigned long Port,
|
||||||
float * DataLocation)
|
void * DataLocation)
|
||||||
{
|
{
|
||||||
struct ebur128_impl *impl = Instance;
|
struct ebur128_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
@ -442,7 +442,7 @@ static void * lufs2gain_instantiate(const struct spa_fga_plugin *plugin, const s
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lufs2gain_connect_port(void * Instance, unsigned long Port,
|
static void lufs2gain_connect_port(void * Instance, unsigned long Port,
|
||||||
float * DataLocation)
|
void * DataLocation)
|
||||||
{
|
{
|
||||||
struct lufs2gain_impl *impl = Instance;
|
struct lufs2gain_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ static void ffmpeg_free(const struct spa_fga_descriptor *desc)
|
||||||
free(d);
|
free(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ffmpeg_connect_port(void *instance, unsigned long port, float *data)
|
static void ffmpeg_connect_port(void *instance, unsigned long port, void *data)
|
||||||
{
|
{
|
||||||
struct instance *i = instance;
|
struct instance *i = instance;
|
||||||
i->data[port] = data;
|
i->data[port] = data;
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ static const struct spa_fga_descriptor *ladspa_plugin_make_desc(void *plugin, co
|
||||||
|
|
||||||
desc->desc.instantiate = ladspa_instantiate;
|
desc->desc.instantiate = ladspa_instantiate;
|
||||||
desc->desc.cleanup = d->cleanup;
|
desc->desc.cleanup = d->cleanup;
|
||||||
desc->desc.connect_port = d->connect_port;
|
desc->desc.connect_port = (__typeof__(desc->desc.connect_port))d->connect_port;
|
||||||
desc->desc.activate = d->activate;
|
desc->desc.activate = d->activate;
|
||||||
desc->desc.deactivate = d->deactivate;
|
desc->desc.deactivate = d->deactivate;
|
||||||
desc->desc.run = d->run;
|
desc->desc.run = d->run;
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ static void lv2_cleanup(void *instance)
|
||||||
free(i);
|
free(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv2_connect_port(void *instance, unsigned long port, float *data)
|
static void lv2_connect_port(void *instance, unsigned long port, void *data)
|
||||||
{
|
{
|
||||||
struct instance *i = instance;
|
struct instance *i = instance;
|
||||||
lilv_instance_connect_port(i->instance, port, data);
|
lilv_instance_connect_port(i->instance, port, data);
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ static void onnx_free(const struct spa_fga_descriptor *desc)
|
||||||
free(d);
|
free(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onnx_connect_port(void *instance, unsigned long port, float *data)
|
static void onnx_connect_port(void *instance, unsigned long port, void *data)
|
||||||
{
|
{
|
||||||
struct instance *i = instance;
|
struct instance *i = instance;
|
||||||
i->data[port] = data;
|
i->data[port] = data;
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ static void spatializer_run(void * Instance, unsigned long SampleCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void spatializer_connect_port(void * Instance, unsigned long Port,
|
static void spatializer_connect_port(void * Instance, unsigned long Port,
|
||||||
float * DataLocation)
|
void * DataLocation)
|
||||||
{
|
{
|
||||||
struct spatializer_impl *impl = Instance;
|
struct spatializer_impl *impl = Instance;
|
||||||
impl->port[Port] = DataLocation;
|
impl->port[Port] = DataLocation;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue