mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	client-node: handle io reset
This commit is contained in:
		
							parent
							
								
									9225ec29f2
								
							
						
					
					
						commit
						053f251be8
					
				
					 1 changed files with 23 additions and 8 deletions
				
			
		| 
						 | 
					@ -524,31 +524,46 @@ spa_proxy_node_port_set_io(struct spa_node *node,
 | 
				
			||||||
	this = SPA_CONTAINER_OF(node, struct proxy, node);
 | 
						this = SPA_CONTAINER_OF(node, struct proxy, node);
 | 
				
			||||||
	t = this->impl->t;
 | 
						t = this->impl->t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (this->resource == NULL)
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!CHECK_PORT(this, direction, port_id))
 | 
						if (!CHECK_PORT(this, direction, port_id))
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	port = GET_PORT(this, direction, port_id);
 | 
						port = GET_PORT(this, direction, port_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (id == t->io.Buffers)
 | 
						if (id == t->io.Buffers)
 | 
				
			||||||
		port->io = data;
 | 
							port->io = data;
 | 
				
			||||||
	else {
 | 
						else {
 | 
				
			||||||
		struct pw_memblock *mem;
 | 
							struct pw_memblock *mem;
 | 
				
			||||||
		uint32_t memid = this->membase++;
 | 
							uint32_t memid, offset, size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if ((mem = pw_memblock_find(data)) == NULL)
 | 
								if ((mem = pw_memblock_find(data)) == NULL)
 | 
				
			||||||
				return -EINVAL;
 | 
									return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								memid = this->membase++;
 | 
				
			||||||
 | 
								offset = mem->offset;
 | 
				
			||||||
 | 
								size = mem->size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			pw_client_node_resource_add_mem(this->resource,
 | 
								pw_client_node_resource_add_mem(this->resource,
 | 
				
			||||||
							memid,
 | 
												memid,
 | 
				
			||||||
							t->data.MemFd,
 | 
												t->data.MemFd,
 | 
				
			||||||
							mem->fd, mem->flags);
 | 
												mem->fd, mem->flags);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else {
 | 
				
			||||||
 | 
								memid = SPA_ID_INVALID;
 | 
				
			||||||
 | 
								offset = size = 0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		pw_client_node_resource_port_set_io(this->resource,
 | 
							pw_client_node_resource_port_set_io(this->resource,
 | 
				
			||||||
						    this->seq,
 | 
											    this->seq,
 | 
				
			||||||
						    direction, port_id,
 | 
											    direction, port_id,
 | 
				
			||||||
						    id,
 | 
											    id,
 | 
				
			||||||
						    memid,
 | 
											    memid,
 | 
				
			||||||
						    mem->offset, mem->size);
 | 
											    offset, size);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue