mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	node: add driver graph field and schedule it for drivers
This commit is contained in:
		
							parent
							
								
									20692cf173
								
							
						
					
					
						commit
						013b606a89
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
					@ -488,6 +488,7 @@ struct pw_node *pw_node_new(struct pw_core *core,
 | 
				
			||||||
	spa_graph_set_callbacks(&impl->driver_graph,
 | 
						spa_graph_set_callbacks(&impl->driver_graph,
 | 
				
			||||||
			&driver_impl_default, &impl->driver_data);
 | 
								&driver_impl_default, &impl->driver_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						this->rt.driver = &impl->driver_graph;
 | 
				
			||||||
	this->rt.activation = &impl->root_activation;
 | 
						this->rt.activation = &impl->root_activation;
 | 
				
			||||||
	spa_graph_node_init(&this->rt.root, &this->rt.activation->state);
 | 
						spa_graph_node_init(&this->rt.root, &this->rt.activation->state);
 | 
				
			||||||
	spa_graph_node_add(&impl->driver_graph, &this->rt.root);
 | 
						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 pw_node *node = data;
 | 
				
			||||||
	struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
 | 
						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);
 | 
						spa_hook_list_call(&node->listener_list, struct pw_node_events, process);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (node->driver) {
 | 
						if (node->driver) {
 | 
				
			||||||
		if (!node->exported) {
 | 
							if (!node->exported) {
 | 
				
			||||||
			if (impl->driver_graph.state->pending == 0 || !node->remote)
 | 
								if (node->rt.driver->state->pending == 0 || !node->remote)
 | 
				
			||||||
				spa_graph_run(&impl->driver_graph);
 | 
									spa_graph_run(node->rt.driver);
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				spa_graph_node_trigger(&node->rt.node);
 | 
									spa_graph_node_trigger(&node->rt.node);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -274,6 +274,7 @@ struct pw_node {
 | 
				
			||||||
	struct pw_loop *data_loop;		/**< the data loop for this node */
 | 
						struct pw_loop *data_loop;		/**< the data loop for this node */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct {
 | 
						struct {
 | 
				
			||||||
 | 
							struct spa_graph *driver;
 | 
				
			||||||
		struct spa_graph_node root;
 | 
							struct spa_graph_node root;
 | 
				
			||||||
		struct pw_node_activation *activation;
 | 
							struct pw_node_activation *activation;
 | 
				
			||||||
		struct spa_graph_node node;
 | 
							struct spa_graph_node node;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue