mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
port: emit signal after properties are set
So that we can use the node properties in the signal handler. Also use the channel name of the port to make a port name.
This commit is contained in:
parent
595daf86c6
commit
6de03418ca
1 changed files with 8 additions and 3 deletions
|
|
@ -502,8 +502,6 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
if (find != NULL)
|
||||
return -EEXIST;
|
||||
|
||||
pw_node_events_port_init(node, port);
|
||||
|
||||
if ((res = spa_node_port_get_info(node->node,
|
||||
port->direction, port_id,
|
||||
&port->spa_info)) < 0) {
|
||||
|
|
@ -525,6 +523,8 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
if (port->spa_info->props)
|
||||
pw_port_update_properties(port, port->spa_info->props);
|
||||
|
||||
pw_node_events_port_init(node, port);
|
||||
|
||||
pw_port_for_each_param(port, SPA_PARAM_IO, 0, 0, NULL, check_param_io, port);
|
||||
|
||||
dir = port->direction == PW_DIRECTION_INPUT ? "in" : "out";
|
||||
|
|
@ -537,7 +537,12 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
}
|
||||
|
||||
if ((str = pw_properties_get(port->properties, "port.name")) == NULL) {
|
||||
pw_properties_setf(port->properties, "port.name", "%s_%d", dir, port_id);
|
||||
if ((str = pw_properties_get(port->properties, "port.channel")) != NULL) {
|
||||
pw_properties_setf(port->properties, "port.name", "%s_%s", dir, str);
|
||||
}
|
||||
else {
|
||||
pw_properties_setf(port->properties, "port.name", "%s_%d", dir, port_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (SPA_FLAG_CHECK(port->spa_info->flags, SPA_PORT_INFO_FLAG_PHYSICAL))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue