mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	filter-graph: make it possible to set n_inputs/n_outputs in graph
So that the graph can be a self contained object.
This commit is contained in:
		
							parent
							
								
									e7d61a6fdf
								
							
						
					
					
						commit
						094a45a6f7
					
				
					 1 changed files with 15 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1880,7 +1880,21 @@ static int load_graph(struct graph *graph, const struct spa_dict *props)
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	while ((len = spa_json_object_next(&it[0], key, sizeof(key), &val)) > 0) {
 | 
			
		||||
		if (spa_streq("nodes", key)) {
 | 
			
		||||
		if (spa_streq("n_inputs", key)) {
 | 
			
		||||
			if (spa_json_parse_int(val, len, &res) <= 0) {
 | 
			
		||||
				spa_log_error(impl->log, "n_inputs expects an integer");
 | 
			
		||||
				return -EINVAL;
 | 
			
		||||
			}
 | 
			
		||||
			impl->info.n_inputs = res;
 | 
			
		||||
		}
 | 
			
		||||
		else if (spa_streq("n_outputs", key)) {
 | 
			
		||||
			if (spa_json_parse_int(val, len, &res) <= 0) {
 | 
			
		||||
				spa_log_error(impl->log, "n_outputs expects an integer");
 | 
			
		||||
				return -EINVAL;
 | 
			
		||||
			}
 | 
			
		||||
			impl->info.n_outputs = res;
 | 
			
		||||
		}
 | 
			
		||||
		else if (spa_streq("nodes", key)) {
 | 
			
		||||
			if (!spa_json_is_array(val, len)) {
 | 
			
		||||
				spa_log_error(impl->log, "nodes expects an array");
 | 
			
		||||
				return -EINVAL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue