diff --git a/src/modules/module-protocol-native/protocol-native.c b/src/modules/module-protocol-native/protocol-native.c index 5ecd9794d..a1261e4bf 100644 --- a/src/modules/module-protocol-native/protocol-native.c +++ b/src/modules/module-protocol-native/protocol-native.c @@ -30,14 +30,14 @@ #include "connection.h" -static void core_marshal_hello(void *object) +static void core_marshal_hello(void *object, uint32_t version) { struct pw_proxy *proxy = object; struct spa_pod_builder *b; b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_HELLO); - spa_pod_builder_add_struct(b, "P", NULL); + spa_pod_builder_add_struct(b, "i", version); pw_protocol_native_end_proxy(proxy, b); } @@ -364,13 +364,14 @@ static int core_demarshal_hello(void *object, void *data, size_t size) { struct pw_resource *resource = object; struct spa_pod_parser prs; - void *ptr; + uint32_t version; spa_pod_parser_init(&prs, data, size, 0); - if (spa_pod_parser_get(&prs, "[P]", &ptr, NULL) < 0) + if (spa_pod_parser_get(&prs, "[ i", &version, + NULL) < 0) return -EINVAL; - pw_resource_do(resource, struct pw_core_proxy_methods, hello, 0); + pw_resource_do(resource, struct pw_core_proxy_methods, hello, 0, version); return 0; } diff --git a/src/pipewire/core.c b/src/pipewire/core.c index 85f6a1088..4a1786a86 100644 --- a/src/pipewire/core.c +++ b/src/pipewire/core.c @@ -134,12 +134,13 @@ static const struct pw_resource_events resource_events = { .destroy = destroy_registry_resource }; -static void core_hello(void *object) +static void core_hello(void *object, uint32_t version) { struct pw_resource *resource = object; struct pw_core *this = resource->core; - pw_log_debug("core %p: hello from source %p", this, resource); + pw_log_debug("core %p: hello %d from source %p", this, version, resource); + this->info.change_mask = PW_CORE_CHANGE_MASK_ALL; pw_core_resource_info(resource, &this->info); } diff --git a/src/pipewire/interfaces.h b/src/pipewire/interfaces.h index e98278a1d..c9d072f66 100644 --- a/src/pipewire/interfaces.h +++ b/src/pipewire/interfaces.h @@ -115,9 +115,9 @@ struct pw_core_proxy_methods { uint32_t version; /** * Start a conversation with the server. This will send - * the core info and server types. + * the core info.. */ - void (*hello) (void *object); + void (*hello) (void *object, uint32_t version); /** * Do server roundtrip * @@ -183,9 +183,9 @@ struct pw_core_proxy_methods { }; static inline void -pw_core_proxy_hello(struct pw_core_proxy *core) +pw_core_proxy_hello(struct pw_core_proxy *core, uint32_t version) { - pw_proxy_do((struct pw_proxy*)core, struct pw_core_proxy_methods, hello); + pw_proxy_do((struct pw_proxy*)core, struct pw_core_proxy_methods, hello, version); } static inline void diff --git a/src/pipewire/port.c b/src/pipewire/port.c index 94ee32adb..aaa353765 100644 --- a/src/pipewire/port.c +++ b/src/pipewire/port.c @@ -403,7 +403,7 @@ static void port_enum_params(void *object, uint32_t id, uint32_t index, uint32_t } static const struct pw_port_proxy_methods port_methods = { - PW_VERSION_NODE_PROXY_METHODS, + PW_VERSION_PORT_PROXY_METHODS, .enum_params = port_enum_params }; diff --git a/src/pipewire/remote.c b/src/pipewire/remote.c index 2bce47cf7..3ee0f9f2a 100644 --- a/src/pipewire/remote.c +++ b/src/pipewire/remote.c @@ -378,7 +378,7 @@ static int do_connect(struct pw_remote *remote) pw_core_proxy_add_listener(remote->core_proxy, &impl->core_listener, &core_proxy_events, remote); - pw_core_proxy_hello(remote->core_proxy); + pw_core_proxy_hello(remote->core_proxy, PW_VERSION_CORE); pw_core_proxy_client_update(remote->core_proxy, &remote->properties->dict); pw_core_proxy_sync(remote->core_proxy, 0);