node: Add port_info event

Add a port_info event. With this, we get updates to ports pushed to
us, which is more convenient and also allows for better dynamic
add/remove of ports.
We don't need to the PortChanged event anymore
We can remove the get_port_ids/get_n_ports/port_get_info methods.
Update plugins
This commit is contained in:
Wim Taymans 2019-02-14 17:08:46 +01:00
parent 3c78036a97
commit 21957e9e8d
37 changed files with 1068 additions and 2288 deletions

View file

@ -397,8 +397,7 @@ static void client_node_transport(void *object, uint32_t node_id,
static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32_t change_mask)
{
struct node_data *data = proxy->user_data;
const struct spa_port_info *port_info = NULL;
struct spa_port_info pi;
struct spa_port_info pi = SPA_PORT_INFO_INIT();
uint32_t n_params = 0;
struct spa_pod **params = NULL;
@ -438,8 +437,12 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
}
}
if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_INFO) {
spa_node_port_get_info(port->node->node, port->direction, port->port_id, &port_info);
pi = * port_info;
pi.change_mask = SPA_PORT_CHANGE_MASK_FLAGS |
SPA_PORT_CHANGE_MASK_RATE |
SPA_PORT_CHANGE_MASK_PROPS;
pi.flags = port->spa_flags;
pi.rate = 0;
pi.props = &port->properties->dict;
pi.flags &= ~SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS;
}