mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	node: add flags to port_use_buffer
Remove the CAN_USE_BUFFERS flag, it is redundant. We can know this because of the IO params and buffer params. Add flags to the port_use_buffer call. We also want this call to replace port_alloc_buffer. Together with a new result event we can ask the node to (a)synchronously fill up the buffer data for us. This is part of a plan to let remote nodes provide buffer data.
This commit is contained in:
		
							parent
							
								
									b314547702
								
							
						
					
					
						commit
						8590ac158b
					
				
					 33 changed files with 153 additions and 122 deletions
				
			
		| 
						 | 
				
			
			@ -817,7 +817,7 @@ static int port_set_format(struct impl *this, struct port *port,
 | 
			
		|||
	port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS;
 | 
			
		||||
	if (port->have_format) {
 | 
			
		||||
		port->info.change_mask |= SPA_PORT_CHANGE_MASK_FLAGS;
 | 
			
		||||
		port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS | SPA_PORT_FLAG_LIVE;
 | 
			
		||||
		port->info.flags = SPA_PORT_FLAG_LIVE;
 | 
			
		||||
		port->info.change_mask |= SPA_PORT_CHANGE_MASK_RATE;
 | 
			
		||||
		port->info.rate = SPA_FRACTION(1, port->current_format.info.raw.rate);
 | 
			
		||||
		port->params[3] = SPA_PARAM_INFO(SPA_PARAM_Format, SPA_PARAM_INFO_READWRITE);
 | 
			
		||||
| 
						 | 
				
			
			@ -859,8 +859,9 @@ impl_node_port_set_param(void *object,
 | 
			
		|||
 | 
			
		||||
static int
 | 
			
		||||
impl_node_port_use_buffers(void *object,
 | 
			
		||||
			   enum spa_direction direction,
 | 
			
		||||
			   uint32_t port_id, struct spa_buffer **buffers, uint32_t n_buffers)
 | 
			
		||||
			   enum spa_direction direction, uint32_t port_id,
 | 
			
		||||
			   uint32_t flags,
 | 
			
		||||
			   struct spa_buffer **buffers, uint32_t n_buffers)
 | 
			
		||||
{
 | 
			
		||||
	struct impl *this = object;
 | 
			
		||||
	struct port *port;
 | 
			
		||||
| 
						 | 
				
			
			@ -1163,8 +1164,7 @@ impl_init(const struct spa_handle_factory *factory,
 | 
			
		|||
			SPA_PORT_CHANGE_MASK_PARAMS;
 | 
			
		||||
	port->info = SPA_PORT_INFO_INIT();
 | 
			
		||||
	port->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS;
 | 
			
		||||
	port->info.flags = SPA_PORT_FLAG_CAN_USE_BUFFERS |
 | 
			
		||||
			   SPA_PORT_FLAG_LIVE |
 | 
			
		||||
	port->info.flags = SPA_PORT_FLAG_LIVE |
 | 
			
		||||
			   SPA_PORT_FLAG_TERMINAL;
 | 
			
		||||
	port->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ);
 | 
			
		||||
	port->params[1] = SPA_PARAM_INFO(SPA_PARAM_Meta, SPA_PARAM_INFO_READ);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue