mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-19 08:57:14 -05:00
Add version to hello
This commit is contained in:
parent
537598726b
commit
2accfc84d7
5 changed files with 15 additions and 13 deletions
|
|
@ -30,14 +30,14 @@
|
||||||
|
|
||||||
#include "connection.h"
|
#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 pw_proxy *proxy = object;
|
||||||
struct spa_pod_builder *b;
|
struct spa_pod_builder *b;
|
||||||
|
|
||||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_HELLO);
|
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);
|
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 pw_resource *resource = object;
|
||||||
struct spa_pod_parser prs;
|
struct spa_pod_parser prs;
|
||||||
void *ptr;
|
uint32_t version;
|
||||||
|
|
||||||
spa_pod_parser_init(&prs, data, size, 0);
|
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;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,12 +134,13 @@ static const struct pw_resource_events resource_events = {
|
||||||
.destroy = destroy_registry_resource
|
.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_resource *resource = object;
|
||||||
struct pw_core *this = resource->core;
|
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;
|
this->info.change_mask = PW_CORE_CHANGE_MASK_ALL;
|
||||||
pw_core_resource_info(resource, &this->info);
|
pw_core_resource_info(resource, &this->info);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,9 +115,9 @@ struct pw_core_proxy_methods {
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
/**
|
/**
|
||||||
* Start a conversation with the server. This will send
|
* 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
|
* Do server roundtrip
|
||||||
*
|
*
|
||||||
|
|
@ -183,9 +183,9 @@ struct pw_core_proxy_methods {
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void
|
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
|
static inline void
|
||||||
|
|
|
||||||
|
|
@ -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 = {
|
static const struct pw_port_proxy_methods port_methods = {
|
||||||
PW_VERSION_NODE_PROXY_METHODS,
|
PW_VERSION_PORT_PROXY_METHODS,
|
||||||
.enum_params = port_enum_params
|
.enum_params = port_enum_params
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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_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_client_update(remote->core_proxy, &remote->properties->dict);
|
||||||
pw_core_proxy_sync(remote->core_proxy, 0);
|
pw_core_proxy_sync(remote->core_proxy, 0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue