node: make port for_each more powerful

Make an int return from pw_node_for_each_port() so that we can return
errors or early exit.
Add pw_port_for_each_param() to iterate params. And use this to collect
the formats.
This commit is contained in:
Wim Taymans 2017-11-29 16:58:17 +01:00
parent 425073afd8
commit 91a3670610
6 changed files with 81 additions and 47 deletions

View file

@ -234,10 +234,10 @@ static void node_port_removed(void *data, struct pw_port *port)
{
}
static bool on_node_port_added(void *data, struct pw_port *port)
static int on_node_port_added(void *data, struct pw_port *port)
{
node_port_added(data, port);
return true;
return 0;
}
static void on_node_created(struct pw_node *node, struct node_info *info)