mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
node: add finish hook
Add a finish hook to signal when the graph of a driver node finished.
This commit is contained in:
parent
99d94044d1
commit
76ed4e9468
2 changed files with 20 additions and 1 deletions
|
|
@ -405,6 +405,23 @@ static void check_properties(struct pw_node *node)
|
||||||
SPA_FLAG_UNSET(impl->driver_graph.flags, SPA_GRAPH_FLAG_DRIVER);
|
SPA_FLAG_UNSET(impl->driver_graph.flags, SPA_GRAPH_FLAG_DRIVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int driver_impl_finish(void *data)
|
||||||
|
{
|
||||||
|
struct impl *impl = SPA_CONTAINER_OF(data, struct impl, driver_data);
|
||||||
|
struct spa_graph_data *d = &impl->graph_data;
|
||||||
|
struct pw_node *this = &impl->this;
|
||||||
|
|
||||||
|
pw_log_trace("graph %p finish %p", d->graph, impl);
|
||||||
|
spa_hook_list_call(&this->listener_list, struct pw_node_events, finish);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct spa_graph_callbacks driver_impl_default = {
|
||||||
|
SPA_VERSION_GRAPH_CALLBACKS,
|
||||||
|
.run = spa_graph_impl_run,
|
||||||
|
.finish = driver_impl_finish,
|
||||||
|
};
|
||||||
|
|
||||||
struct pw_node *pw_node_new(struct pw_core *core,
|
struct pw_node *pw_node_new(struct pw_core *core,
|
||||||
const char *name,
|
const char *name,
|
||||||
struct pw_properties *properties,
|
struct pw_properties *properties,
|
||||||
|
|
@ -454,7 +471,7 @@ struct pw_node *pw_node_new(struct pw_core *core,
|
||||||
spa_graph_init(&impl->driver_graph, &impl->driver_state);
|
spa_graph_init(&impl->driver_graph, &impl->driver_state);
|
||||||
spa_graph_data_init(&impl->driver_data, &impl->driver_graph);
|
spa_graph_data_init(&impl->driver_data, &impl->driver_graph);
|
||||||
spa_graph_set_callbacks(&impl->driver_graph,
|
spa_graph_set_callbacks(&impl->driver_graph,
|
||||||
&spa_graph_impl_default, &impl->driver_data);
|
&driver_impl_default, &impl->driver_data);
|
||||||
|
|
||||||
this->rt.activation = &impl->root_activation;
|
this->rt.activation = &impl->root_activation;
|
||||||
spa_graph_node_init(&this->rt.root, &this->rt.activation->state);
|
spa_graph_node_init(&this->rt.root, &this->rt.activation->state);
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ struct pw_node_events {
|
||||||
void (*process) (void *data);
|
void (*process) (void *data);
|
||||||
/** the node has a buffer to reuse */
|
/** the node has a buffer to reuse */
|
||||||
void (*reuse_buffer) (void *data, uint32_t port_id, uint32_t buffer_id);
|
void (*reuse_buffer) (void *data, uint32_t port_id, uint32_t buffer_id);
|
||||||
|
|
||||||
|
void (*finish) (void *data);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Automatically connect this node to a compatible node */
|
/** Automatically connect this node to a compatible node */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue