pw_node_proxy -> pw_node

This commit is contained in:
Wim Taymans 2019-12-11 15:26:11 +01:00
parent 199fa47216
commit beb3c69dfe
23 changed files with 126 additions and 126 deletions

View file

@ -445,7 +445,7 @@ static void endpoint_event_param(void *object, int seq,
} }
static const struct pw_endpoint_proxy_events endpoint_events = { static const struct pw_endpoint_proxy_events endpoint_events = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_ENDPOINT_PROXY_EVENTS,
.info = endpoint_event_info, .info = endpoint_event_info,
.param = endpoint_event_param, .param = endpoint_event_param,
}; };

View file

@ -60,8 +60,8 @@ static void node_event_info(void *object, const struct pw_node_info *info)
} }
} }
static const struct pw_node_proxy_events node_events = { static const struct pw_node_events node_events = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = node_event_info, .info = node_event_info,
}; };
@ -97,7 +97,7 @@ static int make_node(struct data *data)
if (data->proxy == NULL) if (data->proxy == NULL)
return -errno; return -errno;
pw_node_proxy_add_listener((struct pw_node_proxy*)data->proxy, pw_node_add_listener((struct pw_node*)data->proxy,
&data->node_listener, &node_events, data); &data->node_listener, &node_events, data);
return 0; return 0;

View file

@ -363,7 +363,7 @@ static int make_nodes(struct data *data)
out = pw_core_create_object(data->core, out = pw_core_create_object(data->core,
"spa-node-factory", "spa-node-factory",
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
&props->dict, 0); &props->dict, 0);

View file

@ -126,7 +126,7 @@ static int client_endpoint_set_param(void *object,
struct endpoint *endpoint = object; struct endpoint *endpoint = object;
struct impl *impl = endpoint->impl; struct impl *impl = endpoint->impl;
pw_log_debug(NAME " %p: endpoint %p set param %d", impl, endpoint, id); pw_log_debug(NAME " %p: endpoint %p set param %d", impl, endpoint, id);
return pw_node_proxy_set_param((struct pw_node_proxy*)endpoint->node->node->obj.proxy, return pw_node_set_param((struct pw_node*)endpoint->node->node->obj.proxy,
id, flags, param); id, flags, param);
} }
@ -161,7 +161,7 @@ static int stream_set_active(struct endpoint *endpoint, struct stream *stream, b
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG)) if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
spa_debug_pod(2, NULL, param); spa_debug_pod(2, NULL, param);
pw_node_proxy_set_param((struct pw_node_proxy*)endpoint->node->node->obj.proxy, pw_node_set_param((struct pw_node*)endpoint->node->node->obj.proxy,
SPA_PARAM_PortConfig, 0, param); SPA_PARAM_PortConfig, 0, param);
} }
stream->active = active; stream->active = active;
@ -522,7 +522,7 @@ static struct endpoint *create_endpoint(struct node *node, struct endpoint *moni
subscribe[n_subscribe++] = SPA_PARAM_PropInfo; subscribe[n_subscribe++] = SPA_PARAM_PropInfo;
pw_log_debug(NAME" %p: endpoint %p proxy %p subscribe %d params", impl, pw_log_debug(NAME" %p: endpoint %p proxy %p subscribe %d params", impl,
endpoint, node->node->obj.proxy, n_subscribe); endpoint, node->node->obj.proxy, n_subscribe);
pw_node_proxy_subscribe_params((struct pw_node_proxy*)node->node->obj.proxy, pw_node_subscribe_params((struct pw_node*)node->node->obj.proxy,
subscribe, n_subscribe); subscribe, n_subscribe);
spa_list_append(&device->endpoint_list, &endpoint->link); spa_list_append(&device->endpoint_list, &endpoint->link);

View file

@ -63,7 +63,7 @@ void * sm_alsa_midi_start(struct sm_media_session *session)
impl->proxy = sm_media_session_create_object(session, impl->proxy = sm_media_session_create_object(session,
"spa-node-factory", "spa-node-factory",
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
&impl->props->dict, &impl->props->dict,
0); 0);

View file

@ -152,7 +152,7 @@ static struct bluez5_node *bluez5_create_node(struct bluez5_object *obj, uint32_
node->adapter = pw_impl_factory_create_object(factory, node->adapter = pw_impl_factory_create_object(factory,
NULL, NULL,
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
pw_properties_copy(node->props), pw_properties_copy(node->props),
0); 0);
if (node->adapter == NULL) { if (node->adapter == NULL) {

View file

@ -427,7 +427,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
if (n_subscribe > 0) { if (n_subscribe > 0) {
pw_log_debug(NAME" %p: node %d subscribe %d params", impl, pw_log_debug(NAME" %p: node %d subscribe %d params", impl,
node->obj.id, n_subscribe); node->obj.id, n_subscribe);
pw_node_proxy_subscribe_params((struct pw_node_proxy*)node->obj.proxy, pw_node_subscribe_params((struct pw_node*)node->obj.proxy,
subscribe, n_subscribe); subscribe, n_subscribe);
node->subscribe = true; node->subscribe = true;
} }
@ -458,8 +458,8 @@ static void node_event_param(void *object, int seq,
node->obj.changed |= SM_NODE_CHANGE_MASK_PARAMS; node->obj.changed |= SM_NODE_CHANGE_MASK_PARAMS;
} }
static const struct pw_node_proxy_events node_events = { static const struct pw_node_events node_events = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = node_event_info, .info = node_event_info,
.param = node_event_param, .param = node_event_param,
}; };
@ -508,7 +508,7 @@ static void node_destroy(void *object)
static const struct object_info node_info = { static const struct object_info node_info = {
.type = PW_TYPE_INTERFACE_Node, .type = PW_TYPE_INTERFACE_Node,
.version = PW_VERSION_NODE_PROXY, .version = PW_VERSION_NODE,
.events = &node_events, .events = &node_events,
.size = sizeof(struct sm_node), .size = sizeof(struct sm_node),
.init = node_init, .init = node_init,
@ -1256,7 +1256,7 @@ struct sm_node *sm_media_session_create_node(struct sm_media_session *sess,
proxy = pw_core_create_object(impl->policy_core, proxy = pw_core_create_object(impl->policy_core,
factory_name, factory_name,
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
props, props,
sizeof(struct sm_node)); sizeof(struct sm_node));

View file

@ -112,7 +112,7 @@ static int client_endpoint_set_param(void *object,
struct node *node = endpoint->node; struct node *node = endpoint->node;
pw_log_debug(NAME " %p: node %d set param %d", impl, node->obj->obj.id, id); pw_log_debug(NAME " %p: node %d set param %d", impl, node->obj->obj.id, id);
return pw_node_proxy_set_param((struct pw_node_proxy*)node->obj->obj.proxy, return pw_node_set_param((struct pw_node*)node->obj->obj.proxy,
id, flags, param); id, flags, param);
} }
@ -150,7 +150,7 @@ static int stream_set_active(struct stream *stream, bool active)
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG)) if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
spa_debug_pod(2, NULL, param); spa_debug_pod(2, NULL, param);
pw_node_proxy_set_param((struct pw_node_proxy*)node->obj->obj.proxy, pw_node_set_param((struct pw_node*)node->obj->obj.proxy,
SPA_PARAM_PortConfig, 0, param); SPA_PARAM_PortConfig, 0, param);
} }
stream->active = active; stream->active = active;
@ -451,7 +451,7 @@ static struct endpoint *create_endpoint(struct node *node)
subscribe[n_subscribe++] = SPA_PARAM_PropInfo; subscribe[n_subscribe++] = SPA_PARAM_PropInfo;
pw_log_debug(NAME" %p: node %p proxy %p subscribe %d params", impl, pw_log_debug(NAME" %p: node %p proxy %p subscribe %d params", impl,
node->obj, node->obj->obj.proxy, n_subscribe); node->obj, node->obj->obj.proxy, n_subscribe);
pw_node_proxy_subscribe_params((struct pw_node_proxy*)node->obj->obj.proxy, pw_node_subscribe_params((struct pw_node*)node->obj->obj.proxy,
subscribe, n_subscribe); subscribe, n_subscribe);
sm_media_session_sync(impl->session, complete_endpoint, endpoint); sm_media_session_sync(impl->session, complete_endpoint, endpoint);

View file

@ -146,7 +146,7 @@ static struct v4l2_node *v4l2_create_node(struct v4l2_object *obj, uint32_t id,
node->proxy = sm_media_session_create_object(impl->session, node->proxy = sm_media_session_create_object(impl->session,
"spa-node-factory", "spa-node-factory",
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
&node->props->dict, &node->props->dict,
0); 0);
if (node->proxy == NULL) { if (node->proxy == NULL) {

View file

@ -182,7 +182,7 @@ struct core_data {
struct node_data { struct node_data {
struct spa_list link; struct spa_list link;
GstPipeWireDeviceProvider *self; GstPipeWireDeviceProvider *self;
struct pw_node_proxy *proxy; struct pw_node *proxy;
struct spa_hook proxy_listener; struct spa_hook proxy_listener;
uint32_t id; uint32_t id;
struct spa_hook node_listener; struct spa_hook node_listener;
@ -400,13 +400,13 @@ static void node_event_info(void *data, const struct pw_node_info *info)
node_data->info = pw_node_info_update(node_data->info, info); node_data->info = pw_node_info_update(node_data->info, info);
} }
static const struct pw_node_proxy_events node_events = { static const struct pw_node_events node_events = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = node_event_info .info = node_event_info
}; };
static void static void
destroy_node_proxy (void *data) destroy_node (void *data)
{ {
struct node_data *nd = data; struct node_data *nd = data;
GstPipeWireDeviceProvider *self = nd->self; GstPipeWireDeviceProvider *self = nd->self;
@ -429,7 +429,7 @@ destroy_node_proxy (void *data)
static const struct pw_proxy_events proxy_node_events = { static const struct pw_proxy_events proxy_node_events = {
PW_VERSION_PROXY_EVENTS, PW_VERSION_PROXY_EVENTS,
.destroy = destroy_node_proxy, .destroy = destroy_node,
}; };
static void static void
@ -455,11 +455,11 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
struct node_data *nd; struct node_data *nd;
if (type == PW_TYPE_INTERFACE_Node) { if (type == PW_TYPE_INTERFACE_Node) {
struct pw_node_proxy *node; struct pw_node *node;
node = pw_registry_bind(rd->registry, node = pw_registry_bind(rd->registry,
id, PW_TYPE_INTERFACE_Node, id, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, sizeof(*nd)); PW_VERSION_NODE, sizeof(*nd));
if (node == NULL) if (node == NULL)
goto no_mem; goto no_mem;
@ -469,7 +469,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
nd->id = id; nd->id = id;
nd->caps = gst_caps_new_empty (); nd->caps = gst_caps_new_empty ();
spa_list_append(&rd->nodes, &nd->link); spa_list_append(&rd->nodes, &nd->link);
pw_node_proxy_add_listener(node, &nd->node_listener, &node_events, nd); pw_node_add_listener(node, &nd->node_listener, &node_events, nd);
pw_proxy_add_listener((struct pw_proxy*)node, &nd->proxy_listener, &proxy_node_events, nd); pw_proxy_add_listener((struct pw_proxy*)node, &nd->proxy_listener, &proxy_node_events, nd);
add_pending(self, &nd->pending, NULL, NULL); add_pending(self, &nd->pending, NULL, NULL);
} }

View file

@ -113,7 +113,7 @@ static void node_initialized(void *data)
global = pw_impl_node_get_global(nd->adapter); global = pw_impl_node_get_global(nd->adapter);
res = pw_global_bind(global, client, res = pw_global_bind(global, client,
PW_PERM_RWX, PW_VERSION_NODE_PROXY, nd->new_id); PW_PERM_RWX, PW_VERSION_NODE, nd->new_id);
if (res < 0) if (res < 0)
goto error_bind; goto error_bind;
@ -290,7 +290,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
factory = pw_impl_factory_new(context, factory = pw_impl_factory_new(context,
"adapter", "adapter",
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
pw_properties_new( pw_properties_new(
PW_KEY_FACTORY_USAGE, FACTORY_USAGE, PW_KEY_FACTORY_USAGE, FACTORY_USAGE,
NULL), NULL),

View file

@ -1157,7 +1157,7 @@ static struct pw_proxy *node_export(struct pw_core *core, void *object, bool do_
do_node_init(client_node); do_node_init(client_node);
data->proxy = (struct pw_proxy*) pw_client_node_proxy_get_node(data->client_node, data->proxy = (struct pw_proxy*) pw_client_node_proxy_get_node(data->client_node,
PW_VERSION_NODE_PROXY, user_data_size); PW_VERSION_NODE, user_data_size);
pw_proxy_add_listener(data->proxy, &data->proxy_listener, &proxy_events, data); pw_proxy_add_listener(data->proxy, &data->proxy_listener, &proxy_events, data);

View file

@ -1041,7 +1041,7 @@ static int factory_demarshal_info(void *object, const struct pw_protocol_native_
static int node_method_marshal_add_listener(void *object, static int node_method_marshal_add_listener(void *object,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_node_proxy_events *events, const struct pw_node_events *events,
void *data) void *data)
{ {
struct pw_proxy *proxy = object; struct pw_proxy *proxy = object;
@ -1055,7 +1055,7 @@ static void node_marshal_info(void *object, const struct pw_node_info *info)
struct spa_pod_builder *b; struct spa_pod_builder *b;
struct spa_pod_frame f; struct spa_pod_frame f;
b = pw_protocol_native_begin_resource(resource, PW_NODE_PROXY_EVENT_INFO, NULL); b = pw_protocol_native_begin_resource(resource, PW_NODE_EVENT_INFO, NULL);
spa_pod_builder_push_struct(b, &f); spa_pod_builder_push_struct(b, &f);
spa_pod_builder_add(b, spa_pod_builder_add(b,
@ -1122,7 +1122,7 @@ static int node_demarshal_info(void *object, const struct pw_protocol_native_mes
return -EINVAL; return -EINVAL;
} }
return pw_proxy_notify(proxy, struct pw_node_proxy_events, info, 0, &info); return pw_proxy_notify(proxy, struct pw_node_events, info, 0, &info);
} }
static void node_marshal_param(void *object, int seq, uint32_t id, static void node_marshal_param(void *object, int seq, uint32_t id,
@ -1131,7 +1131,7 @@ static void node_marshal_param(void *object, int seq, uint32_t id,
struct pw_resource *resource = object; struct pw_resource *resource = object;
struct spa_pod_builder *b; struct spa_pod_builder *b;
b = pw_protocol_native_begin_resource(resource, PW_NODE_PROXY_EVENT_PARAM, NULL); b = pw_protocol_native_begin_resource(resource, PW_NODE_EVENT_PARAM, NULL);
spa_pod_builder_add_struct(b, spa_pod_builder_add_struct(b,
SPA_POD_Int(seq), SPA_POD_Int(seq),
@ -1160,7 +1160,7 @@ static int node_demarshal_param(void *object, const struct pw_protocol_native_me
SPA_POD_Pod(&param)) < 0) SPA_POD_Pod(&param)) < 0)
return -EINVAL; return -EINVAL;
return pw_proxy_notify(proxy, struct pw_node_proxy_events, param, 0, return pw_proxy_notify(proxy, struct pw_node_events, param, 0,
seq, id, index, next, param); seq, id, index, next, param);
} }
@ -1169,7 +1169,7 @@ static int node_marshal_subscribe_params(void *object, uint32_t *ids, uint32_t n
struct pw_proxy *proxy = object; struct pw_proxy *proxy = object;
struct spa_pod_builder *b; struct spa_pod_builder *b;
b = pw_protocol_native_begin_proxy(proxy, PW_NODE_PROXY_METHOD_SUBSCRIBE_PARAMS, NULL); b = pw_protocol_native_begin_proxy(proxy, PW_NODE_METHOD_SUBSCRIBE_PARAMS, NULL);
spa_pod_builder_add_struct(b, spa_pod_builder_add_struct(b,
SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id, n_ids, ids)); SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id, n_ids, ids));
@ -1192,7 +1192,7 @@ static int node_demarshal_subscribe_params(void *object, const struct pw_protoco
if (ctype != SPA_TYPE_Id) if (ctype != SPA_TYPE_Id)
return -EINVAL; return -EINVAL;
return pw_resource_notify(resource, struct pw_node_proxy_methods, subscribe_params, 0, return pw_resource_notify(resource, struct pw_node_methods, subscribe_params, 0,
ids, n_ids); ids, n_ids);
} }
@ -1203,7 +1203,7 @@ static int node_marshal_enum_params(void *object, int seq, uint32_t id,
struct pw_proxy *proxy = object; struct pw_proxy *proxy = object;
struct spa_pod_builder *b; struct spa_pod_builder *b;
b = pw_protocol_native_begin_proxy(proxy, PW_NODE_PROXY_METHOD_ENUM_PARAMS, &msg); b = pw_protocol_native_begin_proxy(proxy, PW_NODE_METHOD_ENUM_PARAMS, &msg);
spa_pod_builder_add_struct(b, spa_pod_builder_add_struct(b,
SPA_POD_Int(SPA_RESULT_RETURN_ASYNC(msg->seq)), SPA_POD_Int(SPA_RESULT_RETURN_ASYNC(msg->seq)),
@ -1232,7 +1232,7 @@ static int node_demarshal_enum_params(void *object, const struct pw_protocol_nat
SPA_POD_Pod(&filter)) < 0) SPA_POD_Pod(&filter)) < 0)
return -EINVAL; return -EINVAL;
return pw_resource_notify(resource, struct pw_node_proxy_methods, enum_params, 0, return pw_resource_notify(resource, struct pw_node_methods, enum_params, 0,
seq, id, index, num, filter); seq, id, index, num, filter);
} }
@ -1242,7 +1242,7 @@ static int node_marshal_set_param(void *object, uint32_t id, uint32_t flags,
struct pw_proxy *proxy = object; struct pw_proxy *proxy = object;
struct spa_pod_builder *b; struct spa_pod_builder *b;
b = pw_protocol_native_begin_proxy(proxy, PW_NODE_PROXY_METHOD_SET_PARAM, NULL); b = pw_protocol_native_begin_proxy(proxy, PW_NODE_METHOD_SET_PARAM, NULL);
spa_pod_builder_add_struct(b, spa_pod_builder_add_struct(b,
SPA_POD_Id(id), SPA_POD_Id(id),
@ -1265,7 +1265,7 @@ static int node_demarshal_set_param(void *object, const struct pw_protocol_nativ
SPA_POD_Pod(&param)) < 0) SPA_POD_Pod(&param)) < 0)
return -EINVAL; return -EINVAL;
return pw_resource_notify(resource, struct pw_node_proxy_methods, set_param, 0, id, flags, param); return pw_resource_notify(resource, struct pw_node_methods, set_param, 0, id, flags, param);
} }
static int node_marshal_send_command(void *object, const struct spa_command *command) static int node_marshal_send_command(void *object, const struct spa_command *command)
@ -1273,7 +1273,7 @@ static int node_marshal_send_command(void *object, const struct spa_command *com
struct pw_proxy *proxy = object; struct pw_proxy *proxy = object;
struct spa_pod_builder *b; struct spa_pod_builder *b;
b = pw_protocol_native_begin_proxy(proxy, PW_NODE_PROXY_METHOD_SEND_COMMAND, NULL); b = pw_protocol_native_begin_proxy(proxy, PW_NODE_METHOD_SEND_COMMAND, NULL);
spa_pod_builder_add_struct(b, spa_pod_builder_add_struct(b,
SPA_POD_Pod(command)); SPA_POD_Pod(command));
return pw_protocol_native_end_proxy(proxy, b); return pw_protocol_native_end_proxy(proxy, b);
@ -1290,7 +1290,7 @@ static int node_demarshal_send_command(void *object, const struct pw_protocol_na
SPA_POD_Pod(&command)) < 0) SPA_POD_Pod(&command)) < 0)
return -EINVAL; return -EINVAL;
return pw_resource_notify(resource, struct pw_node_proxy_methods, send_command, 0, command); return pw_resource_notify(resource, struct pw_node_methods, send_command, 0, command);
} }
static int port_method_marshal_add_listener(void *object, static int port_method_marshal_add_listener(void *object,
@ -2100,8 +2100,8 @@ static const struct pw_protocol_marshal pw_protocol_native_device_marshal = {
.client_demarshal = pw_protocol_native_device_event_demarshal, .client_demarshal = pw_protocol_native_device_event_demarshal,
}; };
static const struct pw_node_proxy_methods pw_protocol_native_node_method_marshal = { static const struct pw_node_methods pw_protocol_native_node_method_marshal = {
PW_VERSION_NODE_PROXY_METHODS, PW_VERSION_NODE_METHODS,
.add_listener = &node_method_marshal_add_listener, .add_listener = &node_method_marshal_add_listener,
.subscribe_params = &node_marshal_subscribe_params, .subscribe_params = &node_marshal_subscribe_params,
.enum_params = &node_marshal_enum_params, .enum_params = &node_marshal_enum_params,
@ -2110,33 +2110,33 @@ static const struct pw_node_proxy_methods pw_protocol_native_node_method_marshal
}; };
static const struct pw_protocol_native_demarshal static const struct pw_protocol_native_demarshal
pw_protocol_native_node_method_demarshal[PW_NODE_PROXY_METHOD_NUM] = pw_protocol_native_node_method_demarshal[PW_NODE_METHOD_NUM] =
{ {
[PW_NODE_PROXY_METHOD_ADD_LISTENER] = { NULL, 0, }, [PW_NODE_METHOD_ADD_LISTENER] = { NULL, 0, },
[PW_NODE_PROXY_METHOD_SUBSCRIBE_PARAMS] = { &node_demarshal_subscribe_params, 0, }, [PW_NODE_METHOD_SUBSCRIBE_PARAMS] = { &node_demarshal_subscribe_params, 0, },
[PW_NODE_PROXY_METHOD_ENUM_PARAMS] = { &node_demarshal_enum_params, 0, }, [PW_NODE_METHOD_ENUM_PARAMS] = { &node_demarshal_enum_params, 0, },
[PW_NODE_PROXY_METHOD_SET_PARAM] = { &node_demarshal_set_param, PW_PERM_W, }, [PW_NODE_METHOD_SET_PARAM] = { &node_demarshal_set_param, PW_PERM_W, },
[PW_NODE_PROXY_METHOD_SEND_COMMAND] = { &node_demarshal_send_command, PW_PERM_W, }, [PW_NODE_METHOD_SEND_COMMAND] = { &node_demarshal_send_command, PW_PERM_W, },
}; };
static const struct pw_node_proxy_events pw_protocol_native_node_event_marshal = { static const struct pw_node_events pw_protocol_native_node_event_marshal = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = &node_marshal_info, .info = &node_marshal_info,
.param = &node_marshal_param, .param = &node_marshal_param,
}; };
static const struct pw_protocol_native_demarshal static const struct pw_protocol_native_demarshal
pw_protocol_native_node_event_demarshal[PW_NODE_PROXY_EVENT_NUM] = { pw_protocol_native_node_event_demarshal[PW_NODE_EVENT_NUM] = {
[PW_NODE_PROXY_EVENT_INFO] = { &node_demarshal_info, 0, }, [PW_NODE_EVENT_INFO] = { &node_demarshal_info, 0, },
[PW_NODE_PROXY_EVENT_PARAM] = { &node_demarshal_param, 0, } [PW_NODE_EVENT_PARAM] = { &node_demarshal_param, 0, }
}; };
static const struct pw_protocol_marshal pw_protocol_native_node_marshal = { static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
0, 0,
PW_NODE_PROXY_METHOD_NUM, PW_NODE_METHOD_NUM,
PW_NODE_PROXY_EVENT_NUM, PW_NODE_EVENT_NUM,
.client_marshal = &pw_protocol_native_node_method_marshal, .client_marshal = &pw_protocol_native_node_method_marshal,
.server_demarshal = pw_protocol_native_node_method_demarshal, .server_demarshal = pw_protocol_native_node_method_demarshal,
.server_marshal = &pw_protocol_native_node_event_marshal, .server_marshal = &pw_protocol_native_node_event_marshal,

View file

@ -356,13 +356,13 @@ struct pw_module_v0_events {
#define PW_VERSION_NODE_V0 0 #define PW_VERSION_NODE_V0 0
#define PW_NODE_PROXY_V0_EVENT_INFO 0 #define PW_NODE_V0_EVENT_INFO 0
#define PW_NODE_PROXY_V0_EVENT_PARAM 1 #define PW_NODE_V0_EVENT_PARAM 1
#define PW_NODE_PROXY_V0_EVENT_NUM 2 #define PW_NODE_V0_EVENT_NUM 2
/** Node events */ /** Node events */
struct pw_node_proxy_v0_events { struct pw_node_v0_events {
#define PW_VERSION_NODE_PROXY_V0_EVENTS 0 #define PW_VERSION_NODE_V0_EVENTS 0
uint32_t version; uint32_t version;
/** /**
* Notify node info * Notify node info
@ -385,15 +385,15 @@ struct pw_node_proxy_v0_events {
const struct spa_pod *param); const struct spa_pod *param);
}; };
#define pw_node_resource_v0_info(r,...) pw_resource_notify(r,struct pw_node_proxy_v0_events,info,__VA_ARGS__) #define pw_node_resource_v0_info(r,...) pw_resource_notify(r,struct pw_node_v0_events,info,__VA_ARGS__)
#define pw_node_resource_v0_param(r,...) pw_resource_notify(r,struct pw_node_proxy_v0_events,param,__VA_ARGS__) #define pw_node_resource_v0_param(r,...) pw_resource_notify(r,struct pw_node_v0_events,param,__VA_ARGS__)
#define PW_NODE_PROXY_V0_METHOD_ENUM_PARAMS 0 #define PW_NODE_V0_METHOD_ENUM_PARAMS 0
#define PW_NODE_PROXY_V0_METHOD_NUM 1 #define PW_NODE_V0_METHOD_NUM 1
/** Node methods */ /** Node methods */
struct pw_node_proxy_v0_methods { struct pw_node_v0_methods {
#define PW_VERSION_NODE_PROXY_V0_METHODS 0 #define PW_VERSION_NODE_V0_METHODS 0
uint32_t version; uint32_t version;
/** /**
* Enumerate node parameters * Enumerate node parameters

View file

@ -823,7 +823,7 @@ static void node_marshal_info(void *object, const struct pw_node_info *info)
struct spa_pod_frame f; struct spa_pod_frame f;
uint32_t i, n_items; uint32_t i, n_items;
b = pw_protocol_native_begin_resource(resource, PW_NODE_PROXY_V0_EVENT_INFO, NULL); b = pw_protocol_native_begin_resource(resource, PW_NODE_V0_EVENT_INFO, NULL);
n_items = info->props ? info->props->n_items : 0; n_items = info->props ? info->props->n_items : 0;
@ -856,7 +856,7 @@ static void node_marshal_param(void *object, int seq, uint32_t id, uint32_t inde
struct pw_resource *resource = object; struct pw_resource *resource = object;
struct spa_pod_builder *b; struct spa_pod_builder *b;
b = pw_protocol_native_begin_resource(resource, PW_NODE_PROXY_V0_EVENT_PARAM, NULL); b = pw_protocol_native_begin_resource(resource, PW_NODE_V0_EVENT_PARAM, NULL);
spa_pod_builder_add_struct(b, "I", id, "i", index, "i", next, "P", param); spa_pod_builder_add_struct(b, "I", id, "i", index, "i", next, "P", param);
@ -882,7 +882,7 @@ static int node_demarshal_enum_params(void *object, const struct pw_protocol_nat
id = pw_protocol_native0_type_from_v2(client, id); id = pw_protocol_native0_type_from_v2(client, id);
filter = NULL; filter = NULL;
return pw_resource_notify(resource, struct pw_node_proxy_methods, enum_params, 0, return pw_resource_notify(resource, struct pw_node_methods, enum_params, 0,
0, id, index, num, filter); 0, id, index, num, filter);
} }
@ -1104,11 +1104,11 @@ static const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
}; };
static const struct pw_protocol_native_demarshal pw_protocol_native_node_method_demarshal[] = { static const struct pw_protocol_native_demarshal pw_protocol_native_node_method_demarshal[] = {
[PW_NODE_PROXY_V0_METHOD_ENUM_PARAMS] = { &node_demarshal_enum_params, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, }, [PW_NODE_V0_METHOD_ENUM_PARAMS] = { &node_demarshal_enum_params, 0, PW_PROTOCOL_NATIVE_FLAG_REMAP, },
}; };
static const struct pw_node_proxy_events pw_protocol_native_node_event_marshal = { static const struct pw_node_events pw_protocol_native_node_event_marshal = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = &node_marshal_info, .info = &node_marshal_info,
.param = &node_marshal_param, .param = &node_marshal_param,
}; };
@ -1116,8 +1116,8 @@ static const struct pw_node_proxy_events pw_protocol_native_node_event_marshal =
static const struct pw_protocol_marshal pw_protocol_native_node_marshal = { static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_V0, PW_VERSION_NODE_V0,
PW_NODE_PROXY_V0_METHOD_NUM, PW_NODE_V0_METHOD_NUM,
PW_NODE_PROXY_EVENT_NUM, PW_NODE_EVENT_NUM,
0, 0,
NULL, NULL,
pw_protocol_native_node_method_demarshal, pw_protocol_native_node_method_demarshal,

View file

@ -242,7 +242,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
factory = pw_impl_factory_new(context, factory = pw_impl_factory_new(context,
"spa-node-factory", "spa-node-factory",
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
NULL, NULL,
sizeof(*data)); sizeof(*data));
if (factory == NULL) if (factory == NULL)

View file

@ -50,7 +50,7 @@ struct impl {
unsigned int pause_on_idle:1; unsigned int pause_on_idle:1;
}; };
#define pw_node_resource(r,m,v,...) pw_resource_call(r,struct pw_node_proxy_events,m,v,__VA_ARGS__) #define pw_node_resource(r,m,v,...) pw_resource_call(r,struct pw_node_events,m,v,__VA_ARGS__)
#define pw_node_resource_info(r,...) pw_node_resource(r,info,0,__VA_ARGS__) #define pw_node_resource_info(r,...) pw_node_resource(r,info,0,__VA_ARGS__)
#define pw_node_resource_param(r,...) pw_node_resource(r,param,0,__VA_ARGS__) #define pw_node_resource_param(r,...) pw_node_resource(r,param,0,__VA_ARGS__)
@ -479,8 +479,8 @@ static int node_send_command(void *object, const struct spa_command *command)
return 0; return 0;
} }
static const struct pw_node_proxy_methods node_methods = { static const struct pw_node_methods node_methods = {
PW_VERSION_NODE_PROXY_METHODS, PW_VERSION_NODE_METHODS,
.subscribe_params = node_subscribe_params, .subscribe_params = node_subscribe_params,
.enum_params = node_enum_params, .enum_params = node_enum_params,
.set_param = node_set_param, .set_param = node_set_param,
@ -589,7 +589,7 @@ int pw_impl_node_register(struct pw_impl_node *this,
this->global = pw_global_new(context, this->global = pw_global_new(context,
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
properties, properties,
global_bind, global_bind,
this); this);

View file

@ -39,8 +39,8 @@ extern "C" {
#include <pipewire/proxy.h> #include <pipewire/proxy.h>
#define PW_VERSION_NODE_PROXY 3 #define PW_VERSION_NODE 3
struct pw_node_proxy; struct pw_node;
/** \enum pw_node_state The different node states \memberof pw_node */ /** \enum pw_node_state The different node states \memberof pw_node */
enum pw_node_state { enum pw_node_state {
@ -84,13 +84,13 @@ pw_node_info_update(struct pw_node_info *info,
void void
pw_node_info_free(struct pw_node_info *info); pw_node_info_free(struct pw_node_info *info);
#define PW_NODE_PROXY_EVENT_INFO 0 #define PW_NODE_EVENT_INFO 0
#define PW_NODE_PROXY_EVENT_PARAM 1 #define PW_NODE_EVENT_PARAM 1
#define PW_NODE_PROXY_EVENT_NUM 2 #define PW_NODE_EVENT_NUM 2
/** Node events */ /** Node events */
struct pw_node_proxy_events { struct pw_node_events {
#define PW_VERSION_NODE_PROXY_EVENTS 0 #define PW_VERSION_NODE_EVENTS 0
uint32_t version; uint32_t version;
/** /**
* Notify node info * Notify node info
@ -114,21 +114,21 @@ struct pw_node_proxy_events {
const struct spa_pod *param); const struct spa_pod *param);
}; };
#define PW_NODE_PROXY_METHOD_ADD_LISTENER 0 #define PW_NODE_METHOD_ADD_LISTENER 0
#define PW_NODE_PROXY_METHOD_SUBSCRIBE_PARAMS 1 #define PW_NODE_METHOD_SUBSCRIBE_PARAMS 1
#define PW_NODE_PROXY_METHOD_ENUM_PARAMS 2 #define PW_NODE_METHOD_ENUM_PARAMS 2
#define PW_NODE_PROXY_METHOD_SET_PARAM 3 #define PW_NODE_METHOD_SET_PARAM 3
#define PW_NODE_PROXY_METHOD_SEND_COMMAND 4 #define PW_NODE_METHOD_SEND_COMMAND 4
#define PW_NODE_PROXY_METHOD_NUM 5 #define PW_NODE_METHOD_NUM 5
/** Node methods */ /** Node methods */
struct pw_node_proxy_methods { struct pw_node_methods {
#define PW_VERSION_NODE_PROXY_METHODS 0 #define PW_VERSION_NODE_METHODS 0
uint32_t version; uint32_t version;
int (*add_listener) (void *object, int (*add_listener) (void *object,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_node_proxy_events *events, const struct pw_node_events *events,
void *data); void *data);
/** /**
* Subscribe to parameter changes * Subscribe to parameter changes
@ -175,21 +175,21 @@ struct pw_node_proxy_methods {
int (*send_command) (void *object, const struct spa_command *command); int (*send_command) (void *object, const struct spa_command *command);
}; };
#define pw_node_proxy_method(o,method,version,...) \ #define pw_node_method(o,method,version,...) \
({ \ ({ \
int _res = -ENOTSUP; \ int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \ spa_interface_call_res((struct spa_interface*)o, \
struct pw_node_proxy_methods, _res, \ struct pw_node_methods, _res, \
method, version, ##__VA_ARGS__); \ method, version, ##__VA_ARGS__); \
_res; \ _res; \
}) })
/** Node */ /** Node */
#define pw_node_proxy_add_listener(c,...) pw_node_proxy_method(c,add_listener,0,__VA_ARGS__) #define pw_node_add_listener(c,...) pw_node_method(c,add_listener,0,__VA_ARGS__)
#define pw_node_proxy_subscribe_params(c,...) pw_node_proxy_method(c,subscribe_params,0,__VA_ARGS__) #define pw_node_subscribe_params(c,...) pw_node_method(c,subscribe_params,0,__VA_ARGS__)
#define pw_node_proxy_enum_params(c,...) pw_node_proxy_method(c,enum_params,0,__VA_ARGS__) #define pw_node_enum_params(c,...) pw_node_method(c,enum_params,0,__VA_ARGS__)
#define pw_node_proxy_set_param(c,...) pw_node_proxy_method(c,set_param,0,__VA_ARGS__) #define pw_node_set_param(c,...) pw_node_method(c,set_param,0,__VA_ARGS__)
#define pw_node_proxy_send_command(c,...) pw_node_proxy_method(c,send_command,0,__VA_ARGS__) #define pw_node_send_command(c,...) pw_node_method(c,send_command,0,__VA_ARGS__)
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View file

@ -1429,7 +1429,7 @@ pw_stream_connect(struct pw_stream *stream,
impl->node = pw_impl_factory_create_object(factory, impl->node = pw_impl_factory_create_object(factory,
NULL, NULL,
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
props, props,
0); 0);
if (impl->node == NULL) { if (impl->node == NULL) {

View file

@ -194,13 +194,13 @@ static void test_device_abi(void)
static void test_node_abi(void) static void test_node_abi(void)
{ {
struct pw_node_proxy_methods m; struct pw_node_methods m;
struct pw_node_proxy_events e; struct pw_node_events e;
struct { struct {
uint32_t version; uint32_t version;
int (*add_listener) (void *object, int (*add_listener) (void *object,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_node_proxy_events *events, const struct pw_node_events *events,
void *data); void *data);
int (*subscribe_params) (void *object, uint32_t *ids, uint32_t n_ids); int (*subscribe_params) (void *object, uint32_t *ids, uint32_t n_ids);
int (*enum_params) (void *object, int seq, uint32_t id, int (*enum_params) (void *object, int seq, uint32_t id,
@ -208,14 +208,14 @@ static void test_node_abi(void)
int (*set_param) (void *object, uint32_t id, uint32_t flags, int (*set_param) (void *object, uint32_t id, uint32_t flags,
const struct spa_pod *param); const struct spa_pod *param);
int (*send_command) (void *object, const struct spa_command *command); int (*send_command) (void *object, const struct spa_command *command);
} methods = { PW_VERSION_NODE_PROXY_METHODS, }; } methods = { PW_VERSION_NODE_METHODS, };
struct { struct {
uint32_t version; uint32_t version;
void (*info) (void *object, const struct pw_node_info *info); void (*info) (void *object, const struct pw_node_info *info);
void (*param) (void *object, int seq, void (*param) (void *object, int seq,
uint32_t id, uint32_t index, uint32_t next, uint32_t id, uint32_t index, uint32_t next,
const struct spa_pod *param); const struct spa_pod *param);
} events = { PW_VERSION_NODE_PROXY_EVENTS, }; } events = { PW_VERSION_NODE_EVENTS, };
TEST_FUNC(m, methods, version); TEST_FUNC(m, methods, version);
TEST_FUNC(m, methods, add_listener); TEST_FUNC(m, methods, add_listener);
@ -223,13 +223,13 @@ static void test_node_abi(void)
TEST_FUNC(m, methods, enum_params); TEST_FUNC(m, methods, enum_params);
TEST_FUNC(m, methods, set_param); TEST_FUNC(m, methods, set_param);
TEST_FUNC(m, methods, send_command); TEST_FUNC(m, methods, send_command);
spa_assert(PW_VERSION_NODE_PROXY_METHODS == 0); spa_assert(PW_VERSION_NODE_METHODS == 0);
spa_assert(sizeof(m) == sizeof(methods)); spa_assert(sizeof(m) == sizeof(methods));
TEST_FUNC(e, events, version); TEST_FUNC(e, events, version);
TEST_FUNC(e, events, info); TEST_FUNC(e, events, info);
TEST_FUNC(e, events, param); TEST_FUNC(e, events, param);
spa_assert(PW_VERSION_NODE_PROXY_EVENTS == 0); spa_assert(PW_VERSION_NODE_EVENTS == 0);
spa_assert(sizeof(e) == sizeof(events)); spa_assert(sizeof(e) == sizeof(events));
} }

View file

@ -768,8 +768,8 @@ static void event_param(void *object, int seq, uint32_t id,
spa_debug_pod(2, NULL, param); spa_debug_pod(2, NULL, param);
} }
static const struct pw_node_proxy_events node_events = { static const struct pw_node_events node_events = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = node_event_info, .info = node_event_info,
.param = event_param .param = event_param
}; };
@ -1110,7 +1110,7 @@ static bool bind_global(struct remote_data *rd, struct global *global, char **er
break; break;
case PW_TYPE_INTERFACE_Node: case PW_TYPE_INTERFACE_Node:
events = &node_events; events = &node_events;
client_version = PW_VERSION_NODE_PROXY; client_version = PW_VERSION_NODE;
destroy = (pw_destroy_t) pw_node_info_free; destroy = (pw_destroy_t) pw_node_info_free;
info_func = info_node; info_func = info_node;
break; break;
@ -1297,7 +1297,7 @@ static bool do_create_node(struct data *data, const char *cmd, char *args, char
proxy = pw_core_create_object(rd->core, a[0], proxy = pw_core_create_object(rd->core, a[0],
PW_TYPE_INTERFACE_Node, PW_TYPE_INTERFACE_Node,
PW_VERSION_NODE_PROXY, PW_VERSION_NODE,
props ? &props->dict : NULL, props ? &props->dict : NULL,
sizeof(struct proxy_data)); sizeof(struct proxy_data));
@ -1456,7 +1456,7 @@ static bool do_enum_params(struct data *data, const char *cmd, char *args, char
switch (global->type) { switch (global->type) {
case PW_TYPE_INTERFACE_Node: case PW_TYPE_INTERFACE_Node:
pw_node_proxy_enum_params((struct pw_node_proxy*)global->proxy, 0, pw_node_enum_params((struct pw_node*)global->proxy, 0,
param_id, 0, 0, NULL); param_id, 0, 0, NULL);
break; break;
case PW_TYPE_INTERFACE_Port: case PW_TYPE_INTERFACE_Port:

View file

@ -521,8 +521,8 @@ static void node_event_info(void *data, const struct pw_node_info *info)
global_event_info(data, info); global_event_info(data, info);
} }
static const struct pw_node_proxy_events node_events = { static const struct pw_node_events node_events = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = node_event_info, .info = node_event_info,
}; };
@ -622,7 +622,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
info_destroy = (pw_destroy_t)pw_node_info_free; info_destroy = (pw_destroy_t)pw_node_info_free;
info_update = (info_update_t)pw_node_info_update; info_update = (info_update_t)pw_node_info_update;
draw = draw_node; draw = draw_node;
client_version = PW_VERSION_NODE_PROXY; client_version = PW_VERSION_NODE;
break; break;
case PW_TYPE_INTERFACE_Link: case PW_TYPE_INTERFACE_Link:
events = &link_events; events = &link_events;

View file

@ -285,7 +285,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
remove_params(data, info->params[i].id, 0); remove_params(data, info->params[i].id, 0);
if (!SPA_FLAG_IS_SET(info->params[i].flags, SPA_PARAM_INFO_READ)) if (!SPA_FLAG_IS_SET(info->params[i].flags, SPA_PARAM_INFO_READ))
continue; continue;
pw_node_proxy_enum_params((struct pw_node_proxy*)data->proxy, pw_node_enum_params((struct pw_node*)data->proxy,
0, info->params[i].id, 0, 0, NULL); 0, info->params[i].id, 0, 0, NULL);
} }
add_pending(data); add_pending(data);
@ -296,8 +296,8 @@ static void node_event_info(void *object, const struct pw_node_info *info)
data->print_func(data); data->print_func(data);
} }
static const struct pw_node_proxy_events node_events = { static const struct pw_node_events node_events = {
PW_VERSION_NODE_PROXY_EVENTS, PW_VERSION_NODE_EVENTS,
.info = node_event_info, .info = node_event_info,
.param = event_param .param = event_param
}; };
@ -578,7 +578,7 @@ static void registry_event_global(void *data, uint32_t id,
switch (type) { switch (type) {
case PW_TYPE_INTERFACE_Node: case PW_TYPE_INTERFACE_Node:
events = &node_events; events = &node_events;
client_version = PW_VERSION_NODE_PROXY; client_version = PW_VERSION_NODE;
destroy = (pw_destroy_t) pw_node_info_free; destroy = (pw_destroy_t) pw_node_info_free;
print_func = print_node; print_func = print_node;
break; break;