pw_link_proxy -> pw_link

This commit is contained in:
Wim Taymans 2019-12-11 15:11:56 +01:00
parent 114982f3f5
commit e633e205c2
13 changed files with 61 additions and 61 deletions

View file

@ -3422,7 +3422,7 @@ int jack_connect (jack_client_t *client,
pw_core_create_object(c->core,
"link-factory",
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
PW_VERSION_LINK,
&props,
0);
res = do_sync(c);

View file

@ -386,7 +386,7 @@ static int make_nodes(struct data *data)
pw_core_create_object(data->core,
"link-factory",
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
PW_VERSION_LINK,
&props->dict, 0);
pw_properties_free(props);

View file

@ -1332,7 +1332,7 @@ static int link_nodes(struct impl *impl, struct endpoint_link *link,
p = pw_core_create_object(impl->policy_core,
"link-factory",
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
PW_VERSION_LINK,
&props->dict, sizeof(struct link));
if (p == NULL)
return -errno;

View file

@ -118,7 +118,7 @@ static void link_initialized(void *data)
ld->global = pw_impl_link_get_global(ld->link);
pw_global_add_listener(ld->global, &ld->global_listener, &global_events, ld);
res = pw_global_bind(ld->global, client, PW_PERM_RWX, PW_VERSION_LINK_PROXY, ld->new_id);
res = pw_global_bind(ld->global, client, PW_PERM_RWX, PW_VERSION_LINK, ld->new_id);
if (res < 0)
goto error_bind;
@ -371,7 +371,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
factory = pw_impl_factory_new(context,
"link-factory",
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
PW_VERSION_LINK,
pw_properties_new(
PW_KEY_FACTORY_USAGE, FACTORY_USAGE,
NULL),

View file

@ -1741,7 +1741,7 @@ static int client_demarshal_update_permissions(void *object, const struct pw_pro
static int link_method_marshal_add_listener(void *object,
struct spa_hook *listener,
const struct pw_link_proxy_events *events,
const struct pw_link_events *events,
void *data)
{
struct pw_proxy *proxy = object;
@ -1755,7 +1755,7 @@ static void link_marshal_info(void *object, const struct pw_link_info *info)
struct spa_pod_builder *b;
struct spa_pod_frame f;
b = pw_protocol_native_begin_resource(resource, PW_LINK_PROXY_EVENT_INFO, NULL);
b = pw_protocol_native_begin_resource(resource, PW_LINK_EVENT_INFO, NULL);
spa_pod_builder_push_struct(b, &f);
spa_pod_builder_add(b,
@ -1807,7 +1807,7 @@ static int link_demarshal_info(void *object, const struct pw_protocol_native_mes
if (parse_dict(&prs, &props) < 0)
return -EINVAL;
return pw_proxy_notify(proxy, struct pw_link_proxy_events, info, 0, &info);
return pw_proxy_notify(proxy, struct pw_link_events, info, 0, &info);
}
static int registry_demarshal_global(void *object, const struct pw_protocol_native_message *msg)
@ -2229,34 +2229,34 @@ static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
};
static const struct pw_link_proxy_methods pw_protocol_native_link_method_marshal = {
PW_VERSION_LINK_PROXY_METHODS,
static const struct pw_link_methods pw_protocol_native_link_method_marshal = {
PW_VERSION_LINK_METHODS,
.add_listener = &link_method_marshal_add_listener,
};
static const struct pw_protocol_native_demarshal
pw_protocol_native_link_method_demarshal[PW_LINK_PROXY_METHOD_NUM] =
pw_protocol_native_link_method_demarshal[PW_LINK_METHOD_NUM] =
{
[PW_LINK_PROXY_METHOD_ADD_LISTENER] = { NULL, 0, },
[PW_LINK_METHOD_ADD_LISTENER] = { NULL, 0, },
};
static const struct pw_link_proxy_events pw_protocol_native_link_event_marshal = {
PW_VERSION_LINK_PROXY_EVENTS,
static const struct pw_link_events pw_protocol_native_link_event_marshal = {
PW_VERSION_LINK_EVENTS,
.info = &link_marshal_info,
};
static const struct pw_protocol_native_demarshal
pw_protocol_native_link_event_demarshal[PW_LINK_PROXY_EVENT_NUM] =
pw_protocol_native_link_event_demarshal[PW_LINK_EVENT_NUM] =
{
[PW_LINK_PROXY_EVENT_INFO] = { &link_demarshal_info, 0, }
[PW_LINK_EVENT_INFO] = { &link_demarshal_info, 0, }
};
static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
PW_VERSION_LINK,
0,
PW_LINK_PROXY_METHOD_NUM,
PW_LINK_PROXY_EVENT_NUM,
PW_LINK_METHOD_NUM,
PW_LINK_EVENT_NUM,
.client_marshal = &pw_protocol_native_link_method_marshal,
.server_demarshal = pw_protocol_native_link_method_demarshal,
.server_marshal = &pw_protocol_native_link_event_marshal,

View file

@ -507,12 +507,12 @@ struct pw_client_v0_events {
#define PW_VERSION_LINK_V0 0
#define PW_LINK_PROXY_V0_EVENT_INFO 0
#define PW_LINK_PROXY_V0_EVENT_NUM 1
#define PW_LINK_V0_EVENT_INFO 0
#define PW_LINK_V0_EVENT_NUM 1
/** Link events */
struct pw_link_proxy_v0_events {
#define PW_VERSION_LINK_PROXY_V0_EVENTS 0
struct pw_link_v0_events {
#define PW_VERSION_LINK_V0_EVENTS 0
uint32_t version;
/**
* Notify link info
@ -522,7 +522,7 @@ struct pw_link_proxy_v0_events {
void (*info) (void *object, struct pw_link_info *info);
};
#define pw_link_resource_v0_info(r,...) pw_resource_notify(r,struct pw_link_proxy_v0_events,info,__VA_ARGS__)
#define pw_link_resource_v0_info(r,...) pw_resource_notify(r,struct pw_link_v0_events,info,__VA_ARGS__)
#ifdef __cplusplus
} /* extern "C" */

View file

@ -993,7 +993,7 @@ static void link_marshal_info(void *object, const struct pw_link_info *info)
struct spa_pod_frame f;
uint32_t i, n_items;
b = pw_protocol_native_begin_resource(resource, PW_LINK_PROXY_V0_EVENT_INFO, NULL);
b = pw_protocol_native_begin_resource(resource, PW_LINK_V0_EVENT_INFO, NULL);
n_items = info->props ? info->props->n_items : 0;
@ -1165,8 +1165,8 @@ static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
NULL,
};
static const struct pw_link_proxy_events pw_protocol_native_link_event_marshal = {
PW_VERSION_LINK_PROXY_EVENTS,
static const struct pw_link_events pw_protocol_native_link_event_marshal = {
PW_VERSION_LINK_EVENTS,
.info = &link_marshal_info,
};
@ -1174,7 +1174,7 @@ static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_V0,
0,
PW_LINK_PROXY_EVENT_NUM,
PW_LINK_EVENT_NUM,
0,
NULL, NULL,
&pw_protocol_native_link_event_marshal,

View file

@ -41,7 +41,7 @@
#define NAME "link"
#define pw_link_resource_info(r,...) pw_resource_call(r,struct pw_link_proxy_events,info,0,__VA_ARGS__)
#define pw_link_resource_info(r,...) pw_resource_call(r,struct pw_link_events,info,0,__VA_ARGS__)
/** \cond */
struct impl {
@ -1230,7 +1230,7 @@ int pw_impl_link_register(struct pw_impl_link *link,
link->global = pw_global_new(context,
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
PW_VERSION_LINK,
properties,
global_bind,
link);

View file

@ -34,8 +34,8 @@ extern "C" {
#include <pipewire/proxy.h>
#define PW_VERSION_LINK_PROXY 3
struct pw_link_proxy;
#define PW_VERSION_LINK 3
struct pw_link;
/** \enum pw_link_state The different link states \memberof pw_link */
enum pw_link_state {
@ -75,12 +75,12 @@ void
pw_link_info_free(struct pw_link_info *info);
#define PW_LINK_PROXY_EVENT_INFO 0
#define PW_LINK_PROXY_EVENT_NUM 1
#define PW_LINK_EVENT_INFO 0
#define PW_LINK_EVENT_NUM 1
/** Link events */
struct pw_link_proxy_events {
#define PW_VERSION_LINK_PROXY_EVENTS 0
struct pw_link_events {
#define PW_VERSION_LINK_EVENTS 0
uint32_t version;
/**
* Notify link info
@ -90,30 +90,30 @@ struct pw_link_proxy_events {
void (*info) (void *object, const struct pw_link_info *info);
};
#define PW_LINK_PROXY_METHOD_ADD_LISTENER 0
#define PW_LINK_PROXY_METHOD_NUM 1
#define PW_LINK_METHOD_ADD_LISTENER 0
#define PW_LINK_METHOD_NUM 1
/** Link methods */
struct pw_link_proxy_methods {
#define PW_VERSION_LINK_PROXY_METHODS 0
struct pw_link_methods {
#define PW_VERSION_LINK_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_link_proxy_events *events,
const struct pw_link_events *events,
void *data);
};
#define pw_link_proxy_method(o,method,version,...) \
#define pw_link_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_link_proxy_methods, _res, \
struct pw_link_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_link_proxy_add_listener(c,...) pw_link_proxy_method(c,add_listener,0,__VA_ARGS__)
#define pw_link_add_listener(c,...) pw_link_method(c,add_listener,0,__VA_ARGS__)
#ifdef __cplusplus
} /* extern "C" */

View file

@ -336,28 +336,28 @@ static void test_client_abi(void)
static void test_link_abi(void)
{
struct pw_link_proxy_methods m;
struct pw_link_proxy_events e;
struct pw_link_methods m;
struct pw_link_events e;
struct {
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_link_proxy_events *events,
const struct pw_link_events *events,
void *data);
} methods = { PW_VERSION_LINK_PROXY_METHODS, };
} methods = { PW_VERSION_LINK_METHODS, };
struct {
uint32_t version;
void (*info) (void *object, const struct pw_link_info *info);
} events = { PW_VERSION_LINK_PROXY_EVENTS, };
} events = { PW_VERSION_LINK_EVENTS, };
TEST_FUNC(m, methods, version);
TEST_FUNC(m, methods, add_listener);
spa_assert(PW_VERSION_LINK_PROXY_METHODS == 0);
spa_assert(PW_VERSION_LINK_METHODS == 0);
spa_assert(sizeof(m) == sizeof(methods));
TEST_FUNC(e, events, version);
TEST_FUNC(e, events, info);
spa_assert(PW_VERSION_LINK_PROXY_EVENTS == 0);
spa_assert(PW_VERSION_LINK_EVENTS == 0);
spa_assert(sizeof(e) == sizeof(events));
}

View file

@ -871,8 +871,8 @@ static void link_event_info(void *object, const struct pw_link_info *info)
}
}
static const struct pw_link_proxy_events link_events = {
PW_VERSION_LINK_PROXY_EVENTS,
static const struct pw_link_events link_events = {
PW_VERSION_LINK_EVENTS,
.info = link_event_info
};
@ -1134,7 +1134,7 @@ static bool bind_global(struct remote_data *rd, struct global *global, char **er
break;
case PW_TYPE_INTERFACE_Link:
events = &link_events;
client_version = PW_VERSION_LINK_PROXY;
client_version = PW_VERSION_LINK;
destroy = (pw_destroy_t) pw_link_info_free;
info_func = info_link;
break;
@ -1366,7 +1366,7 @@ static bool do_create_link(struct data *data, const char *cmd, char *args, char
proxy = (struct pw_proxy*)pw_core_create_object(rd->core,
"link-factory",
PW_TYPE_INTERFACE_Link,
PW_VERSION_LINK_PROXY,
PW_VERSION_LINK,
props ? &props->dict : NULL,
sizeof(struct proxy_data));

View file

@ -531,8 +531,8 @@ static void link_event_info(void *data, const struct pw_link_info *info)
global_event_info(data, info);
}
static const struct pw_link_proxy_events link_events = {
PW_VERSION_LINK_PROXY_EVENTS,
static const struct pw_link_events link_events = {
PW_VERSION_LINK_EVENTS,
.info = link_event_info
};
@ -629,7 +629,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
info_destroy = (pw_destroy_t)pw_link_info_free;
info_update = (info_update_t)pw_link_info_update;
draw = draw_link;
client_version = PW_VERSION_LINK_PROXY;
client_version = PW_VERSION_LINK;
break;
case PW_TYPE_INTERFACE_Client:
events = &client_events;

View file

@ -476,8 +476,8 @@ static void link_event_info(void *object, const struct pw_link_info *info)
}
}
static const struct pw_link_proxy_events link_events = {
PW_VERSION_LINK_PROXY_EVENTS,
static const struct pw_link_events link_events = {
PW_VERSION_LINK_EVENTS,
.info = link_event_info
};
@ -611,7 +611,7 @@ static void registry_event_global(void *data, uint32_t id,
break;
case PW_TYPE_INTERFACE_Link:
events = &link_events;
client_version = PW_VERSION_LINK_PROXY;
client_version = PW_VERSION_LINK;
destroy = (pw_destroy_t) pw_link_info_free;
break;
default: