Work on cleanup

Add signal handlers for daemon to shut down
Add destroy listeners for modules and do cleanup
Fix some leaks
Simplify port registration in new nodes
Hide some more data structures
Let the node implementation take care of the reuse_buffer signal because
then we can get to the graph nodes to find the destination port.
Destroy modules in core cleanup. Modules should undo everything they
have done.
Activate the link after we negotiated format and buffers.
This commit is contained in:
Wim Taymans 2017-08-22 18:30:10 +02:00
parent 12e2fae8ab
commit c25834a692
31 changed files with 586 additions and 344 deletions

View file

@ -102,6 +102,8 @@ struct pw_node_events {
void (*need_input) (void *data);
/** the node has output */
void (*have_output) (void *data);
/** the node has a buffer to reuse */
void (*reuse_buffer) (void *data, uint32_t port_id, uint32_t buffer_id);
};
/** Create a new node \memberof pw_node */
@ -119,6 +121,10 @@ void pw_node_register(struct pw_node *node);
/** Destroy a node */
void pw_node_destroy(struct pw_node *node);
void pw_node_set_max_ports(struct pw_node *node,
uint32_t max_input_ports,
uint32_t max_output_ports);
const struct pw_node_info *pw_node_get_info(struct pw_node *node);
void * pw_node_get_user_data(struct pw_node *node);
@ -142,6 +148,8 @@ void pw_node_add_listener(struct pw_node *node,
const struct pw_node_events *events,
void *data);
struct spa_hook_list *pw_node_get_listeners(struct pw_node *node);
/** iterate the ports in the given direction */
bool pw_node_for_each_port(struct pw_node *node,
enum pw_direction direction,