mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	mix: keep track of mix id
This commit is contained in:
		
							parent
							
								
									a50ea4c929
								
							
						
					
					
						commit
						f599120433
					
				
					 2 changed files with 9 additions and 7 deletions
				
			
		| 
						 | 
					@ -1239,15 +1239,16 @@ static void node_free(void *data)
 | 
				
			||||||
static int port_init_mix(void *data, struct pw_port_mix *mix)
 | 
					static int port_init_mix(void *data, struct pw_port_mix *mix)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct impl *impl = data;
 | 
						struct impl *impl = data;
 | 
				
			||||||
	uint32_t ioid;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ioid = pw_map_insert_new(&impl->io_map, NULL);
 | 
						mix->id = pw_map_insert_new(&impl->io_map, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	mix->port.io = SPA_MEMBER(impl->io_areas->ptr, ioid * sizeof(struct spa_io_buffers), void);
 | 
						mix->port.io = SPA_MEMBER(impl->io_areas->ptr,
 | 
				
			||||||
 | 
								mix->id * sizeof(struct spa_io_buffers), void);
 | 
				
			||||||
	mix->port.io->buffer_id = SPA_ID_INVALID;
 | 
						mix->port.io->buffer_id = SPA_ID_INVALID;
 | 
				
			||||||
	mix->port.io->status = SPA_STATUS_NEED_BUFFER;
 | 
						mix->port.io->status = SPA_STATUS_NEED_BUFFER;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug("client-node %p: init mix io %d %p", impl, ioid, mix->port.io);
 | 
						pw_log_debug("client-node %p: init mix io %d %p %p", impl, mix->id, mix->port.io,
 | 
				
			||||||
 | 
								impl->io_areas->ptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1255,11 +1256,11 @@ static int port_init_mix(void *data, struct pw_port_mix *mix)
 | 
				
			||||||
static int port_release_mix(void *data, struct pw_port_mix *mix)
 | 
					static int port_release_mix(void *data, struct pw_port_mix *mix)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct impl *impl = data;
 | 
						struct impl *impl = data;
 | 
				
			||||||
	uint32_t id;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	id = (mix->port.io - (struct spa_io_buffers*)impl->io_areas->ptr);
 | 
						pw_log_debug("client-node %p: remove mix io %d %p %p", impl, mix->id, mix->port.io,
 | 
				
			||||||
 | 
								impl->io_areas->ptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_map_remove(&impl->io_map, id);
 | 
						pw_map_remove(&impl->io_map, mix->id);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -291,6 +291,7 @@ struct pw_port_mix {
 | 
				
			||||||
	struct spa_graph_port port;
 | 
						struct spa_graph_port port;
 | 
				
			||||||
	struct spa_buffer **buffers;
 | 
						struct spa_buffer **buffers;
 | 
				
			||||||
	uint32_t n_buffers;
 | 
						uint32_t n_buffers;
 | 
				
			||||||
 | 
						uint32_t id;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct pw_port_implementation {
 | 
					struct pw_port_implementation {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue