work on separating port mixers

Make it possible to assign an arbitary node as the port mixer.
Also remove dynamically added ports.
Improve negotiation and allocation on the mixer ports
Add some more SSE optimisations
Move float mixer from the audio dsp to the port
Remove pw_node_get_free_port() and do things more explicitly.
Handle mixer ports in client-node
This commit is contained in:
Wim Taymans 2018-07-31 12:23:35 +02:00
parent f55cb422cb
commit ca898a00db
29 changed files with 2422 additions and 1504 deletions

View file

@ -89,6 +89,8 @@ struct data {
struct pw_node *node;
struct spa_port_info port_info;
struct spa_dict port_props;
struct spa_dict_item port_items[1];
struct spa_node impl_node;
const struct spa_node_callbacks *callbacks;
@ -180,7 +182,10 @@ static int impl_port_get_info(struct spa_node *node, enum spa_direction directio
d->port_info.flags = SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS;
d->port_info.rate = 0;
d->port_info.props = NULL;
d->port_info.props = &d->port_props;
d->port_items[0] = SPA_DICT_ITEM_INIT("port.dsp", "32 bit float mono audio");
d->port_props = SPA_DICT_INIT(d->port_items, 1);
*info = &d->port_info;
@ -206,7 +211,9 @@ static int port_enum_formats(struct spa_node *node,
":", d->type.format_audio.format, "Ieu", d->type.audio_format.S16,
SPA_POD_PROP_ENUM(2, d->type.audio_format.S16,
d->type.audio_format.F32),
":", d->type.format_audio.layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
":", d->type.format_audio.layout, "ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
":", d->type.format_audio.channels, "iru", 2,
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
":", d->type.format_audio.rate, "iru", 44100,
@ -539,7 +546,7 @@ static void make_node(struct data *data)
struct pw_properties *props;
props = pw_properties_new(PW_NODE_PROP_AUTOCONNECT, "1",
PW_NODE_PROP_EXCLUSIVE, "1",
PW_NODE_PROP_EXCLUSIVE, "0",
NULL);
if (data->path)
pw_properties_set(props, PW_NODE_PROP_TARGET_NODE, data->path);