summaryrefslogtreecommitdiff
path: root/src/modules/module-protocol-native/protocol-native.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/module-protocol-native/protocol-native.c')
-rw-r--r--src/modules/module-protocol-native/protocol-native.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/modules/module-protocol-native/protocol-native.c b/src/modules/module-protocol-native/protocol-native.c
index 1f5b692f..5ca29c18 100644
--- a/src/modules/module-protocol-native/protocol-native.c
+++ b/src/modules/module-protocol-native/protocol-native.c
@@ -30,6 +30,7 @@
#include <spa/utils/result.h>
#include <pipewire/pipewire.h>
+#include <pipewire/protocol.h>
#include <extensions/protocol-native.h>
#include "connection.h"
@@ -226,13 +227,13 @@ core_method_marshal_create_object(void *object,
}
static int
-core_method_marshal_destroy(void *object, void *p)
+core_method_marshal_destroy_object(void *object, void *p)
{
struct pw_proxy *proxy = object;
struct spa_pod_builder *b;
uint32_t id = pw_proxy_get_id(p);
- b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_DESTROY, NULL);
+ b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_DESTROY_OBJECT, NULL);
spa_pod_builder_add_struct(b,
SPA_POD_Int(id));
@@ -599,6 +600,7 @@ static int core_method_demarshal_create_object(void *object, const struct pw_pro
const char *factory_name;
struct spa_dict props = SPA_DICT_INIT(NULL, 0);
+ pw_log_debug(".");
spa_pod_parser_init(&prs, msg->data, msg->size);
if (spa_pod_parser_push_struct(&prs, &f[0]) < 0 ||
spa_pod_parser_get(&prs,
@@ -608,26 +610,30 @@ static int core_method_demarshal_create_object(void *object, const struct pw_pro
NULL) < 0)
return -EINVAL;
+ pw_log_debug(".");
if (spa_pod_parser_push_struct(&prs, &f[1]) < 0 ||
spa_pod_parser_get(&prs,
SPA_POD_Int(&props.n_items), NULL) < 0)
return -EINVAL;
+ pw_log_debug(".");
props.items = alloca(props.n_items * sizeof(struct spa_dict_item));
if (parse_dict(&prs, &props) < 0)
return -EINVAL;
spa_pod_parser_pop(&prs, &f[1]);
+ pw_log_debug(".");
if (spa_pod_parser_get(&prs,
SPA_POD_Int(&new_id), NULL) < 0)
return -EINVAL;
+ pw_log_debug(".");
return pw_resource_notify(resource, struct pw_core_methods, create_object, 0, factory_name,
type, version,
&props, new_id);
}
-static int core_method_demarshal_destroy(void *object, const struct pw_protocol_native_message *msg)
+static int core_method_demarshal_destroy_object(void *object, const struct pw_protocol_native_message *msg)
{
struct pw_resource *resource = object;
struct pw_impl_client *client = pw_resource_get_client(resource);
@@ -645,7 +651,7 @@ static int core_method_demarshal_destroy(void *object, const struct pw_protocol_
if ((r = pw_impl_client_find_resource(client, id)) == NULL)
goto no_resource;
- return pw_resource_notify(resource, struct pw_core_methods, destroy, 0, r);
+ return pw_resource_notify(resource, struct pw_core_methods, destroy_object, 0, r);
no_resource:
pw_log_error("client %p: unknown resouce %u op:%u", client, id, msg->opcode);
@@ -1902,7 +1908,7 @@ static const struct pw_core_methods pw_protocol_native_core_method_marshal = {
.error = &core_method_marshal_error,
.get_registry = &core_method_marshal_get_registry,
.create_object = &core_method_marshal_create_object,
- .destroy = &core_method_marshal_destroy,
+ .destroy_object = &core_method_marshal_destroy_object,
};
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_METHOD_NUM] = {
@@ -1913,7 +1919,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_
[PW_CORE_METHOD_ERROR] = { &core_method_demarshal_error, 0, },
[PW_CORE_METHOD_GET_REGISTRY] = { &core_method_demarshal_get_registry, 0, },
[PW_CORE_METHOD_CREATE_OBJECT] = { &core_method_demarshal_create_object, 0, },
- [PW_CORE_METHOD_DESTROY] = { &core_method_demarshal_destroy, 0, }
+ [PW_CORE_METHOD_DESTROY_OBJECT] = { &core_method_demarshal_destroy_object, 0, }
};
static const struct pw_core_events pw_protocol_native_core_event_marshal = {