mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
node: export method to update ports
This commit is contained in:
parent
2660b5c4f5
commit
1b2e73de0c
3 changed files with 8 additions and 2 deletions
|
|
@ -1030,6 +1030,7 @@ client_node_port_update(void *data,
|
|||
change_mask,
|
||||
n_params, params, info);
|
||||
}
|
||||
pw_node_update_ports(impl->this.node);
|
||||
}
|
||||
|
||||
static void client_node_set_active(void *data, bool active)
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ static void update_port_map(struct pw_node *node, enum pw_direction direction,
|
|||
}
|
||||
}
|
||||
|
||||
static int update_port_ids(struct pw_node *node)
|
||||
int pw_node_update_ports(struct pw_node *node)
|
||||
{
|
||||
uint32_t *input_port_ids, *output_port_ids;
|
||||
uint32_t n_input_ports, n_output_ports, max_input_ports, max_output_ports;
|
||||
|
|
@ -337,12 +337,15 @@ int pw_node_register(struct pw_node *this,
|
|||
|
||||
pw_log_debug("node %p: register", this);
|
||||
|
||||
if (this->registered)
|
||||
return -EEXIST;
|
||||
|
||||
if (properties == NULL)
|
||||
properties = pw_properties_new(NULL, NULL);
|
||||
if (properties == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
update_port_ids(this);
|
||||
pw_node_update_ports(this);
|
||||
|
||||
pw_loop_invoke(this->data_loop, do_node_add, 1, NULL, 0, false, this);
|
||||
|
||||
|
|
|
|||
|
|
@ -557,6 +557,8 @@ int pw_node_set_state(struct pw_node *node, enum pw_node_state state);
|
|||
/** Update the state of the node, mostly used by node implementations */
|
||||
void pw_node_update_state(struct pw_node *node, enum pw_node_state state, char *error);
|
||||
|
||||
int pw_node_update_ports(struct pw_node *node);
|
||||
|
||||
/** Activate a link \memberof pw_link
|
||||
* Starts the negotiation of formats and buffers on \a link and then
|
||||
* starts data streaming */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue