mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
rename core_proxy -> core
Rename core_proxy to core and move the introspect and interface contents to core.h In an effort to promote the proxy API.
This commit is contained in:
parent
8ea78c2e3f
commit
ecc6b27cd7
54 changed files with 1068 additions and 1059 deletions
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
static int core_method_marshal_add_listener(void *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_core_proxy_events *events,
|
||||
const struct pw_core_events *events,
|
||||
void *data)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
|
|
@ -49,7 +49,7 @@ static int core_method_marshal_hello(void *object, uint32_t version)
|
|||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_HELLO, NULL);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_HELLO, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(version));
|
||||
|
|
@ -63,7 +63,7 @@ static int core_method_marshal_sync(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_SYNC, &msg);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_SYNC, &msg);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -77,7 +77,7 @@ 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_PONG, NULL);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_PONG, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -91,7 +91,7 @@ static int core_method_marshal_error(void *object, uint32_t id, int seq, int res
|
|||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_ERROR, NULL);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_ERROR, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -116,7 +116,7 @@ static struct pw_registry_proxy * core_method_marshal_get_registry(void *object,
|
|||
|
||||
new_id = pw_proxy_get_id(res);
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_GET_REGISTRY, NULL);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_GET_REGISTRY, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(version),
|
||||
|
|
@ -208,7 +208,7 @@ core_method_marshal_create_object(void *object,
|
|||
|
||||
new_id = pw_proxy_get_id(res);
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_CREATE_OBJECT, NULL);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_CREATE_OBJECT, NULL);
|
||||
|
||||
spa_pod_builder_push_struct(b, &f);
|
||||
spa_pod_builder_add(b,
|
||||
|
|
@ -232,7 +232,7 @@ core_method_marshal_destroy(void *object, void *p)
|
|||
struct spa_pod_builder *b;
|
||||
uint32_t id = pw_proxy_get_id(p);
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_DESTROY, NULL);
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_METHOD_DESTROY, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id));
|
||||
|
|
@ -272,7 +272,7 @@ static int core_event_demarshal_info(void *object, const struct pw_protocol_nati
|
|||
if (parse_dict(&prs, &props) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, info, 0, &info);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_done(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -287,7 +287,7 @@ static int core_event_demarshal_done(void *object, const struct pw_protocol_nati
|
|||
SPA_POD_Int(&seq)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, done, 0, id, seq);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, done, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_ping(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -302,7 +302,7 @@ static int core_event_demarshal_ping(void *object, const struct pw_protocol_nati
|
|||
SPA_POD_Int(&seq)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, ping, 0, id, seq);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, ping, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_error(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -321,7 +321,7 @@ static int core_event_demarshal_error(void *object, const struct pw_protocol_nat
|
|||
SPA_POD_String(&error)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, error, 0, id, seq, res, error);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, error, 0, id, seq, res, error);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_remove_id(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -334,7 +334,7 @@ static int core_event_demarshal_remove_id(void *object, const struct pw_protocol
|
|||
if (spa_pod_parser_get_struct(&prs, SPA_POD_Int(&id)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, remove_id, 0, id);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, remove_id, 0, id);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_bound_id(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -349,7 +349,7 @@ static int core_event_demarshal_bound_id(void *object, const struct pw_protocol_
|
|||
SPA_POD_Int(&global_id)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, bound_id, 0, id, global_id);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, bound_id, 0, id, global_id);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_add_mem(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -370,7 +370,7 @@ static int core_event_demarshal_add_mem(void *object, const struct pw_protocol_n
|
|||
|
||||
fd = pw_protocol_native_get_proxy_fd(proxy, idx);
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, add_mem, 0, id, type, fd, flags);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, add_mem, 0, id, type, fd, flags);
|
||||
}
|
||||
|
||||
static int core_event_demarshal_remove_mem(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -384,7 +384,7 @@ static int core_event_demarshal_remove_mem(void *object, const struct pw_protoco
|
|||
SPA_POD_Int(&id)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_core_proxy_events, remove_mem, 0, id);
|
||||
return pw_proxy_notify(proxy, struct pw_core_events, remove_mem, 0, id);
|
||||
}
|
||||
|
||||
static void core_event_marshal_info(void *object, const struct pw_core_info *info)
|
||||
|
|
@ -393,7 +393,7 @@ static void core_event_marshal_info(void *object, const struct pw_core_info *inf
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_INFO, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_INFO, NULL);
|
||||
|
||||
spa_pod_builder_push_struct(b, &f);
|
||||
spa_pod_builder_add(b,
|
||||
|
|
@ -416,7 +416,7 @@ static void core_event_marshal_done(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_DONE, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_DONE, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -431,7 +431,7 @@ static void core_event_marshal_ping(void *object, uint32_t id, int seq)
|
|||
struct spa_pod_builder *b;
|
||||
struct pw_protocol_native_message *msg;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_PING, &msg);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_PING, &msg);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -445,7 +445,7 @@ static void core_event_marshal_error(void *object, uint32_t id, int seq, int res
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_ERROR, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_ERROR, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -461,7 +461,7 @@ static void core_event_marshal_remove_id(void *object, uint32_t id)
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_REMOVE_ID, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_REMOVE_ID, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id));
|
||||
|
|
@ -474,7 +474,7 @@ static void core_event_marshal_bound_id(void *object, uint32_t id, uint32_t glob
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_BOUND_ID, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_BOUND_ID, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -488,7 +488,7 @@ static void core_event_marshal_add_mem(void *object, uint32_t id, uint32_t type,
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_ADD_MEM, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_ADD_MEM, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id),
|
||||
|
|
@ -504,7 +504,7 @@ static void core_event_marshal_remove_mem(void *object, uint32_t id)
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_EVENT_REMOVE_MEM, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_EVENT_REMOVE_MEM, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
SPA_POD_Int(id));
|
||||
|
|
@ -523,7 +523,7 @@ static int core_method_demarshal_hello(void *object, const struct pw_protocol_na
|
|||
SPA_POD_Int(&version)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, hello, 0, version);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, hello, 0, version);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_sync(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -538,7 +538,7 @@ static int core_method_demarshal_sync(void *object, const struct pw_protocol_nat
|
|||
SPA_POD_Int(&seq)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, sync, 0, id, seq);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, sync, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_pong(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -553,7 +553,7 @@ static int core_method_demarshal_pong(void *object, const struct pw_protocol_nat
|
|||
SPA_POD_Int(&seq)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, pong, 0, id, seq);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, pong, 0, id, seq);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_error(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -572,7 +572,7 @@ static int core_method_demarshal_error(void *object, const struct pw_protocol_na
|
|||
SPA_POD_String(&error)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, error, 0, id, seq, res, error);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, error, 0, id, seq, res, error);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_get_registry(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -587,7 +587,7 @@ static int core_method_demarshal_get_registry(void *object, const struct pw_prot
|
|||
SPA_POD_Int(&new_id)) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, get_registry, 0, version, new_id);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, get_registry, 0, version, new_id);
|
||||
}
|
||||
|
||||
static int core_method_demarshal_create_object(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -622,7 +622,7 @@ static int core_method_demarshal_create_object(void *object, const struct pw_pro
|
|||
SPA_POD_Int(&new_id), NULL) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, create_object, 0, factory_name,
|
||||
return pw_resource_notify(resource, struct pw_core_methods, create_object, 0, factory_name,
|
||||
type, version,
|
||||
&props, new_id);
|
||||
}
|
||||
|
|
@ -645,7 +645,7 @@ static int core_method_demarshal_destroy(void *object, const struct pw_protocol_
|
|||
if ((r = pw_client_find_resource(client, id)) == NULL)
|
||||
goto no_resource;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, destroy, 0, r);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, destroy, 0, r);
|
||||
|
||||
no_resource:
|
||||
pw_log_error("client %p: unknown resouce %u op:%u", client, id, msg->opcode);
|
||||
|
|
@ -1893,8 +1893,8 @@ static int registry_marshal_destroy(void *object, uint32_t id)
|
|||
return pw_protocol_native_end_proxy(proxy, b);
|
||||
}
|
||||
|
||||
static const struct pw_core_proxy_methods pw_protocol_native_core_method_marshal = {
|
||||
PW_VERSION_CORE_PROXY_METHODS,
|
||||
static const struct pw_core_methods pw_protocol_native_core_method_marshal = {
|
||||
PW_VERSION_CORE_METHODS,
|
||||
.add_listener = &core_method_marshal_add_listener,
|
||||
.hello = &core_method_marshal_hello,
|
||||
.sync = &core_method_marshal_sync,
|
||||
|
|
@ -1905,19 +1905,19 @@ static const struct pw_core_proxy_methods pw_protocol_native_core_method_marshal
|
|||
.destroy = &core_method_marshal_destroy,
|
||||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_PROXY_METHOD_NUM] = {
|
||||
[PW_CORE_PROXY_METHOD_ADD_LISTENER] = { NULL, 0, },
|
||||
[PW_CORE_PROXY_METHOD_HELLO] = { &core_method_demarshal_hello, 0, },
|
||||
[PW_CORE_PROXY_METHOD_SYNC] = { &core_method_demarshal_sync, 0, },
|
||||
[PW_CORE_PROXY_METHOD_PONG] = { &core_method_demarshal_pong, 0, },
|
||||
[PW_CORE_PROXY_METHOD_ERROR] = { &core_method_demarshal_error, 0, },
|
||||
[PW_CORE_PROXY_METHOD_GET_REGISTRY] = { &core_method_demarshal_get_registry, 0, },
|
||||
[PW_CORE_PROXY_METHOD_CREATE_OBJECT] = { &core_method_demarshal_create_object, 0, },
|
||||
[PW_CORE_PROXY_METHOD_DESTROY] = { &core_method_demarshal_destroy, 0, }
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_METHOD_NUM] = {
|
||||
[PW_CORE_METHOD_ADD_LISTENER] = { NULL, 0, },
|
||||
[PW_CORE_METHOD_HELLO] = { &core_method_demarshal_hello, 0, },
|
||||
[PW_CORE_METHOD_SYNC] = { &core_method_demarshal_sync, 0, },
|
||||
[PW_CORE_METHOD_PONG] = { &core_method_demarshal_pong, 0, },
|
||||
[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, }
|
||||
};
|
||||
|
||||
static const struct pw_core_proxy_events pw_protocol_native_core_event_marshal = {
|
||||
PW_VERSION_CORE_PROXY_EVENTS,
|
||||
static const struct pw_core_events pw_protocol_native_core_event_marshal = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
.info = &core_event_marshal_info,
|
||||
.done = &core_event_marshal_done,
|
||||
.ping = &core_event_marshal_ping,
|
||||
|
|
@ -1929,24 +1929,24 @@ 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] =
|
||||
pw_protocol_native_core_event_demarshal[PW_CORE_EVENT_NUM] =
|
||||
{
|
||||
[PW_CORE_PROXY_EVENT_INFO] = { &core_event_demarshal_info, 0, },
|
||||
[PW_CORE_PROXY_EVENT_DONE] = { &core_event_demarshal_done, 0, },
|
||||
[PW_CORE_PROXY_EVENT_PING] = { &core_event_demarshal_ping, 0, },
|
||||
[PW_CORE_PROXY_EVENT_ERROR] = { &core_event_demarshal_error, 0, },
|
||||
[PW_CORE_PROXY_EVENT_REMOVE_ID] = { &core_event_demarshal_remove_id, 0, },
|
||||
[PW_CORE_PROXY_EVENT_BOUND_ID] = { &core_event_demarshal_bound_id, 0, },
|
||||
[PW_CORE_PROXY_EVENT_ADD_MEM] = { &core_event_demarshal_add_mem, 0, },
|
||||
[PW_CORE_PROXY_EVENT_REMOVE_MEM] = { &core_event_demarshal_remove_mem, 0, },
|
||||
[PW_CORE_EVENT_INFO] = { &core_event_demarshal_info, 0, },
|
||||
[PW_CORE_EVENT_DONE] = { &core_event_demarshal_done, 0, },
|
||||
[PW_CORE_EVENT_PING] = { &core_event_demarshal_ping, 0, },
|
||||
[PW_CORE_EVENT_ERROR] = { &core_event_demarshal_error, 0, },
|
||||
[PW_CORE_EVENT_REMOVE_ID] = { &core_event_demarshal_remove_id, 0, },
|
||||
[PW_CORE_EVENT_BOUND_ID] = { &core_event_demarshal_bound_id, 0, },
|
||||
[PW_CORE_EVENT_ADD_MEM] = { &core_event_demarshal_add_mem, 0, },
|
||||
[PW_CORE_EVENT_REMOVE_MEM] = { &core_event_demarshal_remove_mem, 0, },
|
||||
};
|
||||
|
||||
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
|
||||
PW_TYPE_INTERFACE_Core,
|
||||
PW_VERSION_CORE_PROXY,
|
||||
PW_VERSION_CORE,
|
||||
0,
|
||||
PW_CORE_PROXY_METHOD_NUM,
|
||||
PW_CORE_PROXY_EVENT_NUM,
|
||||
PW_CORE_METHOD_NUM,
|
||||
PW_CORE_EVENT_NUM,
|
||||
.client_marshal = &pw_protocol_native_core_method_marshal,
|
||||
.server_demarshal = pw_protocol_native_core_method_demarshal,
|
||||
.server_marshal = &pw_protocol_native_core_event_marshal,
|
||||
|
|
|
|||
|
|
@ -35,36 +35,36 @@ extern "C" {
|
|||
|
||||
#define PW_VERSION_CORE_V0 0
|
||||
|
||||
#define PW_CORE_PROXY_V0_METHOD_HELLO 0
|
||||
#define PW_CORE_PROXY_V0_METHOD_UPDATE_TYPES 1
|
||||
#define PW_CORE_PROXY_V0_METHOD_SYNC 2
|
||||
#define PW_CORE_PROXY_V0_METHOD_GET_REGISTRY 3
|
||||
#define PW_CORE_PROXY_V0_METHOD_CLIENT_UPDATE 4
|
||||
#define PW_CORE_PROXY_V0_METHOD_PERMISSIONS 5
|
||||
#define PW_CORE_PROXY_V0_METHOD_CREATE_OBJECT 6
|
||||
#define PW_CORE_PROXY_V0_METHOD_DESTROY 7
|
||||
#define PW_CORE_PROXY_V0_METHOD_NUM 8
|
||||
#define PW_CORE_V0_METHOD_HELLO 0
|
||||
#define PW_CORE_V0_METHOD_UPDATE_TYPES 1
|
||||
#define PW_CORE_V0_METHOD_SYNC 2
|
||||
#define PW_CORE_V0_METHOD_GET_REGISTRY 3
|
||||
#define PW_CORE_V0_METHOD_CLIENT_UPDATE 4
|
||||
#define PW_CORE_V0_METHOD_PERMISSIONS 5
|
||||
#define PW_CORE_V0_METHOD_CREATE_OBJECT 6
|
||||
#define PW_CORE_V0_METHOD_DESTROY 7
|
||||
#define PW_CORE_V0_METHOD_NUM 8
|
||||
|
||||
#if 0
|
||||
/**
|
||||
* Key to update default permissions of globals without specific
|
||||
* permissions. value is "[r][w][x]" */
|
||||
#define PW_CORE_PROXY_PERMISSIONS_DEFAULT "permissions.default"
|
||||
#define PW_CORE_PERMISSIONS_DEFAULT "permissions.default"
|
||||
|
||||
/**
|
||||
* Key to update specific permissions of a global. If the global
|
||||
* did not have specific permissions, it will first be assigned
|
||||
* the default permissions before it is updated.
|
||||
* Value is "<global-id>:[r][w][x]"*/
|
||||
#define PW_CORE_PROXY_PERMISSIONS_GLOBAL "permissions.global"
|
||||
#define PW_CORE_PERMISSIONS_GLOBAL "permissions.global"
|
||||
|
||||
/**
|
||||
* Key to update specific permissions of all existing globals.
|
||||
* This is equivalent to using \ref PW_CORE_PROXY_PERMISSIONS_GLOBAL
|
||||
* This is equivalent to using \ref PW_CORE_PERMISSIONS_GLOBAL
|
||||
* on each global id individually that did not have specific
|
||||
* permissions.
|
||||
* Value is "[r][w][x]" */
|
||||
#define PW_CORE_PROXY_PERMISSIONS_EXISTING "permissions.existing"
|
||||
#define PW_CORE_PERMISSIONS_EXISTING "permissions.existing"
|
||||
|
||||
#define PW_LINK_OUTPUT_NODE_ID "link.output_node.id"
|
||||
#define PW_LINK_OUTPUT_PORT_ID "link.output_port.id"
|
||||
|
|
@ -73,15 +73,15 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/**
|
||||
* \struct pw_core_proxy_v0_methods
|
||||
* \struct pw_core_v0_methods
|
||||
* \brief Core methods
|
||||
*
|
||||
* The core global object. This is a singleton object used for
|
||||
* creating new objects in the remote PipeWire intance. It is
|
||||
* also used for internal features.
|
||||
*/
|
||||
struct pw_core_proxy_v0_methods {
|
||||
#define PW_VERSION_CORE_PROXY_V0_METHODS 0
|
||||
struct pw_core_v0_methods {
|
||||
#define PW_VERSION_CORE_V0_METHODS 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* Start a conversation with the server. This will send
|
||||
|
|
@ -167,19 +167,19 @@ struct pw_core_proxy_v0_methods {
|
|||
void (*destroy) (void *object, uint32_t id);
|
||||
};
|
||||
|
||||
#define PW_CORE_PROXY_V0_EVENT_UPDATE_TYPES 0
|
||||
#define PW_CORE_PROXY_V0_EVENT_DONE 1
|
||||
#define PW_CORE_PROXY_V0_EVENT_ERROR 2
|
||||
#define PW_CORE_PROXY_V0_EVENT_REMOVE_ID 3
|
||||
#define PW_CORE_PROXY_V0_EVENT_INFO 4
|
||||
#define PW_CORE_PROXY_V0_EVENT_NUM 5
|
||||
#define PW_CORE_V0_EVENT_UPDATE_TYPES 0
|
||||
#define PW_CORE_V0_EVENT_DONE 1
|
||||
#define PW_CORE_V0_EVENT_ERROR 2
|
||||
#define PW_CORE_V0_EVENT_REMOVE_ID 3
|
||||
#define PW_CORE_V0_EVENT_INFO 4
|
||||
#define PW_CORE_V0_EVENT_NUM 5
|
||||
|
||||
/** \struct pw_core_proxy_v0_events
|
||||
/** \struct pw_core_v0_events
|
||||
* \brief Core events
|
||||
* \ingroup pw_core_interface The pw_core interface
|
||||
*/
|
||||
struct pw_core_proxy_v0_events {
|
||||
#define PW_VERSION_CORE_PROXY_V0_EVENTS 0
|
||||
struct pw_core_v0_events {
|
||||
#define PW_VERSION_CORE_V0_EVENTS 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* Update the type map
|
||||
|
|
@ -234,11 +234,11 @@ struct pw_core_proxy_v0_events {
|
|||
void (*info) (void *object, struct pw_core_info *info);
|
||||
};
|
||||
|
||||
#define pw_core_resource_v0_update_types(r,...) pw_resource_notify(r,struct pw_core_proxy_v0_events,update_types,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_done(r,...) pw_resource_notify(r,struct pw_core_proxy_v0_events,done,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_error(r,...) pw_resource_notify(r,struct pw_core_proxy_v0_events,error,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_remove_id(r,...) pw_resource_notify(r,struct pw_core_proxy_v0_events,remove_id,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_info(r,...) pw_resource_notify(r,struct pw_core_proxy_v0_events,info,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_update_types(r,...) pw_resource_notify(r,struct pw_core_v0_events,update_types,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_done(r,...) pw_resource_notify(r,struct pw_core_v0_events,done,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_error(r,...) pw_resource_notify(r,struct pw_core_v0_events,error,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_remove_id(r,...) pw_resource_notify(r,struct pw_core_v0_events,remove_id,__VA_ARGS__)
|
||||
#define pw_core_resource_v0_info(r,...) pw_resource_notify(r,struct pw_core_v0_events,info,__VA_ARGS__)
|
||||
|
||||
|
||||
#define PW_VERSION_REGISTRY_V0 0
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ update_types_server(struct pw_resource *resource)
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_UPDATE_TYPES, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_UPDATE_TYPES, NULL);
|
||||
|
||||
spa_pod_builder_push_struct(b, &f);
|
||||
spa_pod_builder_add(b,
|
||||
|
|
@ -78,11 +78,11 @@ static void core_marshal_info(void *object, const struct pw_core_info *info)
|
|||
struct spa_pod_frame f;
|
||||
struct pw_protocol_native_message *msg;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_INFO, &msg);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_INFO, &msg);
|
||||
|
||||
if (msg->seq == 0) {
|
||||
update_types_server(resource);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_INFO, &msg);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_INFO, &msg);
|
||||
}
|
||||
|
||||
n_items = info->props ? info->props->n_items : 0;
|
||||
|
|
@ -113,7 +113,7 @@ static void core_marshal_done(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_V0_EVENT_DONE, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_DONE, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b, "i", seq);
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ static void core_marshal_error(void *object, uint32_t id, int seq, int res, cons
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_ERROR, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_ERROR, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b,
|
||||
"i", id,
|
||||
|
|
@ -140,7 +140,7 @@ static void core_marshal_remove_id(void *object, uint32_t id)
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_PROXY_V0_EVENT_REMOVE_ID, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_CORE_V0_EVENT_REMOVE_ID, NULL);
|
||||
|
||||
spa_pod_builder_add_struct(b, "i", id);
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ static int core_demarshal_hello(void *object, const struct pw_protocol_native_me
|
|||
"P", &ptr) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, hello, 0, 2);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, hello, 0, 2);
|
||||
}
|
||||
|
||||
static int core_demarshal_sync(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -224,7 +224,7 @@ static int core_demarshal_sync(void *object, const struct pw_protocol_native_mes
|
|||
if (spa_pod_parser_get_struct(&prs, "i", &seq) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, sync, 0, 0, seq);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, sync, 0, 0, seq);
|
||||
}
|
||||
|
||||
static int core_demarshal_get_registry(void *object, const struct pw_protocol_native_message *msg)
|
||||
|
|
@ -239,7 +239,7 @@ static int core_demarshal_get_registry(void *object, const struct pw_protocol_na
|
|||
"i", &new_id) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, get_registry, 0, version, new_id);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, get_registry, 0, version, new_id);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
|
|
@ -622,7 +622,7 @@ static int core_demarshal_create_object(void *object, const struct pw_protocol_n
|
|||
|
||||
type = pw_protocol_native0_type_from_v2(client, type);
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, create_object, 0, factory_name,
|
||||
return pw_resource_notify(resource, struct pw_core_methods, create_object, 0, factory_name,
|
||||
type, version,
|
||||
&props, new_id);
|
||||
}
|
||||
|
|
@ -644,7 +644,7 @@ static int core_demarshal_destroy(void *object, const struct pw_protocol_native_
|
|||
if ((r = pw_client_find_resource(client, id)) == NULL)
|
||||
goto no_resource;
|
||||
|
||||
return pw_resource_notify(resource, struct pw_core_proxy_methods, destroy, 0, r);
|
||||
return pw_resource_notify(resource, struct pw_core_methods, destroy, 0, r);
|
||||
|
||||
no_resource:
|
||||
pw_log_error("client %p: unknown resouce %u op:%u", client, id, msg->opcode);
|
||||
|
|
@ -1018,19 +1018,19 @@ static void link_marshal_info(void *object, const struct pw_link_info *info)
|
|||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_PROXY_V0_METHOD_NUM] = {
|
||||
[PW_CORE_PROXY_V0_METHOD_HELLO] = { &core_demarshal_hello, 0, },
|
||||
[PW_CORE_PROXY_V0_METHOD_UPDATE_TYPES] = { &core_demarshal_update_types_server, 0, },
|
||||
[PW_CORE_PROXY_V0_METHOD_SYNC] = { &core_demarshal_sync, 0, },
|
||||
[PW_CORE_PROXY_V0_METHOD_GET_REGISTRY] = { &core_demarshal_get_registry, 0, },
|
||||
[PW_CORE_PROXY_V0_METHOD_CLIENT_UPDATE] = { &core_demarshal_client_update, 0, },
|
||||
[PW_CORE_PROXY_V0_METHOD_PERMISSIONS] = { &core_demarshal_permissions, 0, },
|
||||
[PW_CORE_PROXY_V0_METHOD_CREATE_OBJECT] = { &core_demarshal_create_object, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, },
|
||||
[PW_CORE_PROXY_V0_METHOD_DESTROY] = { &core_demarshal_destroy, 0, }
|
||||
static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_demarshal[PW_CORE_V0_METHOD_NUM] = {
|
||||
[PW_CORE_V0_METHOD_HELLO] = { &core_demarshal_hello, 0, },
|
||||
[PW_CORE_V0_METHOD_UPDATE_TYPES] = { &core_demarshal_update_types_server, 0, },
|
||||
[PW_CORE_V0_METHOD_SYNC] = { &core_demarshal_sync, 0, },
|
||||
[PW_CORE_V0_METHOD_GET_REGISTRY] = { &core_demarshal_get_registry, 0, },
|
||||
[PW_CORE_V0_METHOD_CLIENT_UPDATE] = { &core_demarshal_client_update, 0, },
|
||||
[PW_CORE_V0_METHOD_PERMISSIONS] = { &core_demarshal_permissions, 0, },
|
||||
[PW_CORE_V0_METHOD_CREATE_OBJECT] = { &core_demarshal_create_object, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, },
|
||||
[PW_CORE_V0_METHOD_DESTROY] = { &core_demarshal_destroy, 0, }
|
||||
};
|
||||
|
||||
static const struct pw_core_proxy_events pw_protocol_native_core_event_marshal = {
|
||||
PW_VERSION_CORE_PROXY_EVENTS,
|
||||
static const struct pw_core_events pw_protocol_native_core_event_marshal = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
.info = &core_marshal_info,
|
||||
.done = &core_marshal_done,
|
||||
.error = &core_marshal_error,
|
||||
|
|
@ -1040,8 +1040,8 @@ static const struct pw_core_proxy_events pw_protocol_native_core_event_marshal =
|
|||
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
|
||||
PW_TYPE_INTERFACE_Core,
|
||||
PW_VERSION_CORE_V0,
|
||||
PW_CORE_PROXY_V0_METHOD_NUM,
|
||||
PW_CORE_PROXY_EVENT_NUM,
|
||||
PW_CORE_V0_METHOD_NUM,
|
||||
PW_CORE_EVENT_NUM,
|
||||
0,
|
||||
NULL,
|
||||
pw_protocol_native_core_method_demarshal,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue