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:
Wim Taymans 2019-07-25 13:19:39 +02:00
parent b314547702
commit 8590ac158b
33 changed files with 153 additions and 122 deletions

View file

@ -187,11 +187,13 @@ struct impl {
pw_client_node_resource(r,port_set_io,0,__VA_ARGS__)
#define pw_client_node_resource_set_activation(r,...) \
pw_client_node_resource(r,set_activation,0,__VA_ARGS__)
static int
do_port_use_buffers(struct impl *impl,
enum spa_direction direction,
uint32_t port_id,
uint32_t mix_id,
uint32_t flags,
struct spa_buffer **buffers,
uint32_t n_buffers);
@ -268,7 +270,7 @@ static void mix_clear(struct node *this, struct mix *mix)
if (!mix->valid)
return;
do_port_use_buffers(this->impl, port->direction, port->id,
mix->id, NULL, 0);
mix->id, 0, NULL, 0);
mix->valid = false;
}
@ -695,6 +697,7 @@ do_port_use_buffers(struct impl *impl,
enum spa_direction direction,
uint32_t port_id,
uint32_t mix_id,
uint32_t flags,
struct spa_buffer **buffers,
uint32_t n_buffers)
{
@ -811,7 +814,7 @@ do_port_use_buffers(struct impl *impl,
}
return pw_client_node_resource_port_use_buffers(this->resource,
direction, port_id, mix_id,
direction, port_id, mix_id, flags,
n_buffers, mb);
}
@ -819,6 +822,7 @@ static int
impl_node_port_use_buffers(void *object,
enum spa_direction direction,
uint32_t port_id,
uint32_t flags,
struct spa_buffer **buffers,
uint32_t n_buffers)
{
@ -830,7 +834,7 @@ impl_node_port_use_buffers(void *object,
impl = this->impl;
return do_port_use_buffers(impl, direction, port_id,
SPA_ID_INVALID, buffers, n_buffers);
SPA_ID_INVALID, flags, buffers, n_buffers);
}
static int
@ -1344,13 +1348,14 @@ static int
impl_mix_port_use_buffers(void *object,
enum spa_direction direction,
uint32_t mix_id,
uint32_t flags,
struct spa_buffer **buffers,
uint32_t n_buffers)
{
struct port *port = object;
struct impl *impl = port->impl;
return do_port_use_buffers(impl, direction, port->id, mix_id, buffers, n_buffers);
return do_port_use_buffers(impl, direction, port->id, mix_id, flags, buffers, n_buffers);
}
static int