node: implement activation

Make an eventfd for each node and listen for events when the node
is activated.
Reorganize some graphs links to make it possible to activiate nodes
by signaling the eventfd
Pass the peer node to each remote node and let the remote node
directly activate the peer when needed.
Let each node signal the driver node when finished.
With this we don't need to go through the daemon to schedule the
graph, nodes will simply activate eachother. We only go to the
server when there is a server node to schedule.
Keep stats about the state of each node and the time it was
triggered, running and finished.
This commit is contained in:
Wim Taymans 2019-02-12 17:42:33 +01:00
parent f45e0b8966
commit 5de7898808
15 changed files with 470 additions and 173 deletions

View file

@ -178,7 +178,8 @@ pw_client_node_proxy_event(struct pw_client_node_proxy *p, struct spa_event *eve
#define PW_CLIENT_NODE_PROXY_EVENT_PORT_USE_BUFFERS 9
#define PW_CLIENT_NODE_PROXY_EVENT_PORT_COMMAND 10
#define PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_IO 11
#define PW_CLIENT_NODE_PROXY_EVENT_NUM 12
#define PW_CLIENT_NODE_PROXY_EVENT_SET_ACTIVATION 12
#define PW_CLIENT_NODE_PROXY_EVENT_NUM 13
/** \ref pw_client_node events */
struct pw_client_node_proxy_events {
@ -351,6 +352,13 @@ struct pw_client_node_proxy_events {
uint32_t mem_id,
uint32_t offset,
uint32_t size);
void (*set_activation) (void *object,
uint32_t node_id,
int signalfd,
uint32_t mem_id,
uint32_t offset,
uint32_t size);
};
static inline void
@ -386,6 +394,8 @@ pw_client_node_proxy_add_listener(struct pw_client_node_proxy *p,
pw_resource_notify(r,struct pw_client_node_proxy_events,port_command,__VA_ARGS__)
#define pw_client_node_resource_port_set_io(r,...) \
pw_resource_notify(r,struct pw_client_node_proxy_events,port_set_io,__VA_ARGS__)
#define pw_client_node_resource_set_activation(r,...) \
pw_resource_notify(r,struct pw_client_node_proxy_events,set_activation,__VA_ARGS__)
#ifdef __cplusplus
} /* extern "C" */