mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
pw_factory_proxy -> pw_factory
This commit is contained in:
parent
f1eb5f6046
commit
114982f3f5
9 changed files with 57 additions and 57 deletions
|
|
@ -978,7 +978,7 @@ static int device_demarshal_set_param(void *object, const struct pw_protocol_nat
|
|||
|
||||
static int factory_method_marshal_add_listener(void *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_factory_proxy_events *events,
|
||||
const struct pw_factory_events *events,
|
||||
void *data)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
|
|
@ -992,7 +992,7 @@ static void factory_marshal_info(void *object, const struct pw_factory_info *inf
|
|||
struct spa_pod_builder *b;
|
||||
struct spa_pod_frame f;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_FACTORY_PROXY_EVENT_INFO, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_FACTORY_EVENT_INFO, NULL);
|
||||
|
||||
spa_pod_builder_push_struct(b, &f);
|
||||
spa_pod_builder_add(b,
|
||||
|
|
@ -1036,7 +1036,7 @@ static int factory_demarshal_info(void *object, const struct pw_protocol_native_
|
|||
if (parse_dict(&prs, &props) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pw_proxy_notify(proxy, struct pw_factory_proxy_events, info, 0, &info);
|
||||
return pw_proxy_notify(proxy, struct pw_factory_events, info, 0, &info);
|
||||
}
|
||||
|
||||
static int node_method_marshal_add_listener(void *object,
|
||||
|
|
@ -2028,34 +2028,34 @@ const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
|
|||
.client_demarshal = pw_protocol_native_module_event_demarshal,
|
||||
};
|
||||
|
||||
static const struct pw_factory_proxy_events pw_protocol_native_factory_event_marshal = {
|
||||
PW_VERSION_FACTORY_PROXY_EVENTS,
|
||||
static const struct pw_factory_events pw_protocol_native_factory_event_marshal = {
|
||||
PW_VERSION_FACTORY_EVENTS,
|
||||
.info = &factory_marshal_info,
|
||||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal
|
||||
pw_protocol_native_factory_event_demarshal[PW_FACTORY_PROXY_EVENT_NUM] =
|
||||
pw_protocol_native_factory_event_demarshal[PW_FACTORY_EVENT_NUM] =
|
||||
{
|
||||
[PW_FACTORY_PROXY_EVENT_INFO] = { &factory_demarshal_info, 0, },
|
||||
[PW_FACTORY_EVENT_INFO] = { &factory_demarshal_info, 0, },
|
||||
};
|
||||
|
||||
static const struct pw_factory_proxy_methods pw_protocol_native_factory_method_marshal = {
|
||||
PW_VERSION_FACTORY_PROXY_METHODS,
|
||||
static const struct pw_factory_methods pw_protocol_native_factory_method_marshal = {
|
||||
PW_VERSION_FACTORY_METHODS,
|
||||
.add_listener = &factory_method_marshal_add_listener,
|
||||
};
|
||||
|
||||
static const struct pw_protocol_native_demarshal
|
||||
pw_protocol_native_factory_method_demarshal[PW_FACTORY_PROXY_METHOD_NUM] =
|
||||
pw_protocol_native_factory_method_demarshal[PW_FACTORY_METHOD_NUM] =
|
||||
{
|
||||
[PW_FACTORY_PROXY_METHOD_ADD_LISTENER] = { NULL, 0, },
|
||||
[PW_FACTORY_METHOD_ADD_LISTENER] = { NULL, 0, },
|
||||
};
|
||||
|
||||
const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
|
||||
PW_TYPE_INTERFACE_Factory,
|
||||
PW_VERSION_FACTORY_PROXY,
|
||||
PW_VERSION_FACTORY,
|
||||
0,
|
||||
PW_FACTORY_PROXY_METHOD_NUM,
|
||||
PW_FACTORY_PROXY_EVENT_NUM,
|
||||
PW_FACTORY_METHOD_NUM,
|
||||
PW_FACTORY_EVENT_NUM,
|
||||
.client_marshal = &pw_protocol_native_factory_method_marshal,
|
||||
.server_demarshal = pw_protocol_native_factory_method_demarshal,
|
||||
.server_marshal = &pw_protocol_native_factory_event_marshal,
|
||||
|
|
|
|||
|
|
@ -466,14 +466,14 @@ struct pw_port_proxy_v0_methods {
|
|||
const struct spa_pod *filter);
|
||||
};
|
||||
|
||||
#define PW_VERSION_FACTORY_V0 0
|
||||
#define PW_VERSION_FACTORY_V0 0
|
||||
|
||||
#define PW_FACTORY_PROXY_V0_EVENT_INFO 0
|
||||
#define PW_FACTORY_PROXY_V0_EVENT_NUM 1
|
||||
#define PW_FACTORY_V0_EVENT_INFO 0
|
||||
#define PW_FACTORY_V0_EVENT_NUM 1
|
||||
|
||||
/** Factory events */
|
||||
struct pw_factory_proxy_v0_events {
|
||||
#define PW_VERSION_FACTORY_PROXY_V0_EVENTS 0
|
||||
struct pw_factory_v0_events {
|
||||
#define PW_VERSION_FACTORY_V0_EVENTS 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* Notify factory info
|
||||
|
|
@ -483,9 +483,9 @@ struct pw_factory_proxy_v0_events {
|
|||
void (*info) (void *object, struct pw_factory_info *info);
|
||||
};
|
||||
|
||||
#define pw_factory_resource_v0_info(r,...) pw_resource_notify(r,struct pw_factory_proxy_v0_events,info,__VA_ARGS__)
|
||||
#define pw_factory_resource_v0_info(r,...) pw_resource_notify(r,struct pw_factory_v0_events,info,__VA_ARGS__)
|
||||
|
||||
#define PW_VERSION_CLIENT_V0 0
|
||||
#define PW_VERSION_CLIENT_V0 0
|
||||
|
||||
#define PW_CLIENT_V0_EVENT_INFO 0
|
||||
#define PW_CLIENT_V0_EVENT_NUM 1
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ static void factory_marshal_info(void *object, const struct pw_factory_info *inf
|
|||
struct spa_pod_frame f;
|
||||
uint32_t i, n_items, type, version;
|
||||
|
||||
b = pw_protocol_native_begin_resource(resource, PW_FACTORY_PROXY_V0_EVENT_INFO, NULL);
|
||||
b = pw_protocol_native_begin_resource(resource, PW_FACTORY_V0_EVENT_INFO, NULL);
|
||||
|
||||
n_items = info->props ? info->props->n_items : 0;
|
||||
|
||||
|
|
@ -1087,8 +1087,8 @@ static const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static const struct pw_factory_proxy_events pw_protocol_native_factory_event_marshal = {
|
||||
PW_VERSION_FACTORY_PROXY_EVENTS,
|
||||
static const struct pw_factory_events pw_protocol_native_factory_event_marshal = {
|
||||
PW_VERSION_FACTORY_EVENTS,
|
||||
.info = &factory_marshal_info,
|
||||
};
|
||||
|
||||
|
|
@ -1096,7 +1096,7 @@ static const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
|
|||
PW_TYPE_INTERFACE_Factory,
|
||||
PW_VERSION_FACTORY_V0,
|
||||
0,
|
||||
PW_FACTORY_PROXY_EVENT_NUM,
|
||||
PW_FACTORY_EVENT_NUM,
|
||||
0,
|
||||
NULL, NULL,
|
||||
&pw_protocol_native_factory_event_marshal,
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ extern "C" {
|
|||
|
||||
#include <pipewire/proxy.h>
|
||||
|
||||
#define PW_VERSION_FACTORY_PROXY 3
|
||||
struct pw_factory_proxy;
|
||||
#define PW_VERSION_FACTORY 3
|
||||
struct pw_factory;
|
||||
|
||||
/** The factory information. Extra information can be added in later versions \memberof pw_introspect */
|
||||
struct pw_factory_info {
|
||||
|
|
@ -60,12 +60,12 @@ void
|
|||
pw_factory_info_free(struct pw_factory_info *info);
|
||||
|
||||
|
||||
#define PW_FACTORY_PROXY_EVENT_INFO 0
|
||||
#define PW_FACTORY_PROXY_EVENT_NUM 1
|
||||
#define PW_FACTORY_EVENT_INFO 0
|
||||
#define PW_FACTORY_EVENT_NUM 1
|
||||
|
||||
/** Factory events */
|
||||
struct pw_factory_proxy_events {
|
||||
#define PW_VERSION_FACTORY_PROXY_EVENTS 0
|
||||
struct pw_factory_events {
|
||||
#define PW_VERSION_FACTORY_EVENTS 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* Notify factory info
|
||||
|
|
@ -75,30 +75,30 @@ struct pw_factory_proxy_events {
|
|||
void (*info) (void *object, const struct pw_factory_info *info);
|
||||
};
|
||||
|
||||
#define PW_FACTORY_PROXY_METHOD_ADD_LISTENER 0
|
||||
#define PW_FACTORY_PROXY_METHOD_NUM 1
|
||||
#define PW_FACTORY_METHOD_ADD_LISTENER 0
|
||||
#define PW_FACTORY_METHOD_NUM 1
|
||||
|
||||
/** Factory methods */
|
||||
struct pw_factory_proxy_methods {
|
||||
#define PW_VERSION_FACTORY_PROXY_METHODS 0
|
||||
struct pw_factory_methods {
|
||||
#define PW_VERSION_FACTORY_METHODS 0
|
||||
uint32_t version;
|
||||
|
||||
int (*add_listener) (void *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_factory_proxy_events *events,
|
||||
const struct pw_factory_events *events,
|
||||
void *data);
|
||||
};
|
||||
|
||||
#define pw_factory_proxy_method(o,method,version,...) \
|
||||
#define pw_factory_method(o,method,version,...) \
|
||||
({ \
|
||||
int _res = -ENOTSUP; \
|
||||
spa_interface_call_res((struct spa_interface*)o, \
|
||||
struct pw_factory_proxy_methods, _res, \
|
||||
struct pw_factory_methods, _res, \
|
||||
method, version, ##__VA_ARGS__); \
|
||||
_res; \
|
||||
})
|
||||
|
||||
#define pw_factory_proxy_add_listener(c,...) pw_factory_proxy_method(c,add_listener,0,__VA_ARGS__)
|
||||
#define pw_factory_add_listener(c,...) pw_factory_method(c,add_listener,0,__VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#define NAME "factory"
|
||||
|
||||
#define pw_factory_resource_info(r,...) pw_resource_call(r,struct pw_factory_proxy_events,info,0,__VA_ARGS__)
|
||||
#define pw_factory_resource_info(r,...) pw_resource_call(r,struct pw_factory_events,info,0,__VA_ARGS__)
|
||||
|
||||
struct resource_data {
|
||||
struct spa_hook resource_listener;
|
||||
|
|
@ -217,7 +217,7 @@ int pw_impl_factory_register(struct pw_impl_factory *factory,
|
|||
|
||||
factory->global = pw_global_new(context,
|
||||
PW_TYPE_INTERFACE_Factory,
|
||||
PW_VERSION_FACTORY_PROXY,
|
||||
PW_VERSION_FACTORY,
|
||||
properties,
|
||||
global_bind,
|
||||
factory);
|
||||
|
|
|
|||
|
|
@ -270,28 +270,28 @@ static void test_port_abi(void)
|
|||
|
||||
static void test_factory_abi(void)
|
||||
{
|
||||
struct pw_factory_proxy_methods m;
|
||||
struct pw_factory_proxy_events e;
|
||||
struct pw_factory_methods m;
|
||||
struct pw_factory_events e;
|
||||
struct {
|
||||
uint32_t version;
|
||||
int (*add_listener) (void *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_factory_proxy_events *events,
|
||||
const struct pw_factory_events *events,
|
||||
void *data);
|
||||
} methods = { PW_VERSION_FACTORY_PROXY_METHODS, };
|
||||
} methods = { PW_VERSION_FACTORY_METHODS, };
|
||||
struct {
|
||||
uint32_t version;
|
||||
void (*info) (void *object, const struct pw_factory_info *info);
|
||||
} events = { PW_VERSION_FACTORY_PROXY_EVENTS, };
|
||||
} events = { PW_VERSION_FACTORY_EVENTS, };
|
||||
|
||||
TEST_FUNC(m, methods, version);
|
||||
TEST_FUNC(m, methods, add_listener);
|
||||
spa_assert(PW_VERSION_FACTORY_PROXY_METHODS == 0);
|
||||
spa_assert(PW_VERSION_FACTORY_METHODS == 0);
|
||||
spa_assert(sizeof(m) == sizeof(methods));
|
||||
|
||||
TEST_FUNC(e, events, version);
|
||||
TEST_FUNC(e, events, info);
|
||||
spa_assert(PW_VERSION_FACTORY_PROXY_EVENTS == 0);
|
||||
spa_assert(PW_VERSION_FACTORY_EVENTS == 0);
|
||||
spa_assert(sizeof(e) == sizeof(events));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -811,8 +811,8 @@ static void factory_event_info(void *object, const struct pw_factory_info *info)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct pw_factory_proxy_events factory_events = {
|
||||
PW_VERSION_FACTORY_PROXY_EVENTS,
|
||||
static const struct pw_factory_events factory_events = {
|
||||
PW_VERSION_FACTORY_EVENTS,
|
||||
.info = factory_event_info
|
||||
};
|
||||
|
||||
|
|
@ -1122,7 +1122,7 @@ static bool bind_global(struct remote_data *rd, struct global *global, char **er
|
|||
break;
|
||||
case PW_TYPE_INTERFACE_Factory:
|
||||
events = &factory_events;
|
||||
client_version = PW_VERSION_FACTORY_PROXY;
|
||||
client_version = PW_VERSION_FACTORY;
|
||||
destroy = (pw_destroy_t) pw_factory_info_free;
|
||||
info_func = info_factory;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -561,8 +561,8 @@ static void factory_event_info(void *data, const struct pw_factory_info *info)
|
|||
global_event_info(data, info);
|
||||
}
|
||||
|
||||
static const struct pw_factory_proxy_events factory_events = {
|
||||
PW_VERSION_FACTORY_PROXY_EVENTS,
|
||||
static const struct pw_factory_events factory_events = {
|
||||
PW_VERSION_FACTORY_EVENTS,
|
||||
.info = factory_event_info
|
||||
};
|
||||
|
||||
|
|
@ -650,7 +650,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
|
|||
info_destroy = (pw_destroy_t)pw_factory_info_free;
|
||||
info_update = (info_update_t)pw_factory_info_update;
|
||||
draw = draw_factory;
|
||||
client_version = PW_VERSION_FACTORY_PROXY;
|
||||
client_version = PW_VERSION_FACTORY;
|
||||
break;
|
||||
case PW_TYPE_INTERFACE_Module:
|
||||
events = &module_events;
|
||||
|
|
|
|||
|
|
@ -393,8 +393,8 @@ static void factory_event_info(void *object, const struct pw_factory_info *info)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct pw_factory_proxy_events factory_events = {
|
||||
PW_VERSION_FACTORY_PROXY_EVENTS,
|
||||
static const struct pw_factory_events factory_events = {
|
||||
PW_VERSION_FACTORY_EVENTS,
|
||||
.info = factory_event_info
|
||||
};
|
||||
|
||||
|
|
@ -601,7 +601,7 @@ static void registry_event_global(void *data, uint32_t id,
|
|||
break;
|
||||
case PW_TYPE_INTERFACE_Factory:
|
||||
events = &factory_events;
|
||||
client_version = PW_VERSION_FACTORY_PROXY;
|
||||
client_version = PW_VERSION_FACTORY;
|
||||
destroy = (pw_destroy_t) pw_factory_info_free;
|
||||
break;
|
||||
case PW_TYPE_INTERFACE_Client:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue