mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
cleanups
Remove signals. Rename callbacks -> events, use listeners to listen for events. Callbacks are still used in spa for things you can listen to only once.
This commit is contained in:
parent
b898eb46cd
commit
1b79419554
64 changed files with 779 additions and 880 deletions
|
|
@ -33,7 +33,7 @@ struct impl {
|
|||
struct pw_module *module;
|
||||
struct pw_properties *properties;
|
||||
|
||||
struct pw_callback_info core_callbacks;
|
||||
struct pw_listener core_listener;
|
||||
|
||||
struct spa_list node_list;
|
||||
};
|
||||
|
|
@ -43,10 +43,10 @@ struct node_info {
|
|||
|
||||
struct impl *impl;
|
||||
struct pw_node *node;
|
||||
struct pw_callback_info node_callbacks;
|
||||
struct pw_listener node_listener;
|
||||
|
||||
struct pw_link *link;
|
||||
struct pw_callback_info link_callbacks;
|
||||
struct pw_listener link_listener;
|
||||
};
|
||||
|
||||
static struct node_info *find_node_info(struct impl *impl, struct pw_node *node)
|
||||
|
|
@ -63,8 +63,8 @@ static struct node_info *find_node_info(struct impl *impl, struct pw_node *node)
|
|||
static void node_info_free(struct node_info *info)
|
||||
{
|
||||
spa_list_remove(&info->l);
|
||||
pw_callback_remove(&info->node_callbacks);
|
||||
pw_callback_remove(&info->link_callbacks);
|
||||
pw_listener_remove(&info->node_listener);
|
||||
pw_listener_remove(&info->link_listener);
|
||||
free(info);
|
||||
}
|
||||
|
||||
|
|
@ -130,12 +130,12 @@ link_destroy(void *data)
|
|||
struct impl *impl = info->impl;
|
||||
|
||||
pw_log_debug("module %p: link %p destroyed", impl, link);
|
||||
pw_callback_remove(&info->link_callbacks);
|
||||
spa_list_init(&info->link_callbacks.link);
|
||||
pw_listener_remove(&info->link_listener);
|
||||
spa_list_init(&info->link_listener.link);
|
||||
}
|
||||
|
||||
static const struct pw_link_callbacks link_callbacks = {
|
||||
PW_VERSION_LINK_CALLBACKS,
|
||||
static const struct pw_link_events link_events = {
|
||||
PW_VERSION_LINK_EVENTS,
|
||||
.destroy = link_destroy,
|
||||
.port_unlinked = link_port_unlinked,
|
||||
.state_changed = link_state_changed,
|
||||
|
|
@ -185,7 +185,7 @@ static void try_link_port(struct pw_node *node, struct pw_port *port, struct nod
|
|||
|
||||
info->link = link;
|
||||
|
||||
pw_link_add_callbacks(link, &info->link_callbacks, &link_callbacks, info);
|
||||
pw_link_add_listener(link, &info->link_listener, &link_events, info);
|
||||
pw_link_activate(link);
|
||||
|
||||
return;
|
||||
|
|
@ -230,8 +230,8 @@ node_state_changed(void *data, enum pw_node_state old, enum pw_node_state state,
|
|||
on_node_created(info->node, info);
|
||||
}
|
||||
|
||||
static const struct pw_node_callbacks node_callbacks = {
|
||||
PW_VERSION_NODE_CALLBACKS,
|
||||
static const struct pw_node_events node_events = {
|
||||
PW_VERSION_NODE_EVENTS,
|
||||
.port_added = node_port_added,
|
||||
.port_removed = node_port_removed,
|
||||
.state_changed = node_state_changed,
|
||||
|
|
@ -252,8 +252,8 @@ core_global_added(void *data, struct pw_global *global)
|
|||
|
||||
spa_list_insert(impl->node_list.prev, &ninfo->l);
|
||||
|
||||
pw_node_add_callbacks(node, &ninfo->node_callbacks, &node_callbacks, ninfo);
|
||||
spa_list_init(&ninfo->link_callbacks.link);
|
||||
pw_node_add_listener(node, &ninfo->node_listener, &node_events, ninfo);
|
||||
spa_list_init(&ninfo->link_listener.link);
|
||||
|
||||
pw_log_debug("module %p: node %p added", impl, node);
|
||||
|
||||
|
|
@ -279,8 +279,8 @@ core_global_removed(void *data, struct pw_global *global)
|
|||
}
|
||||
|
||||
|
||||
const struct pw_core_callbacks core_callbacks = {
|
||||
PW_VERSION_CORE_CALLBACKS,
|
||||
const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
.global_added = core_global_added,
|
||||
.global_removed = core_global_removed,
|
||||
};
|
||||
|
|
@ -308,7 +308,7 @@ static bool module_init(struct pw_module *module, struct pw_properties *properti
|
|||
|
||||
spa_list_init(&impl->node_list);
|
||||
|
||||
pw_core_add_callbacks(core, &impl->core_callbacks, &core_callbacks, impl);
|
||||
pw_core_add_listener(core, &impl->core_listener, &core_events, impl);
|
||||
|
||||
return impl;
|
||||
}
|
||||
|
|
@ -318,14 +318,7 @@ static void module_destroy(struct impl *impl)
|
|||
{
|
||||
pw_log_debug("module %p: destroy", impl);
|
||||
|
||||
pw_global_destroy(impl->global);
|
||||
|
||||
pw_signal_remove(&impl->global_added);
|
||||
pw_signal_remove(&impl->global_removed);
|
||||
pw_signal_remove(&impl->port_added);
|
||||
pw_signal_remove(&impl->port_removed);
|
||||
pw_signal_remove(&impl->port_unlinked);
|
||||
pw_signal_remove(&impl->link_state_changed);
|
||||
pw_listener_remove(&impl->core_listener);
|
||||
free(impl);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ struct impl {
|
|||
|
||||
struct pw_transport *transport;
|
||||
|
||||
struct pw_callback_info node_callbacks;
|
||||
struct pw_callback_info resource_callbacks;
|
||||
struct pw_listener node_listener;
|
||||
struct pw_listener resource_listener;
|
||||
|
||||
int fds[2];
|
||||
int other_fds[2];
|
||||
|
|
@ -904,8 +904,8 @@ static void client_node_destroy(void *data)
|
|||
pw_client_node_destroy(&impl->this);
|
||||
}
|
||||
|
||||
static struct pw_client_node_methods client_node_methods = {
|
||||
PW_VERSION_CLIENT_NODE_METHODS,
|
||||
static struct pw_client_node_proxy_methods client_node_methods = {
|
||||
PW_VERSION_CLIENT_NODE_PROXY_METHODS,
|
||||
.done = client_node_done,
|
||||
.update = client_node_update,
|
||||
.port_update = client_node_port_update,
|
||||
|
|
@ -1071,7 +1071,6 @@ static void client_node_resource_destroy(void *data)
|
|||
struct proxy *proxy = &impl->proxy;
|
||||
|
||||
pw_log_debug("client-node %p: destroy", impl);
|
||||
pw_signal_emit(&this->destroy_signal, this);
|
||||
|
||||
impl->proxy.resource = this->resource = NULL;
|
||||
|
||||
|
|
@ -1091,7 +1090,7 @@ static void node_free(void *data)
|
|||
if (impl->transport)
|
||||
pw_transport_destroy(impl->transport);
|
||||
|
||||
pw_callback_remove(&impl->node_callbacks);
|
||||
pw_listener_remove(&impl->node_listener);
|
||||
|
||||
if (impl->fds[0] != -1)
|
||||
close(impl->fds[0]);
|
||||
|
|
@ -1100,14 +1099,14 @@ static void node_free(void *data)
|
|||
free(impl);
|
||||
}
|
||||
|
||||
static const struct pw_node_callbacks node_callbacks = {
|
||||
PW_VERSION_NODE_CALLBACKS,
|
||||
static const struct pw_node_events node_events = {
|
||||
PW_VERSION_NODE_EVENTS,
|
||||
.free = node_free,
|
||||
.initialized = node_initialized,
|
||||
};
|
||||
|
||||
static const struct pw_resource_callbacks resource_callbacks = {
|
||||
PW_VERSION_RESOURCE_CALLBACKS,
|
||||
static const struct pw_resource_events resource_events = {
|
||||
PW_VERSION_RESOURCE_EVENTS,
|
||||
.destroy = client_node_resource_destroy,
|
||||
};
|
||||
|
||||
|
|
@ -1140,8 +1139,6 @@ struct pw_client_node *pw_client_node_new(struct pw_resource *resource,
|
|||
impl->fds[0] = impl->fds[1] = -1;
|
||||
pw_log_debug("client-node %p: new", impl);
|
||||
|
||||
pw_signal_init(&this->destroy_signal);
|
||||
|
||||
proxy_init(&impl->proxy, NULL, core->support, core->n_support);
|
||||
impl->proxy.impl = impl;
|
||||
|
||||
|
|
@ -1157,17 +1154,17 @@ struct pw_client_node *pw_client_node_new(struct pw_resource *resource,
|
|||
if (this->node == NULL)
|
||||
goto error_no_node;
|
||||
|
||||
pw_resource_add_callbacks(this->resource,
|
||||
&impl->resource_callbacks,
|
||||
&resource_callbacks,
|
||||
impl);
|
||||
pw_resource_add_listener(this->resource,
|
||||
&impl->resource_listener,
|
||||
&resource_events,
|
||||
impl);
|
||||
pw_resource_set_implementation(this->resource,
|
||||
&client_node_methods,
|
||||
impl);
|
||||
|
||||
impl->proxy.resource = this->resource;
|
||||
|
||||
pw_node_add_callbacks(this->node, &impl->node_callbacks, &node_callbacks, impl);
|
||||
pw_node_add_listener(this->node, &impl->node_listener, &node_events, impl);
|
||||
|
||||
return this;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ struct pw_client_node {
|
|||
struct pw_node *node;
|
||||
|
||||
struct pw_resource *resource;
|
||||
|
||||
PW_SIGNAL(destroy_signal, (struct pw_listener *listener, struct pw_client_node *node));
|
||||
};
|
||||
|
||||
struct pw_client_node *
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ client_node_marshal_done(void *object, int seq, int res)
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_DONE);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_DONE);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
|
|
@ -57,7 +57,7 @@ client_node_marshal_update(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_UPDATE);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_UPDATE);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, change_mask,
|
||||
|
|
@ -83,7 +83,7 @@ client_node_marshal_port_update(void *object,
|
|||
struct spa_pod_frame f[2];
|
||||
int i;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_PORT_UPDATE);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_PORT_UPDATE);
|
||||
|
||||
spa_pod_builder_add(b,
|
||||
SPA_POD_TYPE_STRUCT, &f[0],
|
||||
|
|
@ -120,7 +120,7 @@ static void client_node_marshal_event_method(void *object, struct spa_event *eve
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_EVENT);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_EVENT);
|
||||
|
||||
spa_pod_builder_struct(b, &f, SPA_POD_TYPE_POD, event);
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ static void client_node_marshal_destroy(void *object)
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_DESTROY);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_DESTROY);
|
||||
|
||||
spa_pod_builder_struct(b, &f, 0);
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ static bool client_node_demarshal_set_props(void *object, void *data, size_t siz
|
|||
-SPA_POD_TYPE_OBJECT, &props, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, set_props, seq, props);
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, set_props, seq, props);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ static bool client_node_demarshal_event_event(void *object, void *data, size_t s
|
|||
!spa_pod_iter_get(&it, SPA_POD_TYPE_OBJECT, &event, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, event, event);
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, event, event);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ static bool client_node_demarshal_add_port(void *object, void *data, size_t size
|
|||
SPA_POD_TYPE_INT, &direction, SPA_POD_TYPE_INT, &port_id, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, add_port, seq, direction, port_id);
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, add_port, seq, direction, port_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -199,7 +199,7 @@ static bool client_node_demarshal_remove_port(void *object, void *data, size_t s
|
|||
SPA_POD_TYPE_INT, &direction, SPA_POD_TYPE_INT, &port_id, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, remove_port, seq, direction, port_id);
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, remove_port, seq, direction, port_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ static bool client_node_demarshal_set_format(void *object, void *data, size_t si
|
|||
-SPA_POD_TYPE_OBJECT, &format, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, set_format, seq, direction, port_id,
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, set_format, seq, direction, port_id,
|
||||
flags, format);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -239,7 +239,7 @@ static bool client_node_demarshal_set_param(void *object, void *data, size_t siz
|
|||
-SPA_POD_TYPE_OBJECT, ¶m, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, set_param, seq, direction, port_id, param);
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, set_param, seq, direction, port_id, param);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ static bool client_node_demarshal_add_mem(void *object, void *data, size_t size)
|
|||
|
||||
memfd = pw_protocol_native_get_proxy_fd(proxy, memfd_idx);
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, add_mem, direction,
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, add_mem, direction,
|
||||
port_id,
|
||||
mem_id,
|
||||
type,
|
||||
|
|
@ -325,7 +325,7 @@ static bool client_node_demarshal_use_buffers(void *object, void *data, size_t s
|
|||
d->data = SPA_UINT32_TO_PTR(data_id);
|
||||
}
|
||||
}
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, use_buffers, seq,
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, use_buffers, seq,
|
||||
direction,
|
||||
port_id,
|
||||
n_buffers, buffers);
|
||||
|
|
@ -343,7 +343,7 @@ static bool client_node_demarshal_node_command(void *object, void *data, size_t
|
|||
!spa_pod_iter_get(&it, SPA_POD_TYPE_INT, &seq, SPA_POD_TYPE_OBJECT, &command, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, node_command, seq, command);
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, node_command, seq, command);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -361,7 +361,7 @@ static bool client_node_demarshal_port_command(void *object, void *data, size_t
|
|||
SPA_POD_TYPE_OBJECT, &command, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, port_command, direction,
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, port_command, direction,
|
||||
port_id,
|
||||
command);
|
||||
return true;
|
||||
|
|
@ -390,7 +390,7 @@ static bool client_node_demarshal_transport(void *object, void *data, size_t siz
|
|||
if (readfd == -1 || writefd == -1 || memfd_idx == -1)
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_client_node_events, transport, node_id,
|
||||
pw_proxy_notify(proxy, struct pw_client_node_proxy_events, transport, node_id,
|
||||
readfd, writefd,
|
||||
memfd, offset, sz);
|
||||
return true;
|
||||
|
|
@ -403,7 +403,7 @@ client_node_marshal_set_props(void *object, uint32_t seq, const struct spa_props
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_SET_PROPS);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_SET_PROPS);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
|
|
@ -418,7 +418,7 @@ static void client_node_marshal_event_event(void *object, const struct spa_event
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_EVENT);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_EVENT);
|
||||
|
||||
spa_pod_builder_struct(b, &f, SPA_POD_TYPE_POD, event);
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ client_node_marshal_add_port(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_ADD_PORT);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_ADD_PORT);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
|
|
@ -450,7 +450,7 @@ client_node_marshal_remove_port(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_REMOVE_PORT);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_REMOVE_PORT);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
|
|
@ -471,7 +471,7 @@ client_node_marshal_set_format(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_SET_FORMAT);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_SET_FORMAT);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
|
|
@ -494,7 +494,7 @@ client_node_marshal_set_param(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_SET_PARAM);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_SET_PARAM);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, seq,
|
||||
|
|
@ -517,7 +517,7 @@ client_node_marshal_add_mem(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_ADD_MEM);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_ADD_MEM);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, direction,
|
||||
|
|
@ -543,7 +543,7 @@ client_node_marshal_use_buffers(void *object,
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, j;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_USE_BUFFERS);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_USE_BUFFERS);
|
||||
|
||||
spa_pod_builder_add(b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
|
|
@ -588,7 +588,7 @@ client_node_marshal_node_command(void *object, uint32_t seq, const struct spa_co
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_NODE_COMMAND);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_NODE_COMMAND);
|
||||
|
||||
spa_pod_builder_struct(b, &f, SPA_POD_TYPE_INT, seq, SPA_POD_TYPE_POD, command);
|
||||
|
||||
|
|
@ -605,7 +605,7 @@ client_node_marshal_port_command(void *object,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_PORT_COMMAND);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_PORT_COMMAND);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, direction,
|
||||
|
|
@ -622,7 +622,7 @@ static void client_node_marshal_transport(void *object, uint32_t node_id, int re
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_TRANSPORT);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_TRANSPORT);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, node_id,
|
||||
|
|
@ -647,7 +647,7 @@ static bool client_node_demarshal_done(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_INT, &res, 0))
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_client_node_methods, done, seq, res);
|
||||
pw_resource_do(resource, struct pw_client_node_proxy_methods, done, seq, res);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -665,7 +665,7 @@ static bool client_node_demarshal_update(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_INT, &max_output_ports, -SPA_POD_TYPE_OBJECT, &props, 0))
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_client_node_methods, update, change_mask,
|
||||
pw_resource_do(resource, struct pw_client_node_proxy_methods, update, change_mask,
|
||||
max_input_ports,
|
||||
max_output_ports,
|
||||
props);
|
||||
|
|
@ -717,7 +717,7 @@ static bool client_node_demarshal_port_update(void *object, void *data, size_t s
|
|||
return false;
|
||||
}
|
||||
|
||||
pw_resource_do(resource, struct pw_client_node_methods, port_update, direction,
|
||||
pw_resource_do(resource, struct pw_client_node_proxy_methods, port_update, direction,
|
||||
port_id,
|
||||
change_mask,
|
||||
n_possible_formats,
|
||||
|
|
@ -738,7 +738,7 @@ static bool client_node_demarshal_event_method(void *object, void *data, size_t
|
|||
!spa_pod_iter_get(&it, SPA_POD_TYPE_OBJECT, &event, 0))
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_client_node_methods, event, event);
|
||||
pw_resource_do(resource, struct pw_client_node_proxy_methods, event, event);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -750,12 +750,12 @@ static bool client_node_demarshal_destroy(void *object, void *data, size_t size)
|
|||
if (!spa_pod_iter_struct(&it, data, size))
|
||||
return false;
|
||||
|
||||
pw_resource_do_na(resource, struct pw_client_node_methods, destroy);
|
||||
pw_resource_do_na(resource, struct pw_client_node_proxy_methods, destroy);
|
||||
return true;
|
||||
}
|
||||
|
||||
static const struct pw_client_node_methods pw_protocol_native_client_node_method_marshal = {
|
||||
PW_VERSION_CLIENT_NODE_METHODS,
|
||||
static const struct pw_client_node_proxy_methods pw_protocol_native_client_node_method_marshal = {
|
||||
PW_VERSION_CLIENT_NODE_PROXY_METHODS,
|
||||
&client_node_marshal_done,
|
||||
&client_node_marshal_update,
|
||||
&client_node_marshal_port_update,
|
||||
|
|
@ -771,8 +771,8 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_
|
|||
{ &client_node_demarshal_destroy, 0 },
|
||||
};
|
||||
|
||||
static const struct pw_client_node_events pw_protocol_native_client_node_event_marshal = {
|
||||
PW_VERSION_CLIENT_NODE_EVENTS,
|
||||
static const struct pw_client_node_proxy_events pw_protocol_native_client_node_event_marshal = {
|
||||
PW_VERSION_CLIENT_NODE_PROXY_EVENTS,
|
||||
&client_node_marshal_transport,
|
||||
&client_node_marshal_set_props,
|
||||
&client_node_marshal_event_event,
|
||||
|
|
@ -803,10 +803,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_
|
|||
const struct pw_protocol_marshal pw_protocol_native_client_node_marshal = {
|
||||
PW_TYPE_INTERFACE__ClientNode,
|
||||
PW_VERSION_CLIENT_NODE,
|
||||
PW_CLIENT_NODE_METHOD_NUM,
|
||||
PW_CLIENT_NODE_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_client_node_method_marshal,
|
||||
&pw_protocol_native_client_node_method_demarshal,
|
||||
PW_CLIENT_NODE_EVENT_NUM,
|
||||
PW_CLIENT_NODE_PROXY_EVENT_NUM,
|
||||
&pw_protocol_native_client_node_event_marshal,
|
||||
pw_protocol_native_client_node_event_demarshal,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ struct impl {
|
|||
|
||||
DBusConnection *bus;
|
||||
|
||||
struct pw_callback_info core_callbacks;
|
||||
struct pw_listener core_listener;
|
||||
|
||||
struct spa_list client_list;
|
||||
|
||||
|
|
@ -54,10 +54,10 @@ struct client_info {
|
|||
struct spa_list link;
|
||||
struct pw_client *client;
|
||||
bool is_sandboxed;
|
||||
const struct pw_core_methods *old_methods;
|
||||
struct pw_core_methods core_methods;
|
||||
const struct pw_core_proxy_methods *old_methods;
|
||||
struct pw_core_proxy_methods core_methods;
|
||||
struct spa_list async_pending;
|
||||
struct pw_callback_info client_callback;
|
||||
struct pw_listener client_listener;
|
||||
};
|
||||
|
||||
struct async_pending {
|
||||
|
|
@ -138,7 +138,7 @@ static void client_info_free(struct client_info *cinfo)
|
|||
spa_list_for_each_safe(p, tmp, &cinfo->async_pending, link)
|
||||
free_pending(p);
|
||||
|
||||
pw_callback_remove(&cinfo->client_callback);
|
||||
pw_listener_remove(&cinfo->client_listener);
|
||||
spa_list_remove(&cinfo->link);
|
||||
free(cinfo);
|
||||
}
|
||||
|
|
@ -447,8 +447,8 @@ static void client_resource_impl(void *data, struct pw_resource *resource)
|
|||
}
|
||||
}
|
||||
|
||||
const struct pw_client_callbacks client_callbacks = {
|
||||
PW_VERSION_CLIENT_CALLBACKS,
|
||||
const struct pw_client_events client_events = {
|
||||
PW_VERSION_CLIENT_EVENTS,
|
||||
.resource_impl = client_resource_impl,
|
||||
};
|
||||
|
||||
|
|
@ -467,7 +467,7 @@ core_global_added(void *data, struct pw_global *global)
|
|||
cinfo->is_sandboxed = client_is_sandboxed(client);
|
||||
spa_list_init(&cinfo->async_pending);
|
||||
|
||||
pw_client_add_callbacks(client, &cinfo->client_callback, &client_callbacks, cinfo);
|
||||
pw_client_add_listener(client, &cinfo->client_listener, &client_events, cinfo);
|
||||
|
||||
spa_list_insert(impl->client_list.prev, &cinfo->link);
|
||||
|
||||
|
|
@ -491,8 +491,8 @@ core_global_removed(void *data, struct pw_global *global)
|
|||
}
|
||||
}
|
||||
|
||||
const struct pw_core_callbacks core_callbacks = {
|
||||
PW_VERSION_CORE_CALLBACKS,
|
||||
const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
.global_added = core_global_added,
|
||||
.global_removed = core_global_removed,
|
||||
};
|
||||
|
|
@ -699,7 +699,7 @@ static struct impl *module_new(struct pw_core *core, struct pw_properties *prope
|
|||
|
||||
spa_list_init(&impl->client_list);
|
||||
|
||||
pw_core_add_callbacks(core, &impl->core_callbacks, &core_callbacks, impl);
|
||||
pw_core_add_listener(core, &impl->core_listener, &core_events, impl);
|
||||
|
||||
core->permission_func = do_permission;
|
||||
core->permission_data = impl;
|
||||
|
|
|
|||
|
|
@ -96,9 +96,9 @@ struct client {
|
|||
struct impl *impl;
|
||||
struct spa_list link;
|
||||
struct pw_client *client;
|
||||
struct pw_listener client_listener;
|
||||
int fd;
|
||||
struct spa_source *source;
|
||||
struct pw_callback_info client_callbacks;
|
||||
};
|
||||
|
||||
static int process_messages(struct client *client);
|
||||
|
|
@ -429,8 +429,8 @@ connection_data(struct spa_loop_utils *utils,
|
|||
process_messages(client);
|
||||
}
|
||||
|
||||
static const struct pw_client_callbacks client_callbacks = {
|
||||
PW_VERSION_CLIENT_CALLBACKS,
|
||||
static const struct pw_client_events client_events = {
|
||||
PW_VERSION_CLIENT_EVENTS,
|
||||
.destroy = client_destroy,
|
||||
.busy_changed = client_busy_changed,
|
||||
};
|
||||
|
|
@ -467,7 +467,7 @@ static struct client *client_new(struct impl *impl, int fd)
|
|||
|
||||
spa_list_insert(impl->client_list.prev, &this->link);
|
||||
|
||||
pw_client_add_callbacks(client, &this->client_callbacks, &client_callbacks, this);
|
||||
pw_client_add_listener(client, &this->client_listener, &client_events, this);
|
||||
|
||||
pw_log_error("module-jack %p: added new client", impl);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,11 +65,12 @@ struct connection {
|
|||
int fd;
|
||||
|
||||
struct spa_source *source;
|
||||
|
||||
struct pw_protocol_native_connection *connection;
|
||||
struct pw_listener conn_listener;
|
||||
|
||||
bool disconnecting;
|
||||
bool flush_signaled;
|
||||
struct pw_listener need_flush;
|
||||
struct spa_source *flush_event;
|
||||
};
|
||||
|
||||
|
|
@ -88,10 +89,10 @@ struct listener {
|
|||
|
||||
struct client_data {
|
||||
struct pw_client *client;
|
||||
struct pw_listener client_listener;
|
||||
int fd;
|
||||
struct spa_source *source;
|
||||
struct pw_protocol_native_connection *connection;
|
||||
struct pw_callback_info client_callbacks;
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
@ -221,8 +222,8 @@ static void client_free(void *data)
|
|||
close(this->fd);
|
||||
}
|
||||
|
||||
static const struct pw_client_callbacks client_callbacks = {
|
||||
PW_VERSION_CLIENT_CALLBACKS,
|
||||
static const struct pw_client_events client_events = {
|
||||
PW_VERSION_CLIENT_EVENTS,
|
||||
.free = client_free,
|
||||
.busy_changed = client_busy_changed,
|
||||
};
|
||||
|
|
@ -264,7 +265,7 @@ static struct pw_client *client_new(struct listener *l, int fd)
|
|||
client->protocol = protocol;
|
||||
spa_list_insert(l->this.client_list.prev, &client->protocol_link);
|
||||
|
||||
pw_client_add_callbacks(client, &this->client_callbacks, &client_callbacks, client);
|
||||
pw_client_add_listener(client, &this->client_listener, &client_events, client);
|
||||
|
||||
pw_global_bind(protocol->core->global, client, PW_PERM_RWX, PW_VERSION_CORE, 0);
|
||||
|
||||
|
|
@ -526,9 +527,9 @@ static void do_flush_event(struct spa_loop_utils *utils, struct spa_source *sour
|
|||
impl->this.disconnect(&impl->this);
|
||||
}
|
||||
|
||||
static void on_need_flush(struct pw_listener *listener, struct pw_protocol_native_connection *connection)
|
||||
static void on_need_flush(void *data)
|
||||
{
|
||||
struct connection *impl = SPA_CONTAINER_OF(listener, struct connection, need_flush);
|
||||
struct connection *impl = data;
|
||||
struct pw_remote *remote = impl->this.remote;
|
||||
|
||||
if (!impl->flush_signaled) {
|
||||
|
|
@ -537,6 +538,11 @@ static void on_need_flush(struct pw_listener *listener, struct pw_protocol_nativ
|
|||
}
|
||||
}
|
||||
|
||||
static const struct pw_protocol_native_connection_events conn_events = {
|
||||
PW_VERSION_PROTOCOL_NATIVE_CONNECTION_EVENTS,
|
||||
.need_flush = on_need_flush,
|
||||
};
|
||||
|
||||
static int impl_connect_fd(struct pw_protocol_connection *conn, int fd)
|
||||
{
|
||||
struct connection *impl = SPA_CONTAINER_OF(conn, struct connection, this);
|
||||
|
|
@ -546,7 +552,10 @@ static int impl_connect_fd(struct pw_protocol_connection *conn, int fd)
|
|||
if (impl->connection == NULL)
|
||||
goto error_close;
|
||||
|
||||
pw_signal_add(&impl->connection->need_flush, &impl->need_flush, on_need_flush);
|
||||
pw_protocol_native_connection_add_listener(impl->connection,
|
||||
&impl->conn_listener,
|
||||
&conn_events,
|
||||
impl);
|
||||
|
||||
impl->fd = fd;
|
||||
impl->source = pw_loop_add_io(remote->core->main_loop,
|
||||
|
|
@ -788,10 +797,6 @@ static void pw_protocol_native_destroy(struct impl *impl)
|
|||
|
||||
pw_log_debug("protocol-native %p: destroy", impl);
|
||||
|
||||
pw_signal_remove(&impl->before_iterate);
|
||||
|
||||
pw_global_destroy(impl->global);
|
||||
|
||||
spa_list_for_each_safe(object, tmp, &impl->object_list, link)
|
||||
object_destroy(object);
|
||||
|
||||
|
|
|
|||
|
|
@ -203,8 +203,7 @@ struct pw_protocol_native_connection *pw_protocol_native_connection_new(int fd)
|
|||
pw_log_debug("connection %p: new", this);
|
||||
|
||||
this->fd = fd;
|
||||
pw_signal_init(&this->need_flush);
|
||||
pw_signal_init(&this->destroy_signal);
|
||||
pw_listener_list_init(&this->listener_list);
|
||||
|
||||
impl->out.buffer_data = malloc(MAX_BUFFER_SIZE);
|
||||
impl->out.buffer_maxsize = MAX_BUFFER_SIZE;
|
||||
|
|
@ -236,7 +235,7 @@ void pw_protocol_native_connection_destroy(struct pw_protocol_native_connection
|
|||
|
||||
pw_log_debug("connection %p: destroy", conn);
|
||||
|
||||
pw_signal_emit(&conn->destroy_signal, conn);
|
||||
pw_listener_list_emit_na(&conn->listener_list, struct pw_protocol_native_connection_events, destroy);
|
||||
|
||||
free(impl->out.buffer_data);
|
||||
free(impl->in.buffer_data);
|
||||
|
|
@ -431,8 +430,7 @@ pw_protocol_native_connection_end(struct pw_protocol_native_connection *conn,
|
|||
printf(">>>>>>>>> out:\n");
|
||||
spa_debug_pod((struct spa_pod *)p);
|
||||
}
|
||||
|
||||
pw_signal_emit(&conn->need_flush, conn);
|
||||
pw_listener_list_emit_na(&conn->listener_list, struct pw_protocol_native_connection_events, need_flush);
|
||||
}
|
||||
|
||||
/** Flush the connection object
|
||||
|
|
|
|||
|
|
@ -25,7 +25,14 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <spa/defs.h>
|
||||
#include <pipewire/sig.h>
|
||||
#include <pipewire/listener.h>
|
||||
|
||||
struct pw_protocol_native_connection_events {
|
||||
#define PW_VERSION_PROTOCOL_NATIVE_CONNECTION_EVENTS 0
|
||||
void (*destroy) (void *data);
|
||||
|
||||
void (*need_flush) (void *data);
|
||||
};
|
||||
|
||||
/** \class pw_protocol_native_connection
|
||||
*
|
||||
|
|
@ -37,14 +44,18 @@ extern "C" {
|
|||
struct pw_protocol_native_connection {
|
||||
int fd; /**< the socket */
|
||||
|
||||
/** Emited when data has been written that needs to be flushed */
|
||||
PW_SIGNAL(need_flush, (struct pw_listener *listener,
|
||||
struct pw_protocol_native_connection *conn));
|
||||
/** Emited when the connection is destroyed */
|
||||
PW_SIGNAL(destroy_signal, (struct pw_listener *listener,
|
||||
struct pw_protocol_native_connection *conn));
|
||||
struct pw_listener_list listener_list;
|
||||
};
|
||||
|
||||
static inline void
|
||||
pw_protocol_native_connection_add_listener(struct pw_protocol_native_connection *conn,
|
||||
struct pw_listener *listener,
|
||||
const struct pw_protocol_native_connection_events *events,
|
||||
void *data)
|
||||
{
|
||||
pw_listener_list_add(&conn->listener_list, listener, events, data);
|
||||
}
|
||||
|
||||
struct pw_protocol_native_connection *
|
||||
pw_protocol_native_connection_new(int fd);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static void core_marshal_client_update(void *object, const struct spa_dict *prop
|
|||
struct spa_pod_frame f;
|
||||
int i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_CLIENT_UPDATE);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_CLIENT_UPDATE);
|
||||
|
||||
n_items = props ? props->n_items : 0;
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ static void core_marshal_sync(void *object, uint32_t seq)
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_SYNC);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_SYNC);
|
||||
|
||||
spa_pod_builder_struct(b, &f, SPA_POD_TYPE_INT, seq);
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ static void core_marshal_get_registry(void *object, uint32_t version, uint32_t n
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_GET_REGISTRY);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_GET_REGISTRY);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, version,
|
||||
|
|
@ -93,7 +93,7 @@ core_marshal_create_node(void *object,
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_CREATE_NODE);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_CREATE_NODE);
|
||||
|
||||
n_items = props ? props->n_items : 0;
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ core_marshal_create_link(void *object,
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_CREATE_LINK);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_CREATE_LINK);
|
||||
|
||||
n_items = props ? props->n_items : 0;
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ core_marshal_update_types_client(void *object, uint32_t first_id, uint32_t n_typ
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_UPDATE_TYPES);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_UPDATE_TYPES);
|
||||
|
||||
spa_pod_builder_add(b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
|
|
@ -205,7 +205,7 @@ static bool core_demarshal_info(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_STRING, &props.items[i].value, 0))
|
||||
return false;
|
||||
}
|
||||
pw_proxy_notify(proxy, struct pw_core_events, info, &info);
|
||||
pw_proxy_notify(proxy, struct pw_core_proxy_events, info, &info);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ static bool core_demarshal_done(void *object, void *data, size_t size)
|
|||
!spa_pod_iter_get(&it, SPA_POD_TYPE_INT, &seq, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_core_events, done, seq);
|
||||
pw_proxy_notify(proxy, struct pw_core_proxy_events, done, seq);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ static bool core_demarshal_error(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_INT, &res, SPA_POD_TYPE_STRING, &error, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_core_events, error, id, res, error);
|
||||
pw_proxy_notify(proxy, struct pw_core_proxy_events, error, id, res, error);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ static bool core_demarshal_remove_id(void *object, void *data, size_t size)
|
|||
!spa_pod_iter_get(&it, SPA_POD_TYPE_INT, &id, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_core_events, remove_id, id);
|
||||
pw_proxy_notify(proxy, struct pw_core_proxy_events, remove_id, id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -271,7 +271,7 @@ static bool core_demarshal_update_types_client(void *object, void *data, size_t
|
|||
if (!spa_pod_iter_get(&it, SPA_POD_TYPE_STRING, &types[i], 0))
|
||||
return false;
|
||||
}
|
||||
pw_proxy_notify(proxy, struct pw_core_events, update_types, first_id, n_types, types);
|
||||
pw_proxy_notify(proxy, struct pw_core_proxy_events, update_types, first_id, n_types, types);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -282,7 +282,7 @@ static void core_marshal_info(void *object, struct pw_core_info *info)
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_INFO);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_INFO);
|
||||
|
||||
n_items = info->props ? info->props->n_items : 0;
|
||||
|
||||
|
|
@ -311,7 +311,7 @@ static void core_marshal_done(void *object, uint32_t seq)
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_DONE);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_DONE);
|
||||
|
||||
spa_pod_builder_struct(b, &f, SPA_POD_TYPE_INT, seq);
|
||||
|
||||
|
|
@ -326,7 +326,7 @@ static void core_marshal_error(void *object, uint32_t id, int res, const char *e
|
|||
struct spa_pod_frame f;
|
||||
va_list ap;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_ERROR);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_ERROR);
|
||||
|
||||
va_start(ap, error);
|
||||
vsnprintf(buffer, sizeof(buffer), error, ap);
|
||||
|
|
@ -346,7 +346,7 @@ static void core_marshal_remove_id(void *object, uint32_t id)
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_REMOVE_ID);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_REMOVE_ID);
|
||||
|
||||
spa_pod_builder_struct(b, &f, SPA_POD_TYPE_INT, id);
|
||||
|
||||
|
|
@ -361,7 +361,7 @@ core_marshal_update_types_server(void *object, uint32_t first_id, uint32_t n_typ
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_UPDATE_TYPES);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_UPDATE_TYPES);
|
||||
|
||||
spa_pod_builder_add(b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
|
|
@ -393,7 +393,7 @@ static bool core_demarshal_client_update(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_STRING, &props.items[i].value, 0))
|
||||
return false;
|
||||
}
|
||||
pw_resource_do(resource, struct pw_core_methods, client_update, &props);
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, client_update, &props);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -407,7 +407,7 @@ static bool core_demarshal_sync(void *object, void *data, size_t size)
|
|||
!spa_pod_iter_get(&it, SPA_POD_TYPE_INT, &seq, 0))
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_core_methods, sync, seq);
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, sync, seq);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -424,7 +424,7 @@ static bool core_demarshal_get_registry(void *object, void *data, size_t size)
|
|||
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_core_methods, get_registry, version, new_id);
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, get_registry, version, new_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -456,7 +456,7 @@ static bool core_demarshal_create_node(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_INT, &new_id, 0))
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_core_methods, create_node, factory_name, name,
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, create_node, factory_name, name,
|
||||
type, version,
|
||||
&props, new_id);
|
||||
return true;
|
||||
|
|
@ -491,7 +491,7 @@ static bool core_demarshal_create_link(void *object, void *data, size_t size)
|
|||
if (!spa_pod_iter_get(&it, SPA_POD_TYPE_INT, &new_id, 0))
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_core_methods, create_link, output_node_id,
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, create_link, output_node_id,
|
||||
output_port_id,
|
||||
input_node_id,
|
||||
input_port_id,
|
||||
|
|
@ -518,7 +518,7 @@ static bool core_demarshal_update_types_server(void *object, void *data, size_t
|
|||
if (!spa_pod_iter_get(&it, SPA_POD_TYPE_STRING, &types[i], 0))
|
||||
return false;
|
||||
}
|
||||
pw_resource_do(resource, struct pw_core_methods, update_types, first_id, n_types, types);
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, update_types, first_id, n_types, types);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -529,7 +529,7 @@ static void registry_marshal_global(void *object, uint32_t id, uint32_t parent_i
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_EVENT_GLOBAL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_PROXY_EVENT_GLOBAL);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, id,
|
||||
|
|
@ -547,7 +547,7 @@ static void registry_marshal_global_remove(void *object, uint32_t id)
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_EVENT_GLOBAL_REMOVE);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_PROXY_EVENT_GLOBAL_REMOVE);
|
||||
|
||||
spa_pod_builder_struct(b, &f, SPA_POD_TYPE_INT, id);
|
||||
|
||||
|
|
@ -568,7 +568,7 @@ static bool registry_demarshal_bind(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_INT, &new_id, 0))
|
||||
return false;
|
||||
|
||||
pw_resource_do(resource, struct pw_registry_methods, bind, id, type, version, new_id);
|
||||
pw_resource_do(resource, struct pw_registry_proxy_methods, bind, id, type, version, new_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -579,7 +579,7 @@ static void module_marshal_info(void *object, struct pw_module_info *info)
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_MODULE_EVENT_INFO);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_MODULE_PROXY_EVENT_INFO);
|
||||
|
||||
n_items = info->props ? info->props->n_items : 0;
|
||||
|
||||
|
|
@ -624,7 +624,7 @@ static bool module_demarshal_info(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_STRING, &props.items[i].value, 0))
|
||||
return false;
|
||||
}
|
||||
pw_proxy_notify(proxy, struct pw_module_events, info, &info);
|
||||
pw_proxy_notify(proxy, struct pw_module_proxy_events, info, &info);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -635,7 +635,7 @@ static void node_marshal_info(void *object, struct pw_node_info *info)
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_NODE_EVENT_INFO);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_NODE_PROXY_EVENT_INFO);
|
||||
|
||||
spa_pod_builder_add(b,
|
||||
SPA_POD_TYPE_STRUCT, &f,
|
||||
|
|
@ -719,7 +719,7 @@ static bool node_demarshal_info(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_STRING, &props.items[i].value, 0))
|
||||
return false;
|
||||
}
|
||||
pw_proxy_notify(proxy, struct pw_node_events, info, &info);
|
||||
pw_proxy_notify(proxy, struct pw_node_proxy_events, info, &info);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -730,7 +730,7 @@ static void client_marshal_info(void *object, struct pw_client_info *info)
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_EVENT_INFO);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CLIENT_PROXY_EVENT_INFO);
|
||||
|
||||
n_items = info->props ? info->props->n_items : 0;
|
||||
|
||||
|
|
@ -771,7 +771,7 @@ static bool client_demarshal_info(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_STRING, &props.items[i].value, 0))
|
||||
return false;
|
||||
}
|
||||
pw_proxy_notify(proxy, struct pw_client_events, info, &info);
|
||||
pw_proxy_notify(proxy, struct pw_client_proxy_events, info, &info);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -781,7 +781,7 @@ static void link_marshal_info(void *object, struct pw_link_info *info)
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_LINK_EVENT_INFO);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_LINK_PROXY_EVENT_INFO);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_LONG, info->change_mask,
|
||||
|
|
@ -810,7 +810,7 @@ static bool link_demarshal_info(void *object, void *data, size_t size)
|
|||
-SPA_POD_TYPE_OBJECT, &info.format, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_link_events, info, &info);
|
||||
pw_proxy_notify(proxy, struct pw_link_proxy_events, info, &info);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -829,7 +829,7 @@ static bool registry_demarshal_global(void *object, void *data, size_t size)
|
|||
SPA_POD_TYPE_INT, &version, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_registry_events, global, id, parent_id, permissions, type, version);
|
||||
pw_proxy_notify(proxy, struct pw_registry_proxy_events, global, id, parent_id, permissions, type, version);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -843,7 +843,7 @@ static bool registry_demarshal_global_remove(void *object, void *data, size_t si
|
|||
!spa_pod_iter_get(&it, SPA_POD_TYPE_INT, &id, 0))
|
||||
return false;
|
||||
|
||||
pw_proxy_notify(proxy, struct pw_registry_events, global_remove, id);
|
||||
pw_proxy_notify(proxy, struct pw_registry_proxy_events, global_remove, id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -854,7 +854,7 @@ static void registry_marshal_bind(void *object, uint32_t id,
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_REGISTRY_METHOD_BIND);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_REGISTRY_PROXY_METHOD_BIND);
|
||||
|
||||
spa_pod_builder_struct(b, &f,
|
||||
SPA_POD_TYPE_INT, id,
|
||||
|
|
@ -865,8 +865,8 @@ static void registry_marshal_bind(void *object, uint32_t id,
|
|||
pw_protocol_native_end_proxy(proxy, b);
|
||||
}
|
||||
|
||||
static const struct pw_core_methods pw_protocol_native_core_method_marshal = {
|
||||
PW_VERSION_CORE_METHODS,
|
||||
static const struct pw_core_proxy_methods pw_protocol_native_core_method_marshal = {
|
||||
PW_VERSION_CORE_PROXY_METHODS,
|
||||
&core_marshal_update_types_client,
|
||||
&core_marshal_sync,
|
||||
&core_marshal_get_registry,
|
||||
|
|
@ -875,7 +875,7 @@ static const struct pw_core_methods pw_protocol_native_core_method_marshal = {
|
|||
&core_marshal_create_link
|
||||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_METHOD_NUM] = {
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_PROXY_METHOD_NUM] = {
|
||||
{ &core_demarshal_update_types_server, 0, },
|
||||
{ &core_demarshal_sync, 0, },
|
||||
{ &core_demarshal_get_registry, 0, },
|
||||
|
|
@ -884,8 +884,8 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_
|
|||
{ &core_demarshal_create_link, PW_PROTOCOL_NATIVE_REMAP, }
|
||||
};
|
||||
|
||||
static const struct pw_core_events pw_protocol_native_core_event_marshal = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
static const struct pw_core_proxy_events pw_protocol_native_core_event_marshal = {
|
||||
PW_VERSION_CORE_PROXY_EVENTS,
|
||||
&core_marshal_update_types_server,
|
||||
&core_marshal_done,
|
||||
&core_marshal_error,
|
||||
|
|
@ -893,7 +893,7 @@ static const struct pw_core_events pw_protocol_native_core_event_marshal = {
|
|||
&core_marshal_info
|
||||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_demarshal[PW_CORE_EVENT_NUM] = {
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_demarshal[PW_CORE_PROXY_EVENT_NUM] = {
|
||||
{ &core_demarshal_update_types_client, 0, },
|
||||
{ &core_demarshal_done, 0, },
|
||||
{ &core_demarshal_error, 0, },
|
||||
|
|
@ -904,16 +904,16 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_d
|
|||
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
|
||||
PW_TYPE_INTERFACE__Core,
|
||||
PW_VERSION_CORE,
|
||||
PW_CORE_METHOD_NUM,
|
||||
PW_CORE_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_core_method_marshal,
|
||||
pw_protocol_native_core_method_demarshal,
|
||||
PW_CORE_EVENT_NUM,
|
||||
PW_CORE_PROXY_EVENT_NUM,
|
||||
&pw_protocol_native_core_event_marshal,
|
||||
pw_protocol_native_core_event_demarshal
|
||||
};
|
||||
|
||||
static const struct pw_registry_methods pw_protocol_native_registry_method_marshal = {
|
||||
PW_VERSION_REGISTRY_METHODS,
|
||||
static const struct pw_registry_proxy_methods pw_protocol_native_registry_method_marshal = {
|
||||
PW_VERSION_REGISTRY_PROXY_METHODS,
|
||||
®istry_marshal_bind
|
||||
};
|
||||
|
||||
|
|
@ -921,8 +921,8 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_registry_met
|
|||
{ ®istry_demarshal_bind, PW_PROTOCOL_NATIVE_REMAP, }
|
||||
};
|
||||
|
||||
static const struct pw_registry_events pw_protocol_native_registry_event_marshal = {
|
||||
PW_VERSION_REGISTRY_EVENTS,
|
||||
static const struct pw_registry_proxy_events pw_protocol_native_registry_event_marshal = {
|
||||
PW_VERSION_REGISTRY_PROXY_EVENTS,
|
||||
®istry_marshal_global,
|
||||
®istry_marshal_global_remove,
|
||||
};
|
||||
|
|
@ -935,16 +935,16 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_registry_eve
|
|||
const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
|
||||
PW_TYPE_INTERFACE__Registry,
|
||||
PW_VERSION_REGISTRY,
|
||||
PW_REGISTRY_METHOD_NUM,
|
||||
PW_REGISTRY_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_registry_method_marshal,
|
||||
pw_protocol_native_registry_method_demarshal,
|
||||
PW_REGISTRY_EVENT_NUM,
|
||||
PW_REGISTRY_PROXY_EVENT_NUM,
|
||||
&pw_protocol_native_registry_event_marshal,
|
||||
pw_protocol_native_registry_event_demarshal,
|
||||
};
|
||||
|
||||
static const struct pw_module_events pw_protocol_native_module_event_marshal = {
|
||||
PW_VERSION_MODULE_EVENTS,
|
||||
static const struct pw_module_proxy_events pw_protocol_native_module_event_marshal = {
|
||||
PW_VERSION_MODULE_PROXY_EVENTS,
|
||||
&module_marshal_info,
|
||||
};
|
||||
|
||||
|
|
@ -956,13 +956,13 @@ const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
|
|||
PW_TYPE_INTERFACE__Module,
|
||||
PW_VERSION_MODULE,
|
||||
0, NULL, NULL,
|
||||
PW_MODULE_EVENT_NUM,
|
||||
PW_MODULE_PROXY_EVENT_NUM,
|
||||
&pw_protocol_native_module_event_marshal,
|
||||
pw_protocol_native_module_event_demarshal,
|
||||
};
|
||||
|
||||
static const struct pw_node_events pw_protocol_native_node_event_marshal = {
|
||||
PW_VERSION_NODE_EVENTS,
|
||||
static const struct pw_node_proxy_events pw_protocol_native_node_event_marshal = {
|
||||
PW_VERSION_NODE_PROXY_EVENTS,
|
||||
&node_marshal_info,
|
||||
};
|
||||
|
||||
|
|
@ -974,13 +974,13 @@ static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
|
|||
PW_TYPE_INTERFACE__Node,
|
||||
PW_VERSION_NODE,
|
||||
0, NULL, NULL,
|
||||
PW_NODE_EVENT_NUM,
|
||||
PW_NODE_PROXY_EVENT_NUM,
|
||||
&pw_protocol_native_node_event_marshal,
|
||||
pw_protocol_native_node_event_demarshal,
|
||||
};
|
||||
|
||||
static const struct pw_client_events pw_protocol_native_client_event_marshal = {
|
||||
PW_VERSION_CLIENT_EVENTS,
|
||||
static const struct pw_client_proxy_events pw_protocol_native_client_event_marshal = {
|
||||
PW_VERSION_CLIENT_PROXY_EVENTS,
|
||||
&client_marshal_info,
|
||||
};
|
||||
|
||||
|
|
@ -992,13 +992,13 @@ static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
|
|||
PW_TYPE_INTERFACE__Client,
|
||||
PW_VERSION_CLIENT,
|
||||
0, NULL, NULL,
|
||||
PW_CLIENT_EVENT_NUM,
|
||||
PW_CLIENT_PROXY_EVENT_NUM,
|
||||
&pw_protocol_native_client_event_marshal,
|
||||
pw_protocol_native_client_event_demarshal,
|
||||
};
|
||||
|
||||
static const struct pw_link_events pw_protocol_native_link_event_marshal = {
|
||||
PW_VERSION_LINK_EVENTS,
|
||||
static const struct pw_link_proxy_events pw_protocol_native_link_event_marshal = {
|
||||
PW_VERSION_LINK_PROXY_EVENTS,
|
||||
&link_marshal_info,
|
||||
};
|
||||
|
||||
|
|
@ -1010,7 +1010,7 @@ static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
|
|||
PW_TYPE_INTERFACE__Link,
|
||||
PW_VERSION_LINK,
|
||||
0, NULL, NULL,
|
||||
PW_LINK_EVENT_NUM,
|
||||
PW_LINK_PROXY_EVENT_NUM,
|
||||
&pw_protocol_native_link_event_marshal,
|
||||
pw_protocol_native_link_event_demarshal,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct impl {
|
|||
struct pw_type *t;
|
||||
struct pw_properties *properties;
|
||||
|
||||
struct pw_callback_info core_callbacks;
|
||||
struct pw_listener core_listener;
|
||||
|
||||
struct spa_list node_list;
|
||||
};
|
||||
|
|
@ -40,7 +40,7 @@ struct node_info {
|
|||
struct spa_list link;
|
||||
struct impl *impl;
|
||||
struct pw_node *node;
|
||||
struct pw_callback_info node_callbacks;
|
||||
struct pw_listener node_listener;
|
||||
struct spa_source *idle_timeout;
|
||||
};
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ static void node_info_free(struct node_info *info)
|
|||
{
|
||||
spa_list_remove(&info->link);
|
||||
remove_idle_timeout(info);
|
||||
pw_callback_remove(&info->node_callbacks);
|
||||
pw_listener_remove(&info->node_listener);
|
||||
free(info);
|
||||
}
|
||||
|
||||
|
|
@ -107,8 +107,8 @@ node_state_changed(void *data, enum pw_node_state old, enum pw_node_state state,
|
|||
}
|
||||
}
|
||||
|
||||
static const struct pw_node_callbacks node_callbacks = {
|
||||
PW_VERSION_NODE_CALLBACKS,
|
||||
static const struct pw_node_events node_events = {
|
||||
PW_VERSION_NODE_EVENTS,
|
||||
.state_request = node_state_request,
|
||||
.state_changed = node_state_changed,
|
||||
};
|
||||
|
|
@ -127,7 +127,7 @@ core_global_added(void *data, struct pw_global *global)
|
|||
info->node = node;
|
||||
spa_list_insert(impl->node_list.prev, &info->link);
|
||||
|
||||
pw_node_add_callbacks(node, &info->node_callbacks, &node_callbacks, info);
|
||||
pw_node_add_listener(node, &info->node_listener, &node_events, info);
|
||||
|
||||
pw_log_debug("module %p: node %p added", impl, node);
|
||||
}
|
||||
|
|
@ -149,8 +149,8 @@ core_global_removed(void *data, struct pw_global *global)
|
|||
}
|
||||
}
|
||||
|
||||
const struct pw_core_callbacks core_callbacks = {
|
||||
PW_VERSION_CORE_CALLBACKS,
|
||||
const struct pw_core_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
.global_added = core_global_added,
|
||||
.global_removed = core_global_removed,
|
||||
};
|
||||
|
|
@ -177,7 +177,7 @@ static bool module_init(struct pw_module *module, struct pw_properties *properti
|
|||
|
||||
spa_list_init(&impl->node_list);
|
||||
|
||||
pw_core_add_callbacks(impl->core, &impl->core_callbacks, &core_callbacks, impl);
|
||||
pw_core_add_listener(impl->core, &impl->core_listener, &core_events, impl);
|
||||
|
||||
return impl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,7 +276,6 @@ struct pw_spa_monitor *pw_spa_monitor_load(struct pw_core *core,
|
|||
impl->hnd = hnd;
|
||||
|
||||
this = &impl->this;
|
||||
pw_signal_init(&this->destroy_signal);
|
||||
this->monitor = iface;
|
||||
this->lib = filename;
|
||||
this->factory_name = strdup(factory_name);
|
||||
|
|
@ -321,7 +320,6 @@ void pw_spa_monitor_destroy(struct pw_spa_monitor *monitor)
|
|||
struct monitor_item *mitem, *tmp;
|
||||
|
||||
pw_log_debug("spa-monitor %p: dispose", impl);
|
||||
pw_signal_emit(&monitor->destroy_signal, monitor);
|
||||
|
||||
spa_list_for_each_safe(mitem, tmp, &impl->item_list, link)
|
||||
destroy_item(mitem);
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ struct pw_spa_monitor {
|
|||
char *factory_name;
|
||||
char *system_name;
|
||||
struct spa_handle *handle;
|
||||
|
||||
PW_SIGNAL(destroy_signal, (struct pw_listener *listener, struct pw_spa_monitor *monitor));
|
||||
};
|
||||
|
||||
struct pw_spa_monitor *
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ struct impl {
|
|||
char *lib;
|
||||
char *factory_name;
|
||||
|
||||
struct pw_callback_info node_callbacks;
|
||||
struct pw_listener node_listener;
|
||||
};
|
||||
|
||||
struct port {
|
||||
|
|
@ -337,7 +337,7 @@ static void on_node_done(struct spa_node *node, int seq, int res, void *user_dat
|
|||
}
|
||||
|
||||
pw_log_debug("spa-node %p: async complete event %d %d", this, seq, res);
|
||||
pw_callback_emit(&this->callback_list, struct pw_node_callbacks, async_complete, seq, res);
|
||||
pw_listener_list_emit(&this->listener_list, struct pw_node_events, async_complete, seq, res);
|
||||
}
|
||||
|
||||
static void on_node_event(struct spa_node *node, struct spa_event *event, void *user_data)
|
||||
|
|
@ -345,21 +345,21 @@ static void on_node_event(struct spa_node *node, struct spa_event *event, void *
|
|||
struct impl *impl = user_data;
|
||||
struct pw_node *this = impl->this;
|
||||
|
||||
pw_callback_emit(&this->callback_list, struct pw_node_callbacks, event, event);
|
||||
pw_listener_list_emit(&this->listener_list, struct pw_node_events, event, event);
|
||||
}
|
||||
|
||||
static void on_node_need_input(struct spa_node *node, void *user_data)
|
||||
{
|
||||
struct impl *impl = user_data;
|
||||
struct pw_node *this = impl->this;
|
||||
pw_callback_emit_na(&this->callback_list, struct pw_node_callbacks, need_input);
|
||||
pw_listener_list_emit_na(&this->listener_list, struct pw_node_events, need_input);
|
||||
}
|
||||
|
||||
static void on_node_have_output(struct spa_node *node, void *user_data)
|
||||
{
|
||||
struct impl *impl = user_data;
|
||||
struct pw_node *this = impl->this;
|
||||
pw_callback_emit_na(&this->callback_list, struct pw_node_callbacks, have_output);
|
||||
pw_listener_list_emit_na(&this->listener_list, struct pw_node_events, have_output);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -390,8 +390,8 @@ static const struct spa_node_callbacks spa_node_callbacks = {
|
|||
.reuse_buffer = on_node_reuse_buffer,
|
||||
};
|
||||
|
||||
static const struct pw_node_callbacks node_callbacks = {
|
||||
PW_VERSION_NODE_CALLBACKS,
|
||||
static const struct pw_node_events node_events = {
|
||||
PW_VERSION_NODE_EVENTS,
|
||||
.destroy = pw_spa_node_destroy,
|
||||
};
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ pw_spa_node_new(struct pw_core *core,
|
|||
impl->node = node;
|
||||
impl->async_init = async;
|
||||
|
||||
pw_node_add_callbacks(this, &impl->node_callbacks, &node_callbacks, impl);
|
||||
pw_node_add_listener(this, &impl->node_listener, &node_events, impl);
|
||||
|
||||
pw_node_set_implementation(this, &node_impl, impl);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue