From 743450a19f94b48478f0235169ec60d88dc98fc8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 11 Dec 2019 16:13:46 +0100 Subject: [PATCH] pw_client_node_proxy -> pw_client_node --- pipewire-jack/src/pipewire-jack.c | 58 ++++---- src/extensions/client-node.h | 78 +++++------ src/modules/module-client-node.c | 4 +- src/modules/module-client-node/client-node.c | 30 ++--- src/modules/module-client-node/client-node.h | 12 +- .../module-client-node/protocol-native.c | 126 +++++++++--------- src/modules/module-client-node/remote-node.c | 38 +++--- .../module-client-node/v0/client-node.c | 20 +-- .../module-client-node/v0/client-node.h | 10 +- .../module-client-node/v0/ext-client-node.h | 48 +++---- .../module-client-node/v0/protocol-native.c | 42 +++--- 11 files changed, 233 insertions(+), 233 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 38ec27f61..7b375f871 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -239,7 +239,7 @@ struct client { struct pw_registry *registry; struct spa_hook registry_listener; - struct pw_client_node_proxy *node_proxy; + struct pw_client_node *node; struct spa_hook node_listener; struct spa_hook proxy_listener; @@ -583,16 +583,16 @@ static int do_sync(struct client *client) return 0; } -static void on_node_proxy_destroy(void *data) +static void on_node_destroy(void *data) { struct client *client = data; - client->node_proxy = NULL; + client->node = NULL; spa_hook_remove(&client->proxy_listener); } -static void on_node_proxy_bound(void *data, uint32_t global_id) +static void on_node_bound(void *data, uint32_t global_id) { struct client *client = data; client->node_id = global_id; @@ -600,8 +600,8 @@ static void on_node_proxy_bound(void *data, uint32_t global_id) static const struct pw_proxy_events proxy_events = { PW_VERSION_PROXY_EVENTS, - .destroy = on_node_proxy_destroy, - .bound = on_node_proxy_bound, + .destroy = on_node_destroy, + .bound = on_node_bound, }; static struct link *find_activation(struct pw_array *links, uint32_t node_id) @@ -1121,7 +1121,7 @@ static int client_node_set_param(void *object, const struct spa_pod *param) { struct client *c = (struct client *) object; - pw_proxy_error((struct pw_proxy*)c->node_proxy, -ENOTSUP, "not supported"); + pw_proxy_error((struct pw_proxy*)c->node, -ENOTSUP, "not supported"); return -ENOTSUP; } @@ -1212,7 +1212,7 @@ static int client_node_command(void *object, const struct spa_command *command) break; default: pw_log_warn(NAME" %p: unhandled node command %d", c, SPA_COMMAND_TYPE(command)); - pw_proxy_errorf((struct pw_proxy*)c->node_proxy, -ENOTSUP, + pw_proxy_errorf((struct pw_proxy*)c->node, -ENOTSUP, "unhandled command %d", SPA_COMMAND_TYPE(command)); } return 0; @@ -1223,7 +1223,7 @@ static int client_node_add_port(void *object, uint32_t port_id, const struct spa_dict *props) { struct client *c = (struct client *) object; - pw_proxy_error((struct pw_proxy*)c->node_proxy, -ENOTSUP, "add port not supported"); + pw_proxy_error((struct pw_proxy*)c->node, -ENOTSUP, "add port not supported"); return -ENOTSUP; } @@ -1232,7 +1232,7 @@ static int client_node_remove_port(void *object, uint32_t port_id) { struct client *c = (struct client *) object; - pw_proxy_error((struct pw_proxy*)c->node_proxy, -ENOTSUP, "remove port not supported"); + pw_proxy_error((struct pw_proxy*)c->node, -ENOTSUP, "remove port not supported"); return -ENOTSUP; } @@ -1468,7 +1468,7 @@ static int client_node_port_set_param(void *object, param_buffers(c, p, ¶ms[2], &b); param_io(c, p, ¶ms[3], &b); - return pw_client_node_proxy_port_update(c->node_proxy, + return pw_client_node_port_update(c->node, direction, port_id, PW_CLIENT_NODE_PORT_UPDATE_PARAMS, @@ -1627,7 +1627,7 @@ static int client_node_port_use_buffers(void *object, done: if (res < 0) - pw_proxy_error((struct pw_proxy*)c->node_proxy, res, spa_strerror(res)); + pw_proxy_error((struct pw_proxy*)c->node, res, spa_strerror(res)); return res; } @@ -1684,7 +1684,7 @@ static int client_node_port_set_io(void *object, exit: if (res < 0) - pw_proxy_error((struct pw_proxy*)c->node_proxy, res, spa_strerror(res)); + pw_proxy_error((struct pw_proxy*)c->node, res, spa_strerror(res)); return res; } @@ -1751,12 +1751,12 @@ static int client_node_set_activation(void *object, exit: if (res < 0) - pw_proxy_error((struct pw_proxy*)c->node_proxy, res, spa_strerror(res)); + pw_proxy_error((struct pw_proxy*)c->node, res, spa_strerror(res)); return res; } -static const struct pw_client_node_proxy_events client_node_events = { - PW_VERSION_CLIENT_NODE_PROXY_EVENTS, +static const struct pw_client_node_events client_node_events = { + PW_VERSION_CLIENT_NODE_EVENTS, .transport = client_node_transport, .set_param = client_node_set_param, .set_io = client_node_set_io, @@ -2172,18 +2172,18 @@ jack_client_t * jack_client_open (const char *client_name, items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, str); items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_ALWAYS_PROCESS, "1"); - client->node_proxy = pw_core_create_object(client->core, + client->node = pw_core_create_object(client->core, "client-node", PW_TYPE_INTERFACE_ClientNode, PW_VERSION_CLIENT_NODE, &props, 0); - if (client->node_proxy == NULL) + if (client->node == NULL) goto init_failed; - pw_client_node_proxy_add_listener(client->node_proxy, + pw_client_node_add_listener(client->node, &client->node_listener, &client_node_events, client); - pw_proxy_add_listener((struct pw_proxy*)client->node_proxy, + pw_proxy_add_listener((struct pw_proxy*)client->node, &client->proxy_listener, &proxy_events, client); ni = SPA_NODE_INFO_INIT(); @@ -2192,7 +2192,7 @@ jack_client_t * jack_client_open (const char *client_name, ni.change_mask = SPA_NODE_CHANGE_MASK_FLAGS; ni.flags = SPA_NODE_FLAG_RT; - pw_client_node_proxy_update(client->node_proxy, + pw_client_node_update(client->node, PW_CLIENT_NODE_UPDATE_INFO, 0, NULL, &ni); @@ -2341,7 +2341,7 @@ static int do_activate(struct client *c) pw_thread_loop_lock(c->context.loop); pw_log_debug(NAME" %p: activate", c); - pw_client_node_proxy_set_active(c->node_proxy, true); + pw_client_node_set_active(c->node, true); res = do_sync(c); @@ -2379,7 +2379,7 @@ int jack_deactivate (jack_client_t *client) pw_thread_loop_lock(c->context.loop); pw_log_debug(NAME" %p: deactivate", c); - pw_client_node_proxy_set_active(c->node_proxy, false); + pw_client_node_set_active(c->node, false); c->activation->pending_new_pos = false; c->activation->pending_sync = false; @@ -2706,7 +2706,7 @@ int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes) items[0] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, latency); ni.props = &SPA_DICT_INIT_ARRAY(items); - pw_client_node_proxy_update(c->node_proxy, + pw_client_node_update(c->node, PW_CLIENT_NODE_UPDATE_INFO, 0, NULL, &ni); @@ -2822,7 +2822,7 @@ jack_port_t * jack_port_register (jack_client_t *client, pw_thread_loop_lock(c->context.loop); - pw_client_node_proxy_port_update(c->node_proxy, + pw_client_node_port_update(c->node, direction, p->id, PW_CLIENT_NODE_PORT_UPDATE_PARAMS | @@ -2861,7 +2861,7 @@ int jack_port_unregister (jack_client_t *client, jack_port_t *port) free_port(c, p); - pw_client_node_proxy_port_update(c->node_proxy, + pw_client_node_port_update(c->node, p->direction, p->id, 0, 0, NULL, NULL); @@ -3197,7 +3197,7 @@ int jack_port_rename (jack_client_t* client, jack_port_t *port, const char *port items[dict.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_PORT_NAME, port_name); port_info.props = &dict; - pw_client_node_proxy_port_update(c->node_proxy, + pw_client_node_port_update(c->node, p->direction, p->id, PW_CLIENT_NODE_PORT_UPDATE_INFO, @@ -3243,7 +3243,7 @@ int jack_port_set_alias (jack_port_t *port, const char *alias) items[dict.n_items++] = SPA_DICT_ITEM_INIT(key, alias); port_info.props = &dict; - pw_client_node_proxy_port_update(c->node_proxy, + pw_client_node_port_update(c->node, p->direction, p->id, PW_CLIENT_NODE_PORT_UPDATE_INFO, @@ -3289,7 +3289,7 @@ int jack_port_unset_alias (jack_port_t *port, const char *alias) items[dict.n_items++] = SPA_DICT_ITEM_INIT(key, NULL); port_info.props = &dict; - pw_client_node_proxy_port_update(c->node_proxy, + pw_client_node_port_update(c->node, p->direction, p->id, PW_CLIENT_NODE_PORT_UPDATE_INFO, diff --git a/src/extensions/client-node.h b/src/extensions/client-node.h index 4ef8de68c..f96b5e902 100644 --- a/src/extensions/client-node.h +++ b/src/extensions/client-node.h @@ -32,7 +32,7 @@ extern "C" { #include #include -struct pw_client_node_proxy; +struct pw_client_node; #define PW_VERSION_CLIENT_NODE 3 @@ -46,22 +46,22 @@ struct pw_client_node_buffer { struct spa_buffer *buffer; /**< buffer describing metadata and buffer memory */ }; -#define PW_CLIENT_NODE_PROXY_EVENT_TRANSPORT 0 -#define PW_CLIENT_NODE_PROXY_EVENT_SET_PARAM 1 -#define PW_CLIENT_NODE_PROXY_EVENT_SET_IO 2 -#define PW_CLIENT_NODE_PROXY_EVENT_EVENT 3 -#define PW_CLIENT_NODE_PROXY_EVENT_COMMAND 4 -#define PW_CLIENT_NODE_PROXY_EVENT_ADD_PORT 5 -#define PW_CLIENT_NODE_PROXY_EVENT_REMOVE_PORT 6 -#define PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_PARAM 7 -#define PW_CLIENT_NODE_PROXY_EVENT_PORT_USE_BUFFERS 8 -#define PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_IO 9 -#define PW_CLIENT_NODE_PROXY_EVENT_SET_ACTIVATION 10 -#define PW_CLIENT_NODE_PROXY_EVENT_NUM 11 +#define PW_CLIENT_NODE_EVENT_TRANSPORT 0 +#define PW_CLIENT_NODE_EVENT_SET_PARAM 1 +#define PW_CLIENT_NODE_EVENT_SET_IO 2 +#define PW_CLIENT_NODE_EVENT_EVENT 3 +#define PW_CLIENT_NODE_EVENT_COMMAND 4 +#define PW_CLIENT_NODE_EVENT_ADD_PORT 5 +#define PW_CLIENT_NODE_EVENT_REMOVE_PORT 6 +#define PW_CLIENT_NODE_EVENT_PORT_SET_PARAM 7 +#define PW_CLIENT_NODE_EVENT_PORT_USE_BUFFERS 8 +#define PW_CLIENT_NODE_EVENT_PORT_SET_IO 9 +#define PW_CLIENT_NODE_EVENT_SET_ACTIVATION 10 +#define PW_CLIENT_NODE_EVENT_NUM 11 /** \ref pw_client_node events */ -struct pw_client_node_proxy_events { -#define PW_VERSION_CLIENT_NODE_PROXY_EVENTS 0 +struct pw_client_node_events { +#define PW_VERSION_CLIENT_NODE_EVENTS 0 uint32_t version; /** * Notify of a new transport area @@ -200,27 +200,27 @@ struct pw_client_node_proxy_events { uint32_t size); }; -#define PW_CLIENT_NODE_PROXY_METHOD_ADD_LISTENER 0 -#define PW_CLIENT_NODE_PROXY_METHOD_GET_NODE 1 -#define PW_CLIENT_NODE_PROXY_METHOD_UPDATE 2 -#define PW_CLIENT_NODE_PROXY_METHOD_PORT_UPDATE 3 -#define PW_CLIENT_NODE_PROXY_METHOD_SET_ACTIVE 4 -#define PW_CLIENT_NODE_PROXY_METHOD_EVENT 5 -#define PW_CLIENT_NODE_PROXY_METHOD_PORT_BUFFERS 6 -#define PW_CLIENT_NODE_PROXY_METHOD_NUM 7 +#define PW_CLIENT_NODE_METHOD_ADD_LISTENER 0 +#define PW_CLIENT_NODE_METHOD_GET_NODE 1 +#define PW_CLIENT_NODE_METHOD_UPDATE 2 +#define PW_CLIENT_NODE_METHOD_PORT_UPDATE 3 +#define PW_CLIENT_NODE_METHOD_SET_ACTIVE 4 +#define PW_CLIENT_NODE_METHOD_EVENT 5 +#define PW_CLIENT_NODE_METHOD_PORT_BUFFERS 6 +#define PW_CLIENT_NODE_METHOD_NUM 7 /** \ref pw_client_node methods */ -struct pw_client_node_proxy_methods { -#define PW_VERSION_CLIENT_NODE_PROXY_METHODS 0 +struct pw_client_node_methods { +#define PW_VERSION_CLIENT_NODE_METHODS 0 uint32_t version; int (*add_listener) (void *object, struct spa_hook *listener, - const struct pw_client_node_proxy_events *events, + const struct pw_client_node_events *events, void *data); /** get the node object */ - struct pw_node_proxy * (*get_node) (void *object, uint32_t version, size_t user_data_size); + struct pw_node * (*get_node) (void *object, uint32_t version, size_t user_data_size); /** * Update the node ports and properties * @@ -281,32 +281,32 @@ struct pw_client_node_proxy_methods { }; -#define pw_client_node_proxy_method(o,method,version,...) \ +#define pw_client_node_method(o,method,version,...) \ ({ \ int _res = -ENOTSUP; \ spa_interface_call_res((struct spa_interface*)o, \ - struct pw_client_node_proxy_methods, _res, \ + struct pw_client_node_methods, _res, \ method, version, ##__VA_ARGS__); \ _res; \ }) -#define pw_client_node_proxy_add_listener(c,...) pw_client_node_proxy_method(c,add_listener,0,__VA_ARGS__) +#define pw_client_node_add_listener(c,...) pw_client_node_method(c,add_listener,0,__VA_ARGS__) -static inline struct pw_node_proxy * -pw_client_node_proxy_get_node(struct pw_client_node_proxy *p, uint32_t version, size_t user_data_size) +static inline struct pw_node * +pw_client_node_get_node(struct pw_client_node *p, uint32_t version, size_t user_data_size) { - struct pw_node_proxy *res = NULL; + struct pw_node *res = NULL; spa_interface_call_res((struct spa_interface*)p, - struct pw_client_node_proxy_methods, res, + struct pw_client_node_methods, res, get_node, 0, version, user_data_size); return res; } -#define pw_client_node_proxy_update(c,...) pw_client_node_proxy_method(c,update,0,__VA_ARGS__) -#define pw_client_node_proxy_port_update(c,...) pw_client_node_proxy_method(c,port_update,0,__VA_ARGS__) -#define pw_client_node_proxy_set_active(c,...) pw_client_node_proxy_method(c,set_active,0,__VA_ARGS__) -#define pw_client_node_proxy_event(c,...) pw_client_node_proxy_method(c,event,0,__VA_ARGS__) -#define pw_client_node_proxy_port_buffers(c,...) pw_client_node_proxy_method(c,port_buffers,0,__VA_ARGS__) +#define pw_client_node_update(c,...) pw_client_node_method(c,update,0,__VA_ARGS__) +#define pw_client_node_port_update(c,...) pw_client_node_method(c,port_update,0,__VA_ARGS__) +#define pw_client_node_set_active(c,...) pw_client_node_method(c,set_active,0,__VA_ARGS__) +#define pw_client_node_event(c,...) pw_client_node_method(c,event,0,__VA_ARGS__) +#define pw_client_node_port_buffers(c,...) pw_client_node_method(c,port_buffers,0,__VA_ARGS__) #ifdef __cplusplus } /* extern "C" */ diff --git a/src/modules/module-client-node.c b/src/modules/module-client-node.c index e2b9d1ec5..8f7fda53a 100644 --- a/src/modules/module-client-node.c +++ b/src/modules/module-client-node.c @@ -81,9 +81,9 @@ static void *create_object(void *_data, } if (version == 0) { - result = pw_client_node0_new(node_resource, properties); + result = pw_impl_client_node0_new(node_resource, properties); } else { - result = pw_client_node_new(node_resource, properties, true); + result = pw_impl_client_node_new(node_resource, properties, true); } if (result == NULL) { res = -errno; diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index 3561da1f2..59727f0b3 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -136,7 +136,7 @@ struct node { }; struct impl { - struct pw_client_node this; + struct pw_impl_client_node this; struct pw_context *context; @@ -160,7 +160,7 @@ struct impl { }; #define pw_client_node_resource(r,m,v,...) \ - pw_resource_call_res(r,struct pw_client_node_proxy_events,m,v,__VA_ARGS__) + pw_resource_call_res(r,struct pw_client_node_events,m,v,__VA_ARGS__) #define pw_client_node_resource_transport(r,...) \ pw_client_node_resource(r,transport,0,__VA_ARGS__) @@ -877,7 +877,7 @@ static int impl_node_process(void *object) return SPA_STATUS_OK; } -static struct pw_node_proxy * +static struct pw_node * client_node_get_node(void *data, uint32_t version, size_t user_data_size) @@ -1033,8 +1033,8 @@ static int client_node_port_buffers(void *data, return 0; } -static struct pw_client_node_proxy_methods client_node_methods = { - PW_VERSION_CLIENT_NODE_PROXY_METHODS, +static struct pw_client_node_methods client_node_methods = { + PW_VERSION_CLIENT_NODE_METHODS, .get_node = client_node_get_node, .update = client_node_update, .port_update = client_node_port_update, @@ -1154,7 +1154,7 @@ static int do_remove_source(struct spa_loop *loop, static void client_node_resource_destroy(void *data) { struct impl *impl = data; - struct pw_client_node *this = &impl->this; + struct pw_impl_client_node *this = &impl->this; struct node *node = &impl->node; pw_log_debug(NAME " %p: destroy", node); @@ -1196,7 +1196,7 @@ static void client_node_resource_pong(void *data, int seq) spa_node_emit_result(&this->hooks, seq, 0, 0, NULL); } -void pw_client_node_registered(struct pw_client_node *this, struct pw_global *global) +void pw_impl_client_node_registered(struct pw_impl_client_node *this, struct pw_global *global) { struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this); struct pw_impl_node *node = this->node; @@ -1234,7 +1234,7 @@ void pw_client_node_registered(struct pw_client_node *this, struct pw_global *gl static void node_initialized(void *data) { struct impl *impl = data; - struct pw_client_node *this = &impl->this; + struct pw_impl_client_node *this = &impl->this; struct node *node = &impl->node; struct pw_global *global; struct spa_system *data_system = impl->node.data_system; @@ -1263,13 +1263,13 @@ static void node_initialized(void *data) pw_log_debug(NAME " %p: io areas %p", node, impl->io_areas->map->ptr); if ((global = pw_impl_node_get_global(this->node)) != NULL) - pw_client_node_registered(this, global); + pw_impl_client_node_registered(this, global); } static void node_free(void *data) { struct impl *impl = data; - struct pw_client_node *this = &impl->this; + struct pw_impl_client_node *this = &impl->this; struct node *node = &impl->node; struct spa_system *data_system = node->data_system; @@ -1610,14 +1610,14 @@ static int process_node(void *data) * * Create a new \ref pw_impl_node. * - * \memberof pw_client_node + * \memberof pw_impl_client_node */ -struct pw_client_node *pw_client_node_new(struct pw_resource *resource, +struct pw_impl_client_node *pw_impl_client_node_new(struct pw_resource *resource, struct pw_properties *properties, bool do_register) { struct impl *impl; - struct pw_client_node *this; + struct pw_impl_client_node *this; struct pw_impl_client *client = pw_resource_get_client(resource); struct pw_context *context = pw_impl_client_get_context(client); const struct spa_support *support; @@ -1705,9 +1705,9 @@ error_exit_cleanup: /** Destroy a client node * \param node the client node to destroy - * \memberof pw_client_node + * \memberof pw_impl_client_node */ -void pw_client_node_destroy(struct pw_client_node *node) +void pw_impl_client_node_destroy(struct pw_impl_client_node *node) { pw_resource_destroy(node->resource); } diff --git a/src/modules/module-client-node/client-node.h b/src/modules/module-client-node/client-node.h index 3e9d82f06..637e5cbf4 100644 --- a/src/modules/module-client-node/client-node.h +++ b/src/modules/module-client-node/client-node.h @@ -32,26 +32,26 @@ extern "C" { #endif -/** \class pw_client_node +/** \class pw_impl_client_node * * PipeWire client node interface */ -struct pw_client_node { +struct pw_impl_client_node { struct pw_impl_node *node; struct pw_resource *resource; uint32_t flags; }; -struct pw_client_node * -pw_client_node_new(struct pw_resource *resource, +struct pw_impl_client_node * +pw_impl_client_node_new(struct pw_resource *resource, struct pw_properties *properties, bool do_register); void -pw_client_node_destroy(struct pw_client_node *node); +pw_impl_client_node_destroy(struct pw_impl_client_node *node); -void pw_client_node_registered(struct pw_client_node *node, struct pw_global *global); +void pw_impl_client_node_registered(struct pw_impl_client_node *node, struct pw_global *global); #ifdef __cplusplus } diff --git a/src/modules/module-client-node/protocol-native.c b/src/modules/module-client-node/protocol-native.c index 7bbdf1049..3a3a5d95e 100644 --- a/src/modules/module-client-node/protocol-native.c +++ b/src/modules/module-client-node/protocol-native.c @@ -83,7 +83,7 @@ static inline int parse_dict(struct spa_pod_parser *prs, struct spa_dict *dict) static int client_node_marshal_add_listener(void *object, struct spa_hook *listener, - const struct pw_client_node_proxy_events *events, + const struct pw_client_node_events *events, void *data) { struct pw_proxy *proxy = object; @@ -91,7 +91,7 @@ static int client_node_marshal_add_listener(void *object, return 0; } -static struct pw_node_proxy * +static struct pw_node * client_node_marshal_get_node(void *object, uint32_t version, size_t user_data_size) { struct pw_proxy *proxy = object; @@ -105,7 +105,7 @@ client_node_marshal_get_node(void *object, uint32_t version, size_t user_data_si new_id = pw_proxy_get_id(res); - b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_GET_NODE, NULL); + b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_GET_NODE, NULL); spa_pod_builder_add_struct(b, SPA_POD_Int(version), @@ -113,7 +113,7 @@ client_node_marshal_get_node(void *object, uint32_t version, size_t user_data_si pw_protocol_native_end_proxy(proxy, b); - return (struct pw_node_proxy *) res; + return (struct pw_node *) res; } static int @@ -128,7 +128,7 @@ client_node_marshal_update(void *object, struct spa_pod_frame f[2]; uint32_t i, n_items; - b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_UPDATE, NULL); + b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_UPDATE, NULL); spa_pod_builder_push_struct(b, &f[0]); spa_pod_builder_add(b, @@ -188,7 +188,7 @@ client_node_marshal_port_update(void *object, struct spa_pod_frame f[2]; uint32_t i, n_items; - b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_PORT_UPDATE, NULL); + b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_PORT_UPDATE, NULL); spa_pod_builder_push_struct(b, &f[0]); spa_pod_builder_add(b, @@ -243,7 +243,7 @@ static int client_node_marshal_set_active(void *object, bool active) struct pw_proxy *proxy = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_SET_ACTIVE, NULL); + b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_SET_ACTIVE, NULL); spa_pod_builder_add_struct(b, SPA_POD_Bool(active)); @@ -256,7 +256,7 @@ static int client_node_marshal_event_method(void *object, const struct spa_event struct pw_proxy *proxy = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_EVENT, NULL); + b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_EVENT, NULL); spa_pod_builder_add_struct(b, SPA_POD_Pod(event)); @@ -277,7 +277,7 @@ client_node_marshal_port_buffers(void *object, struct spa_pod_frame f[2]; uint32_t i, j; - b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_PROXY_METHOD_PORT_BUFFERS, NULL); + b = pw_protocol_native_begin_proxy(proxy, PW_CLIENT_NODE_METHOD_PORT_BUFFERS, NULL); spa_pod_builder_push_struct(b, &f[0]); spa_pod_builder_add(b, @@ -330,7 +330,7 @@ static int client_node_demarshal_transport(void *object, const struct pw_protoco if (readfd < 0 || writefd < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, transport, 0, + pw_proxy_notify(proxy, struct pw_client_node_events, transport, 0, readfd, writefd, mem_id, offset, sz); return 0; @@ -350,7 +350,7 @@ static int client_node_demarshal_set_param(void *object, const struct pw_protoco SPA_POD_PodObject(¶m)) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, set_param, 0, id, flags, param); + pw_proxy_notify(proxy, struct pw_client_node_events, set_param, 0, id, flags, param); return 0; } @@ -365,7 +365,7 @@ static int client_node_demarshal_event_event(void *object, const struct pw_proto SPA_POD_PodObject(&event)) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, event, 0, event); + pw_proxy_notify(proxy, struct pw_client_node_events, event, 0, event); return 0; } @@ -380,7 +380,7 @@ static int client_node_demarshal_command(void *object, const struct pw_protocol_ SPA_POD_PodObject(&command)) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, command, 0, command); + pw_proxy_notify(proxy, struct pw_client_node_events, command, 0, command); return 0; } @@ -411,7 +411,7 @@ static int client_node_demarshal_add_port(void *object, const struct pw_protocol if (parse_dict(&prs, &props) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, add_port, 0, direction, port_id, + pw_proxy_notify(proxy, struct pw_client_node_events, add_port, 0, direction, port_id, props.n_items ? &props : NULL); return 0; } @@ -428,7 +428,7 @@ static int client_node_demarshal_remove_port(void *object, const struct pw_proto SPA_POD_Int(&port_id)) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, remove_port, 0, direction, port_id); + pw_proxy_notify(proxy, struct pw_client_node_events, remove_port, 0, direction, port_id); return 0; } @@ -448,7 +448,7 @@ static int client_node_demarshal_port_set_param(void *object, const struct pw_pr SPA_POD_PodObject(¶m)) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, port_set_param, 0, + pw_proxy_notify(proxy, struct pw_client_node_events, port_set_param, 0, direction, port_id, id, flags, param); return 0; } @@ -511,7 +511,7 @@ static int client_node_demarshal_port_use_buffers(void *object, const struct pw_ d->data = SPA_UINT32_TO_PTR(data_id); } } - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, port_use_buffers, 0, + pw_proxy_notify(proxy, struct pw_client_node_events, port_use_buffers, 0, direction, port_id, mix_id, @@ -537,7 +537,7 @@ static int client_node_demarshal_port_set_io(void *object, const struct pw_proto SPA_POD_Int(&sz)) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, port_set_io, 0, + pw_proxy_notify(proxy, struct pw_client_node_events, port_set_io, 0, direction, port_id, mix_id, id, memid, off, sz); @@ -563,7 +563,7 @@ static int client_node_demarshal_set_activation(void *object, const struct pw_pr signalfd = pw_protocol_native_get_proxy_fd(proxy, sigidx); - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, set_activation, 0, + pw_proxy_notify(proxy, struct pw_client_node_events, set_activation, 0, node_id, signalfd, memid, @@ -585,7 +585,7 @@ static int client_node_demarshal_set_io(void *object, const struct pw_protocol_n SPA_POD_Int(&sz)) < 0) return -EINVAL; - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, set_io, 0, + pw_proxy_notify(proxy, struct pw_client_node_events, set_io, 0, id, memid, off, sz); return 0; } @@ -597,7 +597,7 @@ static int client_node_marshal_transport(void *object, int readfd, int writefd, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_TRANSPORT, &msg); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_TRANSPORT, &msg); spa_pod_builder_add_struct(b, SPA_POD_Fd(pw_protocol_native_add_resource_fd(resource, readfd)), @@ -616,7 +616,7 @@ client_node_marshal_set_param(void *object, uint32_t id, uint32_t flags, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_SET_PARAM, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_SET_PARAM, NULL); spa_pod_builder_add_struct(b, SPA_POD_Id(id), @@ -631,7 +631,7 @@ static int client_node_marshal_event_event(void *object, const struct spa_event struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_EVENT, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_EVENT, NULL); spa_pod_builder_add_struct(b, SPA_POD_Pod(event)); @@ -645,7 +645,7 @@ client_node_marshal_command(void *object, const struct spa_command *command) struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_COMMAND, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_COMMAND, NULL); spa_pod_builder_add_struct(b, SPA_POD_Pod(command)); @@ -662,7 +662,7 @@ client_node_marshal_add_port(void *object, struct spa_pod_builder *b; struct spa_pod_frame f; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_ADD_PORT, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_ADD_PORT, NULL); spa_pod_builder_push_struct(b, &f); spa_pod_builder_add(b, @@ -681,7 +681,7 @@ client_node_marshal_remove_port(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_REMOVE_PORT, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_REMOVE_PORT, NULL); spa_pod_builder_add_struct(b, SPA_POD_Int(direction), @@ -701,7 +701,7 @@ client_node_marshal_port_set_param(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_PARAM, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_PORT_SET_PARAM, NULL); spa_pod_builder_add_struct(b, SPA_POD_Int(direction), @@ -726,7 +726,7 @@ client_node_marshal_port_use_buffers(void *object, struct spa_pod_frame f; uint32_t i, j; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_PORT_USE_BUFFERS, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_PORT_USE_BUFFERS, NULL); spa_pod_builder_push_struct(b, &f); spa_pod_builder_add(b, @@ -781,7 +781,7 @@ client_node_marshal_port_set_io(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_IO, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_PORT_SET_IO, NULL); spa_pod_builder_add_struct(b, SPA_POD_Int(direction), @@ -807,7 +807,7 @@ client_node_marshal_set_activation(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_SET_ACTIVATION, &msg); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_SET_ACTIVATION, &msg); spa_pod_builder_add_struct(b, SPA_POD_Int(node_id), @@ -829,7 +829,7 @@ client_node_marshal_set_io(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_SET_IO, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_EVENT_SET_IO, NULL); spa_pod_builder_add_struct(b, SPA_POD_Id(id), SPA_POD_Int(memid), @@ -850,7 +850,7 @@ static int client_node_demarshal_get_node(void *object, const struct pw_protocol SPA_POD_Int(&new_id)) < 0) return -EINVAL; - return pw_resource_notify(resource, struct pw_client_node_proxy_methods, get_node, 0, + return pw_resource_notify(resource, struct pw_client_node_methods, get_node, 0, version, new_id); } @@ -924,7 +924,7 @@ static int client_node_demarshal_update(void *object, const struct pw_protocol_n } } - pw_resource_notify(resource, struct pw_client_node_proxy_methods, update, 0, change_mask, + pw_resource_notify(resource, struct pw_client_node_methods, update, 0, change_mask, n_params, params, infop); return 0; @@ -1002,7 +1002,7 @@ static int client_node_demarshal_port_update(void *object, const struct pw_proto } } - pw_resource_notify(resource, struct pw_client_node_proxy_methods, port_update, 0, direction, + pw_resource_notify(resource, struct pw_client_node_methods, port_update, 0, direction, port_id, change_mask, n_params, @@ -1021,7 +1021,7 @@ static int client_node_demarshal_set_active(void *object, const struct pw_protoc SPA_POD_Bool(&active)) < 0) return -EINVAL; - pw_resource_notify(resource, struct pw_client_node_proxy_methods, set_active, 0, active); + pw_resource_notify(resource, struct pw_client_node_methods, set_active, 0, active); return 0; } @@ -1036,7 +1036,7 @@ static int client_node_demarshal_event_method(void *object, const struct pw_prot SPA_POD_PodObject(&event)) < 0) return -EINVAL; - pw_resource_notify(resource, struct pw_client_node_proxy_methods, event, 0, event); + pw_resource_notify(resource, struct pw_client_node_methods, event, 0, event); return 0; } @@ -1085,14 +1085,14 @@ static int client_node_demarshal_port_buffers(void *object, const struct pw_prot } } - pw_resource_notify(resource, struct pw_client_node_proxy_methods, port_buffers, 0, + pw_resource_notify(resource, struct pw_client_node_methods, port_buffers, 0, direction, port_id, mix_id, n_buffers, buffers); return 0; } -static const struct pw_client_node_proxy_methods pw_protocol_native_client_node_method_marshal = { - PW_VERSION_CLIENT_NODE_PROXY_METHODS, +static const struct pw_client_node_methods pw_protocol_native_client_node_method_marshal = { + PW_VERSION_CLIENT_NODE_METHODS, .add_listener = &client_node_marshal_add_listener, .get_node = &client_node_marshal_get_node, .update = &client_node_marshal_update, @@ -1103,19 +1103,19 @@ static const struct pw_client_node_proxy_methods pw_protocol_native_client_node_ }; static const struct pw_protocol_native_demarshal -pw_protocol_native_client_node_method_demarshal[PW_CLIENT_NODE_PROXY_METHOD_NUM] = +pw_protocol_native_client_node_method_demarshal[PW_CLIENT_NODE_METHOD_NUM] = { - [PW_CLIENT_NODE_PROXY_METHOD_ADD_LISTENER] = { NULL, 0 }, - [PW_CLIENT_NODE_PROXY_METHOD_GET_NODE] = { &client_node_demarshal_get_node, 0 }, - [PW_CLIENT_NODE_PROXY_METHOD_UPDATE] = { &client_node_demarshal_update, 0 }, - [PW_CLIENT_NODE_PROXY_METHOD_PORT_UPDATE] = { &client_node_demarshal_port_update, 0 }, - [PW_CLIENT_NODE_PROXY_METHOD_SET_ACTIVE] = { &client_node_demarshal_set_active, 0 }, - [PW_CLIENT_NODE_PROXY_METHOD_EVENT] = { &client_node_demarshal_event_method, 0 }, - [PW_CLIENT_NODE_PROXY_METHOD_PORT_BUFFERS] = { &client_node_demarshal_port_buffers, 0 } + [PW_CLIENT_NODE_METHOD_ADD_LISTENER] = { NULL, 0 }, + [PW_CLIENT_NODE_METHOD_GET_NODE] = { &client_node_demarshal_get_node, 0 }, + [PW_CLIENT_NODE_METHOD_UPDATE] = { &client_node_demarshal_update, 0 }, + [PW_CLIENT_NODE_METHOD_PORT_UPDATE] = { &client_node_demarshal_port_update, 0 }, + [PW_CLIENT_NODE_METHOD_SET_ACTIVE] = { &client_node_demarshal_set_active, 0 }, + [PW_CLIENT_NODE_METHOD_EVENT] = { &client_node_demarshal_event_method, 0 }, + [PW_CLIENT_NODE_METHOD_PORT_BUFFERS] = { &client_node_demarshal_port_buffers, 0 } }; -static const struct pw_client_node_proxy_events pw_protocol_native_client_node_event_marshal = { - PW_VERSION_CLIENT_NODE_PROXY_EVENTS, +static const struct pw_client_node_events pw_protocol_native_client_node_event_marshal = { + PW_VERSION_CLIENT_NODE_EVENTS, .transport = &client_node_marshal_transport, .set_param = &client_node_marshal_set_param, .set_io = &client_node_marshal_set_io, @@ -1130,27 +1130,27 @@ static const struct pw_client_node_proxy_events pw_protocol_native_client_node_e }; static const struct pw_protocol_native_demarshal -pw_protocol_native_client_node_event_demarshal[PW_CLIENT_NODE_PROXY_EVENT_NUM] = +pw_protocol_native_client_node_event_demarshal[PW_CLIENT_NODE_EVENT_NUM] = { - [PW_CLIENT_NODE_PROXY_EVENT_TRANSPORT] = { &client_node_demarshal_transport, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_SET_PARAM] = { &client_node_demarshal_set_param, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_SET_IO] = { &client_node_demarshal_set_io, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_EVENT] = { &client_node_demarshal_event_event, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_COMMAND] = { &client_node_demarshal_command, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_ADD_PORT] = { &client_node_demarshal_add_port, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_REMOVE_PORT] = { &client_node_demarshal_remove_port, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_PARAM] = { &client_node_demarshal_port_set_param, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_PORT_USE_BUFFERS] = { &client_node_demarshal_port_use_buffers, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_IO] = { &client_node_demarshal_port_set_io, 0 }, - [PW_CLIENT_NODE_PROXY_EVENT_SET_ACTIVATION] = { &client_node_demarshal_set_activation, 0 } + [PW_CLIENT_NODE_EVENT_TRANSPORT] = { &client_node_demarshal_transport, 0 }, + [PW_CLIENT_NODE_EVENT_SET_PARAM] = { &client_node_demarshal_set_param, 0 }, + [PW_CLIENT_NODE_EVENT_SET_IO] = { &client_node_demarshal_set_io, 0 }, + [PW_CLIENT_NODE_EVENT_EVENT] = { &client_node_demarshal_event_event, 0 }, + [PW_CLIENT_NODE_EVENT_COMMAND] = { &client_node_demarshal_command, 0 }, + [PW_CLIENT_NODE_EVENT_ADD_PORT] = { &client_node_demarshal_add_port, 0 }, + [PW_CLIENT_NODE_EVENT_REMOVE_PORT] = { &client_node_demarshal_remove_port, 0 }, + [PW_CLIENT_NODE_EVENT_PORT_SET_PARAM] = { &client_node_demarshal_port_set_param, 0 }, + [PW_CLIENT_NODE_EVENT_PORT_USE_BUFFERS] = { &client_node_demarshal_port_use_buffers, 0 }, + [PW_CLIENT_NODE_EVENT_PORT_SET_IO] = { &client_node_demarshal_port_set_io, 0 }, + [PW_CLIENT_NODE_EVENT_SET_ACTIVATION] = { &client_node_demarshal_set_activation, 0 } }; static const struct pw_protocol_marshal pw_protocol_native_client_node_marshal = { PW_TYPE_INTERFACE_ClientNode, PW_VERSION_CLIENT_NODE, 0, - PW_CLIENT_NODE_PROXY_METHOD_NUM, - PW_CLIENT_NODE_PROXY_EVENT_NUM, + PW_CLIENT_NODE_METHOD_NUM, + PW_CLIENT_NODE_EVENT_NUM, .client_marshal = &pw_protocol_native_client_node_method_marshal, .server_demarshal = &pw_protocol_native_client_node_method_demarshal, .server_marshal = &pw_protocol_native_client_node_event_marshal, diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index 77dff90ce..bab5408f3 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -85,9 +85,9 @@ struct node_data { int do_free:1; int have_transport:1; - struct pw_client_node_proxy *client_node; + struct pw_client_node *client_node; struct spa_hook client_node_listener; - struct spa_hook client_node_proxy_listener; + struct spa_hook proxy_client_node_listener; struct pw_proxy *proxy; struct spa_hook proxy_listener; @@ -263,7 +263,7 @@ static int client_node_transport(void *object, data->have_transport = true; if (data->node->active) - pw_client_node_proxy_set_active(data->client_node, true); + pw_client_node_set_active(data->client_node, true); return 0; } @@ -314,7 +314,7 @@ static int add_node_update(struct pw_proxy *proxy, uint32_t change_mask) } - res = pw_client_node_proxy_update(data->client_node, + res = pw_client_node_update(data->client_node, change_mask, n_params, (const struct spa_pod **)params, @@ -374,7 +374,7 @@ static int add_port_update(struct pw_proxy *proxy, struct pw_impl_port *port, ui pi.params = port->info.params; } - res = pw_client_node_proxy_port_update(data->client_node, + res = pw_client_node_port_update(data->client_node, port->direction, port->port_id, change_mask, @@ -694,7 +694,7 @@ client_node_port_use_buffers(void *object, goto error_exit_cleanup; if (flags & SPA_NODE_BUFFERS_FLAG_ALLOC) { - pw_client_node_proxy_port_buffers(data->client_node, + pw_client_node_port_buffers(data->client_node, direction, port_id, mix_id, n_buffers, bufs); @@ -870,8 +870,8 @@ error_exit: return res; } -static const struct pw_client_node_proxy_events client_node_events = { - PW_VERSION_CLIENT_NODE_PROXY_EVENTS, +static const struct pw_client_node_events client_node_events = { + PW_VERSION_CLIENT_NODE_EVENTS, .transport = client_node_transport, .set_param = client_node_set_param, .set_io = client_node_set_io, @@ -989,7 +989,7 @@ static void node_active_changed(void *data, bool active) { struct node_data *d = data; pw_log_debug("active %d", active); - pw_client_node_proxy_set_active(d->client_node, active); + pw_client_node_set_active(d->client_node, active); } static const struct pw_impl_node_events node_events = { @@ -1001,7 +1001,7 @@ static const struct pw_impl_node_events node_events = { .active_changed = node_active_changed, }; -static void client_node_proxy_destroy(void *_data) +static void client_node_destroy(void *_data) { struct node_data *data = _data; @@ -1020,17 +1020,17 @@ static void client_node_proxy_destroy(void *_data) pw_impl_node_destroy(data->node); } -static void client_node_proxy_bound(void *_data, uint32_t global_id) +static void client_node_bound(void *_data, uint32_t global_id) { struct node_data *data = _data; pw_log_debug("%p: bound %u", data, global_id); data->remote_id = global_id; } -static const struct pw_proxy_events client_node_proxy_events = { +static const struct pw_proxy_events proxy_client_node_events = { PW_VERSION_PROXY_EVENTS, - .destroy = client_node_proxy_destroy, - .bound = client_node_proxy_bound, + .destroy = client_node_destroy, + .bound = client_node_bound, }; static void proxy_destroy(void *_data) @@ -1129,7 +1129,7 @@ static struct pw_proxy *node_export(struct pw_core *core, void *object, bool do_ data->node = node; data->do_free = do_free; data->context = pw_impl_node_get_context(node); - data->client_node = (struct pw_client_node_proxy *)client_node; + data->client_node = (struct pw_client_node *)client_node; data->remote_id = SPA_ID_INVALID; node->exported = true; @@ -1144,19 +1144,19 @@ static struct pw_proxy *node_export(struct pw_core *core, void *object, bool do_ pw_array_ensure_size(&data->links, sizeof(struct link) * 64); pw_proxy_add_listener(client_node, - &data->client_node_proxy_listener, - &client_node_proxy_events, data); + &data->proxy_client_node_listener, + &proxy_client_node_events, data); spa_node_set_callbacks(node->node, &node_callbacks, data); pw_impl_node_add_listener(node, &data->node_listener, &node_events, data); - pw_client_node_proxy_add_listener(data->client_node, + pw_client_node_add_listener(data->client_node, &data->client_node_listener, &client_node_events, 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_get_node(data->client_node, PW_VERSION_NODE, user_data_size); pw_proxy_add_listener(data->proxy, &data->proxy_listener, &proxy_events, data); diff --git a/src/modules/module-client-node/v0/client-node.c b/src/modules/module-client-node/v0/client-node.c index e1bb105e2..50bbda36c 100644 --- a/src/modules/module-client-node/v0/client-node.c +++ b/src/modules/module-client-node/v0/client-node.c @@ -131,7 +131,7 @@ struct node { }; struct impl { - struct pw_client_node0 this; + struct pw_impl_client_node0 this; bool client_reuse; @@ -1010,8 +1010,8 @@ static void client_node0_event(void *data, struct spa_event *event) spa_node_emit_event(&this->hooks, event); } -static struct pw_client_node0_proxy_methods client_node0_methods = { - PW_VERSION_CLIENT_NODE0_PROXY_METHODS, +static struct pw_client_node0_methods client_node0_methods = { + PW_VERSION_CLIENT_NODE0_METHODS, .done = client_node0_done, .update = client_node0_update, .port_update = client_node0_port_update, @@ -1139,7 +1139,7 @@ static int do_remove_source(struct spa_loop *loop, static void client_node0_resource_destroy(void *data) { struct impl *impl = data; - struct pw_client_node0 *this = &impl->this; + struct pw_impl_client_node0 *this = &impl->this; struct node *node = &impl->node; pw_log_debug("client-node %p: destroy", impl); @@ -1163,7 +1163,7 @@ static void client_node0_resource_destroy(void *data) static void node_initialized(void *data) { struct impl *impl = data; - struct pw_client_node0 *this = &impl->this; + struct pw_impl_client_node0 *this = &impl->this; struct pw_impl_node *node = this->node; struct spa_system *data_system = impl->node.data_system; @@ -1247,13 +1247,13 @@ static void convert_properties(struct pw_properties *properties) * * Create a new \ref pw_impl_node. * - * \memberof pw_client_node + * \memberof pw_impl_client_node */ -struct pw_client_node0 *pw_client_node0_new(struct pw_resource *resource, +struct pw_impl_client_node0 *pw_impl_client_node0_new(struct pw_resource *resource, struct pw_properties *properties) { struct impl *impl; - struct pw_client_node0 *this; + struct pw_impl_client_node0 *this; struct pw_impl_client *client = pw_resource_get_client(resource); struct pw_context *context = pw_impl_client_get_context(client); const struct spa_support *support; @@ -1334,9 +1334,9 @@ error_exit_free: /** Destroy a client node * \param node the client node to destroy - * \memberof pw_client_node + * \memberof pw_impl_client_node */ -void pw_client_node0_destroy(struct pw_client_node0 *node) +void pw_impl_client_node0_destroy(struct pw_impl_client_node0 *node) { pw_resource_destroy(node->resource); } diff --git a/src/modules/module-client-node/v0/client-node.h b/src/modules/module-client-node/v0/client-node.h index 13a1044a3..34d095e8d 100644 --- a/src/modules/module-client-node/v0/client-node.h +++ b/src/modules/module-client-node/v0/client-node.h @@ -28,22 +28,22 @@ extern "C" { #endif -/** \class pw_client_node0 +/** \class pw_impl_client_node0 * * PipeWire client node interface */ -struct pw_client_node0 { +struct pw_impl_client_node0 { struct pw_impl_node *node; struct pw_resource *resource; }; -struct pw_client_node0 * -pw_client_node0_new(struct pw_resource *resource, +struct pw_impl_client_node0 * +pw_impl_client_node0_new(struct pw_resource *resource, struct pw_properties *properties); void -pw_client_node0_destroy(struct pw_client_node0 *node); +pw_impl_client_node0_destroy(struct pw_impl_client_node0 *node); #ifdef __cplusplus } diff --git a/src/modules/module-client-node/v0/ext-client-node.h b/src/modules/module-client-node/v0/ext-client-node.h index 7f4a36634..d2a69921d 100644 --- a/src/modules/module-client-node/v0/ext-client-node.h +++ b/src/modules/module-client-node/v0/ext-client-node.h @@ -156,17 +156,17 @@ struct pw_client_node0_buffer { struct spa_buffer *buffer; /**< buffer describing metadata and buffer memory */ }; -#define PW_CLIENT_NODE0_PROXY_METHOD_DONE 0 -#define PW_CLIENT_NODE0_PROXY_METHOD_UPDATE 1 -#define PW_CLIENT_NODE0_PROXY_METHOD_PORT_UPDATE 2 -#define PW_CLIENT_NODE0_PROXY_METHOD_SET_ACTIVE 3 -#define PW_CLIENT_NODE0_PROXY_METHOD_EVENT 4 -#define PW_CLIENT_NODE0_PROXY_METHOD_DESTROY 5 -#define PW_CLIENT_NODE0_PROXY_METHOD_NUM 6 +#define PW_CLIENT_NODE0_METHOD_DONE 0 +#define PW_CLIENT_NODE0_METHOD_UPDATE 1 +#define PW_CLIENT_NODE0_METHOD_PORT_UPDATE 2 +#define PW_CLIENT_NODE0_METHOD_SET_ACTIVE 3 +#define PW_CLIENT_NODE0_METHOD_EVENT 4 +#define PW_CLIENT_NODE0_METHOD_DESTROY 5 +#define PW_CLIENT_NODE0_METHOD_NUM 6 /** \ref pw_client_node methods */ -struct pw_client_node0_proxy_methods { -#define PW_VERSION_CLIENT_NODE0_PROXY_METHODS 0 +struct pw_client_node0_methods { +#define PW_VERSION_CLIENT_NODE0_METHODS 0 uint32_t version; /** Complete an async operation */ @@ -227,22 +227,22 @@ struct pw_client_node0_proxy_methods { void (*destroy) (void *object); }; -#define PW_CLIENT_NODE0_PROXY_EVENT_ADD_MEM 0 -#define PW_CLIENT_NODE0_PROXY_EVENT_TRANSPORT 1 -#define PW_CLIENT_NODE0_PROXY_EVENT_SET_PARAM 2 -#define PW_CLIENT_NODE0_PROXY_EVENT_EVENT 3 -#define PW_CLIENT_NODE0_PROXY_EVENT_COMMAND 4 -#define PW_CLIENT_NODE0_PROXY_EVENT_ADD_PORT 5 -#define PW_CLIENT_NODE0_PROXY_EVENT_REMOVE_PORT 6 -#define PW_CLIENT_NODE0_PROXY_EVENT_PORT_SET_PARAM 7 -#define PW_CLIENT_NODE0_PROXY_EVENT_PORT_USE_BUFFERS 8 -#define PW_CLIENT_NODE0_PROXY_EVENT_PORT_COMMAND 9 -#define PW_CLIENT_NODE0_PROXY_EVENT_PORT_SET_IO 10 -#define PW_CLIENT_NODE0_PROXY_EVENT_NUM 11 +#define PW_CLIENT_NODE0_EVENT_ADD_MEM 0 +#define PW_CLIENT_NODE0_EVENT_TRANSPORT 1 +#define PW_CLIENT_NODE0_EVENT_SET_PARAM 2 +#define PW_CLIENT_NODE0_EVENT_EVENT 3 +#define PW_CLIENT_NODE0_EVENT_COMMAND 4 +#define PW_CLIENT_NODE0_EVENT_ADD_PORT 5 +#define PW_CLIENT_NODE0_EVENT_REMOVE_PORT 6 +#define PW_CLIENT_NODE0_EVENT_PORT_SET_PARAM 7 +#define PW_CLIENT_NODE0_EVENT_PORT_USE_BUFFERS 8 +#define PW_CLIENT_NODE0_EVENT_PORT_COMMAND 9 +#define PW_CLIENT_NODE0_EVENT_PORT_SET_IO 10 +#define PW_CLIENT_NODE0_EVENT_NUM 11 /** \ref pw_client_node events */ -struct pw_client_node0_proxy_events { -#define PW_VERSION_CLIENT_NODE0_PROXY_EVENTS 0 +struct pw_client_node0_events { +#define PW_VERSION_CLIENT_NODE0_EVENTS 0 uint32_t version; /** * Memory was added to a node @@ -386,7 +386,7 @@ struct pw_client_node0_proxy_events { uint32_t offset, uint32_t size); }; -#define pw_client_node0_resource(r,m,v,...) pw_resource_call(r, struct pw_client_node0_proxy_events, m, v, ##__VA_ARGS__) +#define pw_client_node0_resource(r,m,v,...) pw_resource_call(r, struct pw_client_node0_events, m, v, ##__VA_ARGS__) #define pw_client_node0_resource_add_mem(r,...) pw_client_node0_resource(r,add_mem,0,__VA_ARGS__) #define pw_client_node0_resource_transport(r,...) pw_client_node0_resource(r,transport,0,__VA_ARGS__) diff --git a/src/modules/module-client-node/v0/protocol-native.c b/src/modules/module-client-node/v0/protocol-native.c index f0f6a1389..a14901281 100644 --- a/src/modules/module-client-node/v0/protocol-native.c +++ b/src/modules/module-client-node/v0/protocol-native.c @@ -60,7 +60,7 @@ client_node_marshal_add_mem(void *object, return; } - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_ADD_MEM, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_ADD_MEM, NULL); spa_pod_builder_add_struct(b, "i", mem_id, @@ -80,7 +80,7 @@ static void client_node_marshal_transport(void *object, uint32_t node_id, int re pw_client_node0_transport_get_info(transport, &info); - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_TRANSPORT, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_TRANSPORT, NULL); spa_pod_builder_add_struct(b, "i", node_id, @@ -100,7 +100,7 @@ client_node_marshal_set_param(void *object, uint32_t seq, uint32_t id, uint32_t struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_SET_PARAM, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_SET_PARAM, NULL); spa_pod_builder_add_struct(b, "i", seq, @@ -116,7 +116,7 @@ static void client_node_marshal_event_event(void *object, const struct spa_event struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_EVENT, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_EVENT, NULL); spa_pod_builder_add_struct(b, "P", event); @@ -131,7 +131,7 @@ client_node_marshal_command(void *object, uint32_t seq, const struct spa_command struct spa_pod_builder *b; struct spa_pod_frame f; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_COMMAND, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_COMMAND, NULL); spa_pod_builder_push_struct(b, &f); spa_pod_builder_add(b, "i", seq, NULL); @@ -148,7 +148,7 @@ client_node_marshal_add_port(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_ADD_PORT, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_ADD_PORT, NULL); spa_pod_builder_add_struct(b, "i", seq, @@ -165,7 +165,7 @@ client_node_marshal_remove_port(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_REMOVE_PORT, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_REMOVE_PORT, NULL); spa_pod_builder_add_struct(b, "i", seq, @@ -190,7 +190,7 @@ client_node_marshal_port_set_param(void *object, struct spa_pod_frame f; const char *typename; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_PORT_SET_PARAM, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_PORT_SET_PARAM, NULL); switch (id) { case SPA_PARAM_Props: @@ -229,7 +229,7 @@ client_node_marshal_port_use_buffers(void *object, struct spa_pod_frame f; uint32_t i, j; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_PORT_USE_BUFFERS, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_PORT_USE_BUFFERS, NULL); spa_pod_builder_push_struct(b, &f); spa_pod_builder_add(b, @@ -281,7 +281,7 @@ client_node_marshal_port_command(void *object, struct spa_pod_builder *b; struct spa_pod_frame f; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_PORT_COMMAND, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_PORT_COMMAND, NULL); spa_pod_builder_push_struct(b, &f); spa_pod_builder_add(b, @@ -306,7 +306,7 @@ client_node_marshal_port_set_io(void *object, struct pw_resource *resource = object; struct spa_pod_builder *b; - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_PROXY_EVENT_PORT_SET_IO, NULL); + b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE0_EVENT_PORT_SET_IO, NULL); spa_pod_builder_add_struct(b, "i", seq, @@ -333,7 +333,7 @@ static int client_node_demarshal_done(void *object, const struct pw_protocol_nat "i", &res) < 0) return -EINVAL; - return pw_resource_notify(resource, struct pw_client_node0_proxy_methods, done, 0, seq, res); + return pw_resource_notify(resource, struct pw_client_node0_methods, done, 0, seq, res); } static int client_node_demarshal_update(void *object, const struct pw_protocol_native_message *msg) @@ -359,7 +359,7 @@ static int client_node_demarshal_update(void *object, const struct pw_protocol_n if (spa_pod_parser_get(&prs, "O", ¶ms[i], NULL) < 0) return -EINVAL; - return pw_resource_notify(resource, struct pw_client_node0_proxy_methods, update, 0, change_mask, + return pw_resource_notify(resource, struct pw_client_node0_methods, update, 0, change_mask, max_input_ports, max_output_ports, n_params, @@ -414,7 +414,7 @@ static int client_node_demarshal_port_update(void *object, const struct pw_proto } } - return pw_resource_notify(resource, struct pw_client_node0_proxy_methods, port_update, 0, direction, + return pw_resource_notify(resource, struct pw_client_node0_methods, port_update, 0, direction, port_id, change_mask, n_params, @@ -432,7 +432,7 @@ static int client_node_demarshal_set_active(void *object, const struct pw_protoc "b", &active) < 0) return -EINVAL; - return pw_resource_notify(resource, struct pw_client_node0_proxy_methods, set_active, 0, active); + return pw_resource_notify(resource, struct pw_client_node0_methods, set_active, 0, active); } static int client_node_demarshal_event_method(void *object, const struct pw_protocol_native_message *msg) @@ -446,7 +446,7 @@ static int client_node_demarshal_event_method(void *object, const struct pw_prot "O", &event) < 0) return -EINVAL; - return pw_resource_notify(resource, struct pw_client_node0_proxy_methods, event, 0, event); + return pw_resource_notify(resource, struct pw_client_node0_methods, event, 0, event); } static int client_node_demarshal_destroy(void *object, const struct pw_protocol_native_message *msg) @@ -459,7 +459,7 @@ static int client_node_demarshal_destroy(void *object, const struct pw_protocol_ if (spa_pod_parser_get_struct(&prs, NULL) < 0) return -EINVAL; - res = pw_resource_notify(resource, struct pw_client_node0_proxy_methods, destroy, 0); + res = pw_resource_notify(resource, struct pw_client_node0_methods, destroy, 0); pw_resource_destroy(resource); return res; } @@ -473,8 +473,8 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_ { &client_node_demarshal_destroy, 0, 0 }, }; -static const struct pw_client_node0_proxy_events pw_protocol_native_client_node_event_marshal = { - PW_VERSION_CLIENT_NODE0_PROXY_EVENTS, +static const struct pw_client_node0_events pw_protocol_native_client_node_event_marshal = { + PW_VERSION_CLIENT_NODE0_EVENTS, &client_node_marshal_add_mem, &client_node_marshal_transport, &client_node_marshal_set_param, @@ -491,8 +491,8 @@ static const struct pw_client_node0_proxy_events pw_protocol_native_client_node_ static const struct pw_protocol_marshal pw_protocol_native_client_node_marshal = { PW_TYPE_INTERFACE_ClientNode, PW_VERSION_CLIENT_NODE0, - PW_CLIENT_NODE0_PROXY_METHOD_NUM, - PW_CLIENT_NODE0_PROXY_EVENT_NUM, + PW_CLIENT_NODE0_METHOD_NUM, + PW_CLIENT_NODE0_EVENT_NUM, 0, NULL, .server_demarshal = &pw_protocol_native_client_node_method_demarshal,