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

@ -476,7 +476,7 @@ struct pw_port_implementation {
int (*init_mix) (void *data, struct pw_port_mix *mix);
int (*release_mix) (void *data, struct pw_port_mix *mix);
int (*use_buffers) (void *data, struct spa_buffer **buffers, uint32_t n_buffers);
int (*use_buffers) (void *data, uint32_t flags, struct spa_buffer **buffers, uint32_t n_buffers);
int (*alloc_buffers) (void *data, struct spa_pod **params, uint32_t n_params,
struct spa_buffer **buffers, uint32_t *n_buffers);
};
@ -492,7 +492,7 @@ struct pw_port_implementation {
#define pw_port_call_init_mix(p,m) pw_port_call(p,init_mix,0,m)
#define pw_port_call_release_mix(p,m) pw_port_call(p,release_mix,0,m)
#define pw_port_call_use_buffers(p,b,n) pw_port_call(p,use_buffers,0,b,n)
#define pw_port_call_use_buffers(p,f,b,n) pw_port_call(p,use_buffers,0,f,b,n)
#define pw_port_call_alloc_buffers(p,pp,np,b,n) pw_port_call(p,alloc_buffers,0,pp,np,b,n)
#define pw_port_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_port_events, m, v, ##__VA_ARGS__)
@ -876,7 +876,7 @@ int pw_port_set_param(struct pw_port *port,
uint32_t id, uint32_t flags, const struct spa_pod *param);
/** Use buffers on a port \memberof pw_port */
int pw_port_use_buffers(struct pw_port *port, uint32_t mix_id,
int pw_port_use_buffers(struct pw_port *port, uint32_t mix_id, uint32_t flags,
struct spa_buffer **buffers, uint32_t n_buffers);
/** Allocate memory for buffers on a port \memberof pw_port */