node: add driver graph field and schedule it for drivers

This commit is contained in:
Wim Taymans 2018-04-25 15:55:30 +02:00
parent 20692cf173
commit 013b606a89
2 changed files with 5 additions and 3 deletions

View file

@ -488,6 +488,7 @@ struct pw_node *pw_node_new(struct pw_core *core,
spa_graph_set_callbacks(&impl->driver_graph,
&driver_impl_default, &impl->driver_data);
this->rt.driver = &impl->driver_graph;
this->rt.activation = &impl->root_activation;
spa_graph_node_init(&this->rt.root, &this->rt.activation->state);
spa_graph_node_add(&impl->driver_graph, &this->rt.root);
@ -587,14 +588,14 @@ static void node_process(void *data, int status)
struct pw_node *node = data;
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
pw_log_trace("node %p: process %d %d", node, node->driver, node->exported);
pw_log_trace("node %p: process driver:%d exported:%d", node, node->driver, node->exported);
spa_hook_list_call(&node->listener_list, struct pw_node_events, process);
if (node->driver) {
if (!node->exported) {
if (impl->driver_graph.state->pending == 0 || !node->remote)
spa_graph_run(&impl->driver_graph);
if (node->rt.driver->state->pending == 0 || !node->remote)
spa_graph_run(node->rt.driver);
else
spa_graph_node_trigger(&node->rt.node);
}

View file

@ -274,6 +274,7 @@ struct pw_node {
struct pw_loop *data_loop; /**< the data loop for this node */
struct {
struct spa_graph *driver;
struct spa_graph_node root;
struct pw_node_activation *activation;
struct spa_graph_node node;