pw_registry_proxy -> pw_registry

This commit is contained in:
Wim Taymans 2019-12-11 09:44:48 +01:00
parent ecc6b27cd7
commit 49d736bbb7
17 changed files with 140 additions and 141 deletions

View file

@ -102,7 +102,7 @@ static int core_method_marshal_error(void *object, uint32_t id, int seq, int res
return pw_protocol_native_end_proxy(proxy, b);
}
static struct pw_registry_proxy * core_method_marshal_get_registry(void *object,
static struct pw_registry * core_method_marshal_get_registry(void *object,
uint32_t version, size_t user_data_size)
{
struct pw_proxy *proxy = object;
@ -124,7 +124,7 @@ static struct pw_registry_proxy * core_method_marshal_get_registry(void *object,
pw_protocol_native_end_proxy(proxy, b);
return (struct pw_registry_proxy *) res;
return (struct pw_registry *) res;
}
static inline void push_item(struct spa_pod_builder *b, const struct spa_dict_item *item)
@ -655,7 +655,7 @@ static int core_method_demarshal_destroy(void *object, const struct pw_protocol_
static int registry_method_marshal_add_listener(void *object,
struct spa_hook *listener,
const struct pw_registry_proxy_events *events,
const struct pw_registry_events *events,
void *data)
{
struct pw_proxy *proxy = object;
@ -670,7 +670,7 @@ static void registry_marshal_global(void *object, uint32_t id, uint32_t permissi
struct spa_pod_builder *b;
struct spa_pod_frame f;
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_PROXY_EVENT_GLOBAL, NULL);
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_EVENT_GLOBAL, NULL);
spa_pod_builder_push_struct(b, &f);
spa_pod_builder_add(b,
@ -690,7 +690,7 @@ static void registry_marshal_global_remove(void *object, uint32_t id)
struct pw_resource *resource = object;
struct spa_pod_builder *b;
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_PROXY_EVENT_GLOBAL_REMOVE, NULL);
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_EVENT_GLOBAL_REMOVE, NULL);
spa_pod_builder_add_struct(b, SPA_POD_Int(id));
@ -711,7 +711,7 @@ static int registry_demarshal_bind(void *object, const struct pw_protocol_native
SPA_POD_Int(&new_id)) < 0)
return -EINVAL;
return pw_resource_notify(resource, struct pw_registry_proxy_methods, bind, 0, id, type, version, new_id);
return pw_resource_notify(resource, struct pw_registry_methods, bind, 0, id, type, version, new_id);
}
static int registry_demarshal_destroy(void *object, const struct pw_protocol_native_message *msg)
@ -725,7 +725,7 @@ static int registry_demarshal_destroy(void *object, const struct pw_protocol_nat
SPA_POD_Int(&id)) < 0)
return -EINVAL;
return pw_resource_notify(resource, struct pw_registry_proxy_methods, destroy, 0, id);
return pw_resource_notify(resource, struct pw_registry_methods, destroy, 0, id);
}
static int module_method_marshal_add_listener(void *object,
@ -1836,7 +1836,7 @@ static int registry_demarshal_global(void *object, const struct pw_protocol_nati
if (parse_dict(&prs, &props) < 0)
return -EINVAL;
return pw_proxy_notify(proxy, struct pw_registry_proxy_events,
return pw_proxy_notify(proxy, struct pw_registry_events,
global, 0, id, permissions, type, version,
props.n_items > 0 ? &props : NULL);
}
@ -1852,7 +1852,7 @@ static int registry_demarshal_global_remove(void *object, const struct pw_protoc
SPA_POD_Int(&id)) < 0)
return -EINVAL;
return pw_proxy_notify(proxy, struct pw_registry_proxy_events, global_remove, 0, id);
return pw_proxy_notify(proxy, struct pw_registry_events, global_remove, 0, id);
}
static void * registry_marshal_bind(void *object, uint32_t id,
@ -1869,7 +1869,7 @@ static void * registry_marshal_bind(void *object, uint32_t id,
new_id = pw_proxy_get_id(res);
b = pw_protocol_native_begin_proxy(proxy, PW_REGISTRY_PROXY_METHOD_BIND, NULL);
b = pw_protocol_native_begin_proxy(proxy, PW_REGISTRY_METHOD_BIND, NULL);
spa_pod_builder_add_struct(b,
SPA_POD_Int(id),
@ -1887,7 +1887,7 @@ static int registry_marshal_destroy(void *object, uint32_t id)
struct pw_proxy *proxy = object;
struct spa_pod_builder *b;
b = pw_protocol_native_begin_proxy(proxy, PW_REGISTRY_PROXY_METHOD_DESTROY, NULL);
b = pw_protocol_native_begin_proxy(proxy, PW_REGISTRY_METHOD_DESTROY, NULL);
spa_pod_builder_add_struct(b,
SPA_POD_Int(id));
return pw_protocol_native_end_proxy(proxy, b);
@ -1953,40 +1953,40 @@ static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
.client_demarshal = pw_protocol_native_core_event_demarshal,
};
static const struct pw_registry_proxy_methods pw_protocol_native_registry_method_marshal = {
PW_VERSION_REGISTRY_PROXY_METHODS,
static const struct pw_registry_methods pw_protocol_native_registry_method_marshal = {
PW_VERSION_REGISTRY_METHODS,
.add_listener = &registry_method_marshal_add_listener,
.bind = &registry_marshal_bind,
.destroy = &registry_marshal_destroy,
};
static const struct pw_protocol_native_demarshal
pw_protocol_native_registry_method_demarshal[PW_REGISTRY_PROXY_METHOD_NUM] =
pw_protocol_native_registry_method_demarshal[PW_REGISTRY_METHOD_NUM] =
{
[PW_REGISTRY_PROXY_METHOD_ADD_LISTENER] = { NULL, 0, },
[PW_REGISTRY_PROXY_METHOD_BIND] = { &registry_demarshal_bind, 0, },
[PW_REGISTRY_PROXY_METHOD_DESTROY] = { &registry_demarshal_destroy, 0, },
[PW_REGISTRY_METHOD_ADD_LISTENER] = { NULL, 0, },
[PW_REGISTRY_METHOD_BIND] = { &registry_demarshal_bind, 0, },
[PW_REGISTRY_METHOD_DESTROY] = { &registry_demarshal_destroy, 0, },
};
static const struct pw_registry_proxy_events pw_protocol_native_registry_event_marshal = {
PW_VERSION_REGISTRY_PROXY_EVENTS,
static const struct pw_registry_events pw_protocol_native_registry_event_marshal = {
PW_VERSION_REGISTRY_EVENTS,
.global = &registry_marshal_global,
.global_remove = &registry_marshal_global_remove,
};
static const struct pw_protocol_native_demarshal
pw_protocol_native_registry_event_demarshal[PW_REGISTRY_PROXY_EVENT_NUM] =
pw_protocol_native_registry_event_demarshal[PW_REGISTRY_EVENT_NUM] =
{
[PW_REGISTRY_PROXY_EVENT_GLOBAL] = { &registry_demarshal_global, 0, },
[PW_REGISTRY_PROXY_EVENT_GLOBAL_REMOVE] = { &registry_demarshal_global_remove, 0, }
[PW_REGISTRY_EVENT_GLOBAL] = { &registry_demarshal_global, 0, },
[PW_REGISTRY_EVENT_GLOBAL_REMOVE] = { &registry_demarshal_global_remove, 0, }
};
const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
PW_TYPE_INTERFACE_Registry,
PW_VERSION_REGISTRY_PROXY,
PW_VERSION_REGISTRY,
0,
PW_REGISTRY_PROXY_METHOD_NUM,
PW_REGISTRY_PROXY_EVENT_NUM,
PW_REGISTRY_METHOD_NUM,
PW_REGISTRY_EVENT_NUM,
.client_marshal = &pw_protocol_native_registry_method_marshal,
.server_demarshal = pw_protocol_native_registry_method_demarshal,
.server_marshal = &pw_protocol_native_registry_event_marshal,

View file

@ -274,12 +274,12 @@ struct pw_core_v0_events {
* can, for example, hide certain existing or new objects or limit
* the access permissions on an object.
*/
#define PW_REGISTRY_PROXY_V0_METHOD_BIND 0
#define PW_REGISTRY_PROXY_V0_METHOD_NUM 1
#define PW_REGISTRY_V0_METHOD_BIND 0
#define PW_REGISTRY_V0_METHOD_NUM 1
/** Registry methods */
struct pw_registry_proxy_v0_methods {
#define PW_VERSION_REGISTRY_PROXY_V0_METHODS 0
struct pw_registry_v0_methods {
#define PW_VERSION_REGISTRY_V0_METHODS 0
uint32_t version;
/**
* Bind to a global object
@ -296,13 +296,13 @@ struct pw_registry_proxy_v0_methods {
void (*bind) (void *object, uint32_t id, uint32_t type, uint32_t version, uint32_t new_id);
};
#define PW_REGISTRY_PROXY_V0_EVENT_GLOBAL 0
#define PW_REGISTRY_PROXY_V0_EVENT_GLOBAL_REMOVE 1
#define PW_REGISTRY_PROXY_V0_EVENT_NUM 2
#define PW_REGISTRY_V0_EVENT_GLOBAL 0
#define PW_REGISTRY_V0_EVENT_GLOBAL_REMOVE 1
#define PW_REGISTRY_V0_EVENT_NUM 2
/** Registry events */
struct pw_registry_proxy_v0_events {
#define PW_VERSION_REGISTRY_PROXY_V0_EVENTS 0
struct pw_registry_v0_events {
#define PW_VERSION_REGISTRY_V0_EVENTS 0
uint32_t version;
/**
* Notify of a new global object
@ -332,8 +332,8 @@ struct pw_registry_proxy_v0_events {
void (*global_remove) (void *object, uint32_t id);
};
#define pw_registry_resource_v0_global(r,...) pw_resource_notify(r,struct pw_registry_proxy_v0_events,global,__VA_ARGS__)
#define pw_registry_resource_v0_global_remove(r,...) pw_resource_notify(r,struct pw_registry_proxy_v0_events,global_remove,__VA_ARGS__)
#define pw_registry_resource_v0_global(r,...) pw_resource_notify(r,struct pw_registry_v0_events,global,__VA_ARGS__)
#define pw_registry_resource_v0_global_remove(r,...) pw_resource_notify(r,struct pw_registry_v0_events,global_remove,__VA_ARGS__)
#define PW_VERSION_MODULE_V0 0

View file

@ -694,7 +694,7 @@ static void registry_marshal_global(void *object, uint32_t id, uint32_t permissi
struct spa_pod_frame f;
uint32_t i, n_items, parent_id;
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_PROXY_V0_EVENT_GLOBAL, NULL);
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_V0_EVENT_GLOBAL, NULL);
n_items = props ? props->n_items : 0;
@ -726,7 +726,7 @@ static void registry_marshal_global_remove(void *object, uint32_t id)
struct pw_resource *resource = object;
struct spa_pod_builder *b;
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_PROXY_V0_EVENT_GLOBAL_REMOVE, NULL);
b = pw_protocol_native_begin_resource(resource, PW_REGISTRY_V0_EVENT_GLOBAL_REMOVE, NULL);
spa_pod_builder_add_struct(b, "i", id);
@ -749,7 +749,7 @@ static int registry_demarshal_bind(void *object, const struct pw_protocol_native
type = pw_protocol_native0_type_from_v2(resource->client, type);
return pw_resource_notify(resource, struct pw_registry_proxy_methods, bind, 0, id, type, version, new_id);
return pw_resource_notify(resource, struct pw_registry_methods, bind, 0, id, type, version, new_id);
}
static void module_marshal_info(void *object, const struct pw_module_info *info)
@ -1050,11 +1050,11 @@ static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
};
static const struct pw_protocol_native_demarshal pw_protocol_native_registry_method_demarshal[] = {
[PW_REGISTRY_PROXY_V0_METHOD_BIND] = { &registry_demarshal_bind, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, },
[PW_REGISTRY_V0_METHOD_BIND] = { &registry_demarshal_bind, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, },
};
static const struct pw_registry_proxy_events pw_protocol_native_registry_event_marshal = {
PW_VERSION_REGISTRY_PROXY_EVENTS,
static const struct pw_registry_events pw_protocol_native_registry_event_marshal = {
PW_VERSION_REGISTRY_EVENTS,
.global = &registry_marshal_global,
.global_remove = &registry_marshal_global_remove,
};
@ -1062,8 +1062,8 @@ static const struct pw_registry_proxy_events pw_protocol_native_registry_event_m
static const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
PW_TYPE_INTERFACE_Registry,
PW_VERSION_REGISTRY_V0,
PW_REGISTRY_PROXY_V0_METHOD_NUM,
PW_REGISTRY_PROXY_EVENT_NUM,
PW_REGISTRY_V0_METHOD_NUM,
PW_REGISTRY_EVENT_NUM,
0,
NULL,
pw_protocol_native_registry_method_demarshal,