node: Add id to set_io

Make it possible to configure multiple io areas on a port by giving
an id to set_io.
Add some types to enumerate the supported ids
Make an area to exchange buffers and one to specify pull ranges.
The idea is to make more area types for controlable properties.
Implement enumeration of IO areas in volume.
This commit is contained in:
Wim Taymans 2017-11-21 19:34:37 +01:00
parent 4288a634f4
commit 8efea3e1ea
40 changed files with 583 additions and 208 deletions

View file

@ -517,17 +517,28 @@ impl_node_port_alloc_buffers(struct spa_node *node,
}
static int
impl_node_port_set_io(struct spa_node *node, enum spa_direction direction, uint32_t port_id, struct spa_port_io *io)
impl_node_port_set_io(struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
uint32_t id,
void *io)
{
struct state *this;
struct type *t;
spa_return_val_if_fail(node != NULL, -EINVAL);
this = SPA_CONTAINER_OF(node, struct state, node);
t = &this->type;
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
this->io = io;
if (id == t->io.Buffers)
this->io = io;
else if (id == t->io.ControlRange)
this->range = io;
else
return -ENOENT;
return 0;
}
@ -563,7 +574,7 @@ impl_node_port_send_command(struct spa_node *node,
static int impl_node_process_input(struct spa_node *node)
{
struct state *this;
struct spa_port_io *input;
struct spa_io_buffers *input;
spa_return_val_if_fail(node != NULL, -EINVAL);