diff --git a/pipewire-pulseaudio/src/context.c b/pipewire-pulseaudio/src/context.c index aa717136e..d3f2f3c04 100644 --- a/pipewire-pulseaudio/src/context.c +++ b/pipewire-pulseaudio/src/context.c @@ -445,7 +445,7 @@ static void endpoint_event_param(void *object, int seq, } static const struct pw_endpoint_proxy_events endpoint_events = { - PW_VERSION_NODE_PROXY_EVENTS, + PW_VERSION_ENDPOINT_PROXY_EVENTS, .info = endpoint_event_info, .param = endpoint_event_param, }; diff --git a/src/examples/export-spa.c b/src/examples/export-spa.c index 18bc44aed..663584498 100644 --- a/src/examples/export-spa.c +++ b/src/examples/export-spa.c @@ -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 = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events node_events = { + PW_VERSION_NODE_EVENTS, .info = node_event_info, }; @@ -97,7 +97,7 @@ static int make_node(struct data *data) if (data->proxy == NULL) 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); return 0; diff --git a/src/examples/local-v4l2.c b/src/examples/local-v4l2.c index 0b96c1edb..082f434bb 100644 --- a/src/examples/local-v4l2.c +++ b/src/examples/local-v4l2.c @@ -363,7 +363,7 @@ static int make_nodes(struct data *data) out = pw_core_create_object(data->core, "spa-node-factory", PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, &props->dict, 0); diff --git a/src/examples/media-session/alsa-endpoint.c b/src/examples/media-session/alsa-endpoint.c index 275a25a97..e342dd82a 100644 --- a/src/examples/media-session/alsa-endpoint.c +++ b/src/examples/media-session/alsa-endpoint.c @@ -126,7 +126,7 @@ static int client_endpoint_set_param(void *object, struct endpoint *endpoint = object; struct impl *impl = endpoint->impl; 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); } @@ -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)) 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); } stream->active = active; @@ -522,7 +522,7 @@ static struct endpoint *create_endpoint(struct node *node, struct endpoint *moni subscribe[n_subscribe++] = SPA_PARAM_PropInfo; pw_log_debug(NAME" %p: endpoint %p proxy %p subscribe %d params", impl, 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); spa_list_append(&device->endpoint_list, &endpoint->link); diff --git a/src/examples/media-session/alsa-midi.c b/src/examples/media-session/alsa-midi.c index 0a61febb8..502428651 100644 --- a/src/examples/media-session/alsa-midi.c +++ b/src/examples/media-session/alsa-midi.c @@ -63,7 +63,7 @@ void * sm_alsa_midi_start(struct sm_media_session *session) impl->proxy = sm_media_session_create_object(session, "spa-node-factory", PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, &impl->props->dict, 0); diff --git a/src/examples/media-session/bluez-monitor.c b/src/examples/media-session/bluez-monitor.c index ecbabe759..1f4657f3b 100644 --- a/src/examples/media-session/bluez-monitor.c +++ b/src/examples/media-session/bluez-monitor.c @@ -152,7 +152,7 @@ static struct bluez5_node *bluez5_create_node(struct bluez5_object *obj, uint32_ node->adapter = pw_impl_factory_create_object(factory, NULL, PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, pw_properties_copy(node->props), 0); if (node->adapter == NULL) { diff --git a/src/examples/media-session/media-session.c b/src/examples/media-session/media-session.c index a44ec6c13..9fd4e3156 100644 --- a/src/examples/media-session/media-session.c +++ b/src/examples/media-session/media-session.c @@ -427,7 +427,7 @@ static void node_event_info(void *object, const struct pw_node_info *info) if (n_subscribe > 0) { pw_log_debug(NAME" %p: node %d subscribe %d params", impl, 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); node->subscribe = true; } @@ -458,8 +458,8 @@ static void node_event_param(void *object, int seq, node->obj.changed |= SM_NODE_CHANGE_MASK_PARAMS; } -static const struct pw_node_proxy_events node_events = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events node_events = { + PW_VERSION_NODE_EVENTS, .info = node_event_info, .param = node_event_param, }; @@ -508,7 +508,7 @@ static void node_destroy(void *object) static const struct object_info node_info = { .type = PW_TYPE_INTERFACE_Node, - .version = PW_VERSION_NODE_PROXY, + .version = PW_VERSION_NODE, .events = &node_events, .size = sizeof(struct sm_node), .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, factory_name, PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, props, sizeof(struct sm_node)); diff --git a/src/examples/media-session/stream-monitor.c b/src/examples/media-session/stream-monitor.c index 4ce118bd7..70e2cb2a7 100644 --- a/src/examples/media-session/stream-monitor.c +++ b/src/examples/media-session/stream-monitor.c @@ -112,7 +112,7 @@ static int client_endpoint_set_param(void *object, struct node *node = endpoint->node; 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); } @@ -150,7 +150,7 @@ static int stream_set_active(struct stream *stream, bool active) if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG)) 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); } stream->active = active; @@ -451,7 +451,7 @@ static struct endpoint *create_endpoint(struct node *node) subscribe[n_subscribe++] = SPA_PARAM_PropInfo; pw_log_debug(NAME" %p: node %p proxy %p subscribe %d params", impl, 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); sm_media_session_sync(impl->session, complete_endpoint, endpoint); diff --git a/src/examples/media-session/v4l2-monitor.c b/src/examples/media-session/v4l2-monitor.c index 9d24f7cbc..c16cb6535 100644 --- a/src/examples/media-session/v4l2-monitor.c +++ b/src/examples/media-session/v4l2-monitor.c @@ -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, "spa-node-factory", PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, &node->props->dict, 0); if (node->proxy == NULL) { diff --git a/src/gst/gstpipewiredeviceprovider.c b/src/gst/gstpipewiredeviceprovider.c index 2c65dcc0e..e656aead3 100644 --- a/src/gst/gstpipewiredeviceprovider.c +++ b/src/gst/gstpipewiredeviceprovider.c @@ -182,7 +182,7 @@ struct core_data { struct node_data { struct spa_list link; GstPipeWireDeviceProvider *self; - struct pw_node_proxy *proxy; + struct pw_node *proxy; struct spa_hook proxy_listener; uint32_t id; 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); } -static const struct pw_node_proxy_events node_events = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events node_events = { + PW_VERSION_NODE_EVENTS, .info = node_event_info }; static void -destroy_node_proxy (void *data) +destroy_node (void *data) { struct node_data *nd = data; GstPipeWireDeviceProvider *self = nd->self; @@ -429,7 +429,7 @@ destroy_node_proxy (void *data) static const struct pw_proxy_events proxy_node_events = { PW_VERSION_PROXY_EVENTS, - .destroy = destroy_node_proxy, + .destroy = destroy_node, }; static void @@ -455,11 +455,11 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions, struct node_data *nd; if (type == PW_TYPE_INTERFACE_Node) { - struct pw_node_proxy *node; + struct pw_node *node; node = pw_registry_bind(rd->registry, id, PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, sizeof(*nd)); + PW_VERSION_NODE, sizeof(*nd)); if (node == NULL) goto no_mem; @@ -469,7 +469,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions, nd->id = id; nd->caps = gst_caps_new_empty (); 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); add_pending(self, &nd->pending, NULL, NULL); } diff --git a/src/modules/module-adapter.c b/src/modules/module-adapter.c index 40c0eadf2..d6445a166 100644 --- a/src/modules/module-adapter.c +++ b/src/modules/module-adapter.c @@ -113,7 +113,7 @@ static void node_initialized(void *data) global = pw_impl_node_get_global(nd->adapter); 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) 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, "adapter", PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, pw_properties_new( PW_KEY_FACTORY_USAGE, FACTORY_USAGE, NULL), diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index c8c6f6227..77dff90ce 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -1157,7 +1157,7 @@ static struct pw_proxy *node_export(struct pw_core *core, void *object, bool do_ do_node_init(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); diff --git a/src/modules/module-protocol-native/protocol-native.c b/src/modules/module-protocol-native/protocol-native.c index 36a0484f3..347d20252 100644 --- a/src/modules/module-protocol-native/protocol-native.c +++ b/src/modules/module-protocol-native/protocol-native.c @@ -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, struct spa_hook *listener, - const struct pw_node_proxy_events *events, + const struct pw_node_events *events, void *data) { 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_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_add(b, @@ -1122,7 +1122,7 @@ static int node_demarshal_info(void *object, const struct pw_protocol_native_mes 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, @@ -1131,7 +1131,7 @@ static void node_marshal_param(void *object, int seq, uint32_t id, struct pw_resource *resource = object; 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_Int(seq), @@ -1160,7 +1160,7 @@ static int node_demarshal_param(void *object, const struct pw_protocol_native_me SPA_POD_Pod(¶m)) < 0) 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); } @@ -1169,7 +1169,7 @@ static int node_marshal_subscribe_params(void *object, uint32_t *ids, uint32_t n struct pw_proxy *proxy = object; 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_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) 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); } @@ -1203,7 +1203,7 @@ static int node_marshal_enum_params(void *object, int seq, uint32_t id, struct pw_proxy *proxy = object; 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_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) 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); } @@ -1242,7 +1242,7 @@ static int node_marshal_set_param(void *object, uint32_t id, uint32_t flags, struct pw_proxy *proxy = object; 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_Id(id), @@ -1265,7 +1265,7 @@ static int node_demarshal_set_param(void *object, const struct pw_protocol_nativ SPA_POD_Pod(¶m)) < 0) 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) @@ -1273,7 +1273,7 @@ static int node_marshal_send_command(void *object, const struct spa_command *com struct pw_proxy *proxy = object; 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_Pod(command)); 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) 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, @@ -2100,8 +2100,8 @@ static const struct pw_protocol_marshal pw_protocol_native_device_marshal = { .client_demarshal = pw_protocol_native_device_event_demarshal, }; -static const struct pw_node_proxy_methods pw_protocol_native_node_method_marshal = { - PW_VERSION_NODE_PROXY_METHODS, +static const struct pw_node_methods pw_protocol_native_node_method_marshal = { + PW_VERSION_NODE_METHODS, .add_listener = &node_method_marshal_add_listener, .subscribe_params = &node_marshal_subscribe_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 -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_PROXY_METHOD_SUBSCRIBE_PARAMS] = { &node_demarshal_subscribe_params, 0, }, - [PW_NODE_PROXY_METHOD_ENUM_PARAMS] = { &node_demarshal_enum_params, 0, }, - [PW_NODE_PROXY_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_ADD_LISTENER] = { NULL, 0, }, + [PW_NODE_METHOD_SUBSCRIBE_PARAMS] = { &node_demarshal_subscribe_params, 0, }, + [PW_NODE_METHOD_ENUM_PARAMS] = { &node_demarshal_enum_params, 0, }, + [PW_NODE_METHOD_SET_PARAM] = { &node_demarshal_set_param, 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 = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events pw_protocol_native_node_event_marshal = { + PW_VERSION_NODE_EVENTS, .info = &node_marshal_info, .param = &node_marshal_param, }; static const struct pw_protocol_native_demarshal -pw_protocol_native_node_event_demarshal[PW_NODE_PROXY_EVENT_NUM] = { - [PW_NODE_PROXY_EVENT_INFO] = { &node_demarshal_info, 0, }, - [PW_NODE_PROXY_EVENT_PARAM] = { &node_demarshal_param, 0, } +pw_protocol_native_node_event_demarshal[PW_NODE_EVENT_NUM] = { + [PW_NODE_EVENT_INFO] = { &node_demarshal_info, 0, }, + [PW_NODE_EVENT_PARAM] = { &node_demarshal_param, 0, } }; static const struct pw_protocol_marshal pw_protocol_native_node_marshal = { PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, 0, - PW_NODE_PROXY_METHOD_NUM, - PW_NODE_PROXY_EVENT_NUM, + PW_NODE_METHOD_NUM, + PW_NODE_EVENT_NUM, .client_marshal = &pw_protocol_native_node_method_marshal, .server_demarshal = pw_protocol_native_node_method_demarshal, .server_marshal = &pw_protocol_native_node_event_marshal, diff --git a/src/modules/module-protocol-native/v0/interfaces.h b/src/modules/module-protocol-native/v0/interfaces.h index 362d88b9b..df042f63e 100644 --- a/src/modules/module-protocol-native/v0/interfaces.h +++ b/src/modules/module-protocol-native/v0/interfaces.h @@ -356,13 +356,13 @@ struct pw_module_v0_events { #define PW_VERSION_NODE_V0 0 -#define PW_NODE_PROXY_V0_EVENT_INFO 0 -#define PW_NODE_PROXY_V0_EVENT_PARAM 1 -#define PW_NODE_PROXY_V0_EVENT_NUM 2 +#define PW_NODE_V0_EVENT_INFO 0 +#define PW_NODE_V0_EVENT_PARAM 1 +#define PW_NODE_V0_EVENT_NUM 2 /** Node events */ -struct pw_node_proxy_v0_events { -#define PW_VERSION_NODE_PROXY_V0_EVENTS 0 +struct pw_node_v0_events { +#define PW_VERSION_NODE_V0_EVENTS 0 uint32_t version; /** * Notify node info @@ -385,15 +385,15 @@ struct pw_node_proxy_v0_events { 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_param(r,...) pw_resource_notify(r,struct pw_node_proxy_v0_events,param,__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_v0_events,param,__VA_ARGS__) -#define PW_NODE_PROXY_V0_METHOD_ENUM_PARAMS 0 -#define PW_NODE_PROXY_V0_METHOD_NUM 1 +#define PW_NODE_V0_METHOD_ENUM_PARAMS 0 +#define PW_NODE_V0_METHOD_NUM 1 /** Node methods */ -struct pw_node_proxy_v0_methods { -#define PW_VERSION_NODE_PROXY_V0_METHODS 0 +struct pw_node_v0_methods { +#define PW_VERSION_NODE_V0_METHODS 0 uint32_t version; /** * Enumerate node parameters diff --git a/src/modules/module-protocol-native/v0/protocol-native.c b/src/modules/module-protocol-native/v0/protocol-native.c index a796d6029..e31237347 100644 --- a/src/modules/module-protocol-native/v0/protocol-native.c +++ b/src/modules/module-protocol-native/v0/protocol-native.c @@ -823,7 +823,7 @@ static void node_marshal_info(void *object, const struct pw_node_info *info) struct spa_pod_frame f; 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; @@ -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 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); @@ -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); 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); } @@ -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[] = { - [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 = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events pw_protocol_native_node_event_marshal = { + PW_VERSION_NODE_EVENTS, .info = &node_marshal_info, .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 = { PW_TYPE_INTERFACE_Node, PW_VERSION_NODE_V0, - PW_NODE_PROXY_V0_METHOD_NUM, - PW_NODE_PROXY_EVENT_NUM, + PW_NODE_V0_METHOD_NUM, + PW_NODE_EVENT_NUM, 0, NULL, pw_protocol_native_node_method_demarshal, diff --git a/src/modules/spa/module-node-factory.c b/src/modules/spa/module-node-factory.c index 9fe1c7506..1e25d1515 100644 --- a/src/modules/spa/module-node-factory.c +++ b/src/modules/spa/module-node-factory.c @@ -242,7 +242,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) factory = pw_impl_factory_new(context, "spa-node-factory", PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, NULL, sizeof(*data)); if (factory == NULL) diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 482c430e4..ee03aa6af 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -50,7 +50,7 @@ struct impl { 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_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; } -static const struct pw_node_proxy_methods node_methods = { - PW_VERSION_NODE_PROXY_METHODS, +static const struct pw_node_methods node_methods = { + PW_VERSION_NODE_METHODS, .subscribe_params = node_subscribe_params, .enum_params = node_enum_params, .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, PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, properties, global_bind, this); diff --git a/src/pipewire/node.h b/src/pipewire/node.h index 2cf14f16e..230ee3b18 100644 --- a/src/pipewire/node.h +++ b/src/pipewire/node.h @@ -39,8 +39,8 @@ extern "C" { #include -#define PW_VERSION_NODE_PROXY 3 -struct pw_node_proxy; +#define PW_VERSION_NODE 3 +struct pw_node; /** \enum pw_node_state The different node states \memberof pw_node */ enum pw_node_state { @@ -84,13 +84,13 @@ pw_node_info_update(struct pw_node_info *info, void pw_node_info_free(struct pw_node_info *info); -#define PW_NODE_PROXY_EVENT_INFO 0 -#define PW_NODE_PROXY_EVENT_PARAM 1 -#define PW_NODE_PROXY_EVENT_NUM 2 +#define PW_NODE_EVENT_INFO 0 +#define PW_NODE_EVENT_PARAM 1 +#define PW_NODE_EVENT_NUM 2 /** Node events */ -struct pw_node_proxy_events { -#define PW_VERSION_NODE_PROXY_EVENTS 0 +struct pw_node_events { +#define PW_VERSION_NODE_EVENTS 0 uint32_t version; /** * Notify node info @@ -114,21 +114,21 @@ struct pw_node_proxy_events { const struct spa_pod *param); }; -#define PW_NODE_PROXY_METHOD_ADD_LISTENER 0 -#define PW_NODE_PROXY_METHOD_SUBSCRIBE_PARAMS 1 -#define PW_NODE_PROXY_METHOD_ENUM_PARAMS 2 -#define PW_NODE_PROXY_METHOD_SET_PARAM 3 -#define PW_NODE_PROXY_METHOD_SEND_COMMAND 4 -#define PW_NODE_PROXY_METHOD_NUM 5 +#define PW_NODE_METHOD_ADD_LISTENER 0 +#define PW_NODE_METHOD_SUBSCRIBE_PARAMS 1 +#define PW_NODE_METHOD_ENUM_PARAMS 2 +#define PW_NODE_METHOD_SET_PARAM 3 +#define PW_NODE_METHOD_SEND_COMMAND 4 +#define PW_NODE_METHOD_NUM 5 /** Node methods */ -struct pw_node_proxy_methods { -#define PW_VERSION_NODE_PROXY_METHODS 0 +struct pw_node_methods { +#define PW_VERSION_NODE_METHODS 0 uint32_t version; int (*add_listener) (void *object, struct spa_hook *listener, - const struct pw_node_proxy_events *events, + const struct pw_node_events *events, void *data); /** * Subscribe to parameter changes @@ -175,21 +175,21 @@ struct pw_node_proxy_methods { 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; \ spa_interface_call_res((struct spa_interface*)o, \ - struct pw_node_proxy_methods, _res, \ + struct pw_node_methods, _res, \ method, version, ##__VA_ARGS__); \ _res; \ }) /** Node */ -#define pw_node_proxy_add_listener(c,...) pw_node_proxy_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_proxy_enum_params(c,...) pw_node_proxy_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_proxy_send_command(c,...) pw_node_proxy_method(c,send_command,0,__VA_ARGS__) +#define pw_node_add_listener(c,...) pw_node_method(c,add_listener,0,__VA_ARGS__) +#define pw_node_subscribe_params(c,...) pw_node_method(c,subscribe_params,0,__VA_ARGS__) +#define pw_node_enum_params(c,...) pw_node_method(c,enum_params,0,__VA_ARGS__) +#define pw_node_set_param(c,...) pw_node_method(c,set_param,0,__VA_ARGS__) +#define pw_node_send_command(c,...) pw_node_method(c,send_command,0,__VA_ARGS__) #ifdef __cplusplus } /* extern "C" */ diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index aa7ff05bd..69c45c800 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1429,7 +1429,7 @@ pw_stream_connect(struct pw_stream *stream, impl->node = pw_impl_factory_create_object(factory, NULL, PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, props, 0); if (impl->node == NULL) { diff --git a/src/tests/test-interfaces.c b/src/tests/test-interfaces.c index 08bff9fd7..028ea7f25 100644 --- a/src/tests/test-interfaces.c +++ b/src/tests/test-interfaces.c @@ -194,13 +194,13 @@ static void test_device_abi(void) static void test_node_abi(void) { - struct pw_node_proxy_methods m; - struct pw_node_proxy_events e; + struct pw_node_methods m; + struct pw_node_events e; struct { uint32_t version; int (*add_listener) (void *object, struct spa_hook *listener, - const struct pw_node_proxy_events *events, + const struct pw_node_events *events, void *data); int (*subscribe_params) (void *object, uint32_t *ids, uint32_t n_ids); 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, const struct spa_pod *param); int (*send_command) (void *object, const struct spa_command *command); - } methods = { PW_VERSION_NODE_PROXY_METHODS, }; + } methods = { PW_VERSION_NODE_METHODS, }; struct { uint32_t version; void (*info) (void *object, const struct pw_node_info *info); void (*param) (void *object, int seq, uint32_t id, uint32_t index, uint32_t next, 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, add_listener); @@ -223,13 +223,13 @@ static void test_node_abi(void) TEST_FUNC(m, methods, enum_params); TEST_FUNC(m, methods, set_param); 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)); TEST_FUNC(e, events, version); TEST_FUNC(e, events, info); 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)); } diff --git a/src/tools/pipewire-cli.c b/src/tools/pipewire-cli.c index 54e3fd6c6..bf4ea459b 100644 --- a/src/tools/pipewire-cli.c +++ b/src/tools/pipewire-cli.c @@ -768,8 +768,8 @@ static void event_param(void *object, int seq, uint32_t id, spa_debug_pod(2, NULL, param); } -static const struct pw_node_proxy_events node_events = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events node_events = { + PW_VERSION_NODE_EVENTS, .info = node_event_info, .param = event_param }; @@ -1110,7 +1110,7 @@ static bool bind_global(struct remote_data *rd, struct global *global, char **er break; case PW_TYPE_INTERFACE_Node: events = &node_events; - client_version = PW_VERSION_NODE_PROXY; + client_version = PW_VERSION_NODE; destroy = (pw_destroy_t) pw_node_info_free; info_func = info_node; 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], PW_TYPE_INTERFACE_Node, - PW_VERSION_NODE_PROXY, + PW_VERSION_NODE, props ? &props->dict : NULL, 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) { 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); break; case PW_TYPE_INTERFACE_Port: diff --git a/src/tools/pipewire-dot.c b/src/tools/pipewire-dot.c index bea2cd8d7..2f4da818d 100644 --- a/src/tools/pipewire-dot.c +++ b/src/tools/pipewire-dot.c @@ -521,8 +521,8 @@ static void node_event_info(void *data, const struct pw_node_info *info) global_event_info(data, info); } -static const struct pw_node_proxy_events node_events = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events node_events = { + PW_VERSION_NODE_EVENTS, .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_update = (info_update_t)pw_node_info_update; draw = draw_node; - client_version = PW_VERSION_NODE_PROXY; + client_version = PW_VERSION_NODE; break; case PW_TYPE_INTERFACE_Link: events = &link_events; diff --git a/src/tools/pipewire-monitor.c b/src/tools/pipewire-monitor.c index 68af0ef75..3721a9c51 100644 --- a/src/tools/pipewire-monitor.c +++ b/src/tools/pipewire-monitor.c @@ -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); if (!SPA_FLAG_IS_SET(info->params[i].flags, SPA_PARAM_INFO_READ)) 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); } add_pending(data); @@ -296,8 +296,8 @@ static void node_event_info(void *object, const struct pw_node_info *info) data->print_func(data); } -static const struct pw_node_proxy_events node_events = { - PW_VERSION_NODE_PROXY_EVENTS, +static const struct pw_node_events node_events = { + PW_VERSION_NODE_EVENTS, .info = node_event_info, .param = event_param }; @@ -578,7 +578,7 @@ static void registry_event_global(void *data, uint32_t id, switch (type) { case PW_TYPE_INTERFACE_Node: events = &node_events; - client_version = PW_VERSION_NODE_PROXY; + client_version = PW_VERSION_NODE; destroy = (pw_destroy_t) pw_node_info_free; print_func = print_node; break;