mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -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);
|
||||
t = this->impl->t;
|
||||
|
||||
if (this->resource == NULL)
|
||||
return 0;
|
||||
|
||||
if (!CHECK_PORT(this, direction, port_id))
|
||||
return -EINVAL;
|
||||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
|
||||
if (id == t->io.Buffers)
|
||||
port->io = data;
|
||||
else {
|
||||
struct pw_memblock *mem;
|
||||
uint32_t memid = this->membase++;
|
||||
uint32_t memid, offset, size;
|
||||
|
||||
if ((mem = pw_memblock_find(data)) == NULL)
|
||||
return -EINVAL;
|
||||
if (data) {
|
||||
|
||||
pw_client_node_resource_add_mem(this->resource,
|
||||
memid,
|
||||
t->data.MemFd,
|
||||
mem->fd, mem->flags);
|
||||
if ((mem = pw_memblock_find(data)) == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
memid = this->membase++;
|
||||
offset = mem->offset;
|
||||
size = mem->size;
|
||||
|
||||
pw_client_node_resource_add_mem(this->resource,
|
||||
memid,
|
||||
t->data.MemFd,
|
||||
mem->fd, mem->flags);
|
||||
}
|
||||
else {
|
||||
memid = SPA_ID_INVALID;
|
||||
offset = size = 0;
|
||||
}
|
||||
|
||||
pw_client_node_resource_port_set_io(this->resource,
|
||||
this->seq,
|
||||
direction, port_id,
|
||||
id,
|
||||
memid,
|
||||
mem->offset, mem->size);
|
||||
offset, size);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue