Add support for client fd memory

Remove the node buffers reply again. We don't need it. Instead add a
new method to the client-node to upload an array of buffer datas.
This method is called after the client has allocated buffer mem. It
will update the buffers on the server side with the client allocated
memory.

Wait for the async reply of use_buffers when doing alloc_buffers so
that we can get the updated buffer mem before we continue.

Let the link follow the states of the ports.

Add some error code to the port error states.

Add PW_STREAM_FLAG_ALLOC_BUFFERS flag to make the client alloc buffer
memory.
This commit is contained in:
Wim Taymans 2019-07-26 15:53:26 +02:00
parent deb6c52f76
commit e76a7abceb
18 changed files with 375 additions and 147 deletions

View file

@ -394,12 +394,14 @@ static int negotiate_formats(struct data *data)
init_buffer(data, data->source_buffers, data->source_buffer, 1, BUFFER_SIZE);
if ((res =
spa_node_port_use_buffers(data->sink, SPA_DIRECTION_INPUT, 0, 0, data->source_buffers,
1)) < 0)
spa_node_port_use_buffers(data->sink,
SPA_DIRECTION_INPUT, 0, 0,
data->source_buffers, 1)) < 0)
return res;
if ((res =
spa_node_port_use_buffers(data->source, SPA_DIRECTION_OUTPUT, 0, 0, data->source_buffers,
1)) < 0)
spa_node_port_use_buffers(data->source,
SPA_DIRECTION_OUTPUT, 0, 0,
data->source_buffers, 1)) < 0)
return res;
return 0;