port: select a mixer when we set a format

When the port receives a format, look if we can find a mixer for it
and configure it.

Use the float32 mono mixer when possible.

Use the new pw_buffers in the link.

Let the port allocate buffers between the mixer and node when
requested.

The client-node doesn't need a mixer because mixing is done on the
client.

Remove all mixer and buffer negotiation code from adapter because
it is now done at the port level.
This commit is contained in:
Wim Taymans 2019-10-02 18:07:10 +02:00
parent 4a47bf4706
commit 5cfb6634f4
7 changed files with 211 additions and 431 deletions

View file

@ -1379,13 +1379,7 @@ impl_mix_port_set_param(void *object,
uint32_t id, uint32_t flags,
const struct spa_pod *param)
{
struct port *port = object;
if (port->direction != direction)
return -ENOTSUP;
return impl_node_port_set_param(&port->node->node, direction, port->id,
id, flags, param);
return -ENOTSUP;
}
static int
@ -1507,6 +1501,8 @@ static void node_port_added(void *data, struct pw_port *port)
PW_PORT_MIX_FLAG_MULTI |
PW_PORT_MIX_FLAG_MIX_ONLY);
port->flags |= PW_PORT_FLAG_NO_MIXER;
port->impl = SPA_CALLBACKS_INIT(&port_impl, p);
port->owner_data = impl;
}