mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
interfaces: make events return void
Events are dispatched with hooks and have no return value. Make it possible to get the last resource and proxy sender value for where we need it.
This commit is contained in:
parent
0390969228
commit
09c4683ef1
29 changed files with 269 additions and 330 deletions
|
|
@ -59,12 +59,12 @@ static int core_method_marshal_sync(void *object, uint32_t id, int seq)
|
|||
return pw_protocol_native_end_proxy(proxy, b);
|
||||
}
|
||||
|
||||
static int core_method_marshal_done(void *object, uint32_t id, int seq)
|
||||
static int core_method_marshal_pong(void *object, uint32_t id, int seq)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_DONE, NULL);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_PONG, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -228,7 +228,7 @@ static int core_event_demarshal_done(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, done, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_sync(void *object, void *data, size_t size)
|
||||
static int core_event_demarshal_ping(void *object, void *data, size_t size)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_parser prs;
|
||||
|
|
@ -240,7 +240,7 @@ static int core_event_demarshal_sync(void *object, void *data, size_t size)
|
|||
SPA_POD_Int(&seq)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, sync, 0, id, seq);
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, ping, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_error(void *object, void *data, size_t size)
|
||||
|
|
@ -275,7 +275,7 @@ static int core_event_demarshal_remove_id(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, remove_id, 0, id);
|
||||
}
|
||||
|
||||
static int core_event_marshal_info(void *object, const struct pw_core_info *info)
|
||||
static void core_event_marshal_info(void *object, const struct pw_core_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -296,10 +296,10 @@ static int core_event_marshal_info(void *object, const struct pw_core_info *info
|
|||
push_dict(b, info->props);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int core_event_marshal_done(void *object, uint32_t id, int seq)
|
||||
static void core_event_marshal_done(void *object, uint32_t id, int seq)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -310,24 +310,24 @@ static int core_event_marshal_done(void *object, uint32_t id, int seq)
|
|||
SPA_POD_Int(id),
|
||||
SPA_POD_Int(seq));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int core_event_marshal_sync(void *object, uint32_t id, int seq)
|
||||
static void core_event_marshal_ping(void *object, uint32_t id, int seq)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_SYNC, &seq);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_PING, &seq);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
SPA_POD_Int(seq));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int core_event_marshal_error(void *object, uint32_t id, int seq, int res, const char *error)
|
||||
static void core_event_marshal_error(void *object, uint32_t id, int seq, int res, const char *error)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -340,10 +340,10 @@ static int core_event_marshal_error(void *object, uint32_t id, int seq, int res,
|
|||
SPA_POD_Int(res),
|
||||
SPA_POD_String(error));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int core_event_marshal_remove_id(void *object, uint32_t id)
|
||||
static void core_event_marshal_remove_id(void *object, uint32_t id)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -353,7 +353,7 @@ static int core_event_marshal_remove_id(void *object, uint32_t id)
|
|||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_hello(void *object, void *data, size_t size)
|
||||
|
|
@ -385,7 +385,7 @@ static int core_method_demarshal_sync(void *object, void *data, size_t size)
|
|||
return pw_resource_do(resource, struct pw_core_proxy_methods, sync, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_done(void *object, void *data, size_t size)
|
||||
static int core_method_demarshal_pong(void *object, void *data, size_t size)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_parser prs;
|
||||
|
|
@ -397,7 +397,7 @@ static int core_method_demarshal_done(void *object, void *data, size_t size)
|
|||
SPA_POD_Int(&seq)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_do(resource, struct pw_core_proxy_methods, done, 0, id, seq);
|
||||
return pw_resource_do(resource, struct pw_core_proxy_methods, pong, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_error(void *object, void *data, size_t size)
|
||||
|
|
@ -489,7 +489,7 @@ static int core_method_demarshal_destroy(void *object, void *data, size_t size)
|
|||
return pw_resource_do(resource, struct pw_core_proxy_methods, destroy, 0, id);
|
||||
}
|
||||
|
||||
static int registry_marshal_global(void *object, uint32_t id, uint32_t parent_id, uint32_t permissions,
|
||||
static void registry_marshal_global(void *object, uint32_t id, uint32_t parent_id, uint32_t permissions,
|
||||
uint32_t type, uint32_t version, const struct spa_dict *props)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
|
|
@ -509,10 +509,10 @@ static int registry_marshal_global(void *object, uint32_t id, uint32_t parent_id
|
|||
push_dict(b, props);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int registry_marshal_global_remove(void *object, uint32_t id)
|
||||
static void registry_marshal_global_remove(void *object, uint32_t id)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -521,7 +521,7 @@ static int registry_marshal_global_remove(void *object, uint32_t id)
|
|||
|
||||
spa_pod_builder_add_struct(b, SPA_POD_Int(id));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int registry_demarshal_bind(void *object, void *data, size_t size)
|
||||
|
|
@ -555,7 +555,7 @@ static int registry_demarshal_destroy(void *object, void *data, size_t size)
|
|||
return pw_resource_do(resource, struct pw_registry_proxy_methods, destroy, 0, id);
|
||||
}
|
||||
|
||||
static int module_marshal_info(void *object, const struct pw_module_info *info)
|
||||
static void module_marshal_info(void *object, const struct pw_module_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -574,7 +574,7 @@ static int module_marshal_info(void *object, const struct pw_module_info *info)
|
|||
push_dict(b, info->props);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int module_demarshal_info(void *object, void *data, size_t size)
|
||||
|
|
@ -612,7 +612,7 @@ static int module_demarshal_info(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_module_proxy_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int device_marshal_info(void *object, const struct pw_device_info *info)
|
||||
static void device_marshal_info(void *object, const struct pw_device_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -630,7 +630,7 @@ static int device_marshal_info(void *object, const struct pw_device_info *info)
|
|||
push_params(b, info->n_params, info->params);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int device_demarshal_info(void *object, void *data, size_t size)
|
||||
|
|
@ -682,7 +682,7 @@ static int device_demarshal_info(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_device_proxy_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int device_marshal_param(void *object, int seq, uint32_t id, uint32_t index, uint32_t next,
|
||||
static void device_marshal_param(void *object, int seq, uint32_t id, uint32_t index, uint32_t next,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
|
|
@ -697,7 +697,7 @@ static int device_marshal_param(void *object, int seq, uint32_t id, uint32_t ind
|
|||
SPA_POD_Int(next),
|
||||
SPA_POD_Pod(param));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int device_demarshal_param(void *object, void *data, size_t size)
|
||||
|
|
@ -792,7 +792,7 @@ static int device_demarshal_set_param(void *object, void *data, size_t size)
|
|||
return pw_resource_do(resource, struct pw_device_proxy_methods, set_param, 0, id, flags, param);
|
||||
}
|
||||
|
||||
static int factory_marshal_info(void *object, const struct pw_factory_info *info)
|
||||
static void factory_marshal_info(void *object, const struct pw_factory_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -811,7 +811,7 @@ static int factory_marshal_info(void *object, const struct pw_factory_info *info
|
|||
push_dict(b, info->props);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int factory_demarshal_info(void *object, void *data, size_t size)
|
||||
|
|
@ -849,7 +849,7 @@ static int factory_demarshal_info(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_factory_proxy_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int node_marshal_info(void *object, const struct pw_node_info *info)
|
||||
static void node_marshal_info(void *object, const struct pw_node_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -873,7 +873,7 @@ static int node_marshal_info(void *object, const struct pw_node_info *info)
|
|||
push_params(b, info->n_params, info->params);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int node_demarshal_info(void *object, void *data, size_t size)
|
||||
|
|
@ -931,7 +931,7 @@ static int node_demarshal_info(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_node_proxy_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int node_marshal_param(void *object, int seq, uint32_t id,
|
||||
static void node_marshal_param(void *object, int seq, uint32_t id,
|
||||
uint32_t index, uint32_t next, const struct spa_pod *param)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
|
|
@ -946,7 +946,7 @@ static int node_marshal_param(void *object, int seq, uint32_t id,
|
|||
SPA_POD_Int(next),
|
||||
SPA_POD_Pod(param));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int node_demarshal_param(void *object, void *data, size_t size)
|
||||
|
|
@ -1066,7 +1066,7 @@ static int node_demarshal_send_command(void *object, void *data, size_t size)
|
|||
return pw_resource_do(resource, struct pw_node_proxy_methods, send_command, 0, command);
|
||||
}
|
||||
|
||||
static int port_marshal_info(void *object, const struct pw_port_info *info)
|
||||
static void port_marshal_info(void *object, const struct pw_port_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -1084,7 +1084,7 @@ static int port_marshal_info(void *object, const struct pw_port_info *info)
|
|||
push_params(b, info->n_params, info->params);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int port_demarshal_info(void *object, void *data, size_t size)
|
||||
|
|
@ -1135,7 +1135,7 @@ static int port_demarshal_info(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_port_proxy_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int port_marshal_param(void *object, int seq, uint32_t id,
|
||||
static void port_marshal_param(void *object, int seq, uint32_t id,
|
||||
uint32_t index, uint32_t next, const struct spa_pod *param)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
|
|
@ -1150,7 +1150,7 @@ static int port_marshal_param(void *object, int seq, uint32_t id,
|
|||
SPA_POD_Int(next),
|
||||
SPA_POD_Pod(param));
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int port_demarshal_param(void *object, void *data, size_t size)
|
||||
|
|
@ -1213,7 +1213,7 @@ static int port_demarshal_enum_params(void *object, void *data, size_t size)
|
|||
seq, id, index, num, filter);
|
||||
}
|
||||
|
||||
static int client_marshal_info(void *object, const struct pw_client_info *info)
|
||||
static void client_marshal_info(void *object, const struct pw_client_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -1229,7 +1229,7 @@ static int client_marshal_info(void *object, const struct pw_client_info *info)
|
|||
push_dict(b, info->props);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int client_demarshal_info(void *object, void *data, size_t size)
|
||||
|
|
@ -1264,7 +1264,7 @@ static int client_demarshal_info(void *object, void *data, size_t size)
|
|||
return pw_proxy_notify(proxy, struct pw_client_proxy_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int client_marshal_permissions(void *object, uint32_t index, uint32_t n_permissions,
|
||||
static void client_marshal_permissions(void *object, uint32_t index, uint32_t n_permissions,
|
||||
const struct pw_permission *permissions)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
|
|
@ -1293,7 +1293,7 @@ static int client_marshal_permissions(void *object, uint32_t index, uint32_t n_p
|
|||
spa_pod_builder_pop(b, &f[1]);
|
||||
spa_pod_builder_pop(b, &f[0]);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int client_demarshal_permissions(void *object, void *data, size_t size)
|
||||
|
|
@ -1471,7 +1471,7 @@ static int client_demarshal_update_permissions(void *object, void *data, size_t
|
|||
n_permissions, permissions);
|
||||
}
|
||||
|
||||
static int link_marshal_info(void *object, const struct pw_link_info *info)
|
||||
static void link_marshal_info(void *object, const struct pw_link_info *info)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -1494,7 +1494,7 @@ static int link_marshal_info(void *object, const struct pw_link_info *info)
|
|||
push_dict(b, info->props);
|
||||
spa_pod_builder_pop(b, &f);
|
||||
|
||||
return pw_protocol_native_end_resource(resource, b);
|
||||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int link_demarshal_info(void *object, void *data, size_t size)
|
||||
|
|
@ -1618,7 +1618,7 @@ static const struct pw_core_proxy_methods pw_protocol_native_core_method_marshal
|
|||
PW_VERSION_CORE_PROXY_METHODS,
|
||||
&core_method_marshal_hello,
|
||||
&core_method_marshal_sync,
|
||||
&core_method_marshal_done,
|
||||
&core_method_marshal_pong,
|
||||
&core_method_marshal_error,
|
||||
&core_method_marshal_get_registry,
|
||||
&core_method_marshal_create_object,
|
||||
|
|
@ -1628,7 +1628,7 @@ static const struct pw_core_proxy_methods pw_protocol_native_core_method_marshal
|
|||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_PROXY_METHOD_NUM] = {
|
||||
{ &core_method_demarshal_hello, 0, },
|
||||
{ &core_method_demarshal_sync, 0, },
|
||||
{ &core_method_demarshal_done, 0, },
|
||||
{ &core_method_demarshal_pong, 0, },
|
||||
{ &core_method_demarshal_error, 0, },
|
||||
{ &core_method_demarshal_get_registry, 0, },
|
||||
{ &core_method_demarshal_create_object, 0, },
|
||||
|
|
@ -1639,7 +1639,7 @@ static const struct pw_core_proxy_events pw_protocol_native_core_event_marshal =
|
|||
PW_VERSION_CORE_PROXY_EVENTS,
|
||||
&core_event_marshal_info,
|
||||
&core_event_marshal_done,
|
||||
&core_event_marshal_sync,
|
||||
&core_event_marshal_ping,
|
||||
&core_event_marshal_error,
|
||||
&core_event_marshal_remove_id,
|
||||
};
|
||||
|
|
@ -1647,7 +1647,7 @@ static const struct pw_core_proxy_events pw_protocol_native_core_event_marshal =
|
|||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_demarshal[PW_CORE_PROXY_EVENT_NUM] = {
|
||||
{ &core_event_demarshal_info, 0, },
|
||||
{ &core_event_demarshal_done, 0, },
|
||||
{ &core_event_demarshal_sync, 0, },
|
||||
{ &core_event_demarshal_ping, 0, },
|
||||
{ &core_event_demarshal_error, 0, },
|
||||
{ &core_event_demarshal_remove_id, 0, },
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue