mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
interfaces: remove core properties update
Use the update_properties method on the client
This commit is contained in:
parent
0072f9cf2b
commit
103249ae76
4 changed files with 6 additions and 72 deletions
|
|
@ -47,28 +47,6 @@ static void core_marshal_hello(void *object, uint32_t version)
|
|||
pw_protocol_native_end_proxy(proxy, b);
|
||||
}
|
||||
|
||||
static void core_marshal_client_update(void *object, const struct spa_dict *props)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_builder *b;
|
||||
int i, n_items;
|
||||
|
||||
b = pw_protocol_native_begin_proxy(proxy, PW_CORE_PROXY_METHOD_CLIENT_UPDATE);
|
||||
|
||||
n_items = props ? props->n_items : 0;
|
||||
|
||||
spa_pod_builder_add(b, "[ i", n_items, NULL);
|
||||
|
||||
for (i = 0; i < n_items; i++) {
|
||||
spa_pod_builder_add(b,
|
||||
"s", props->items[i].key,
|
||||
"s", props->items[i].value, NULL);
|
||||
}
|
||||
spa_pod_builder_add(b, "]", NULL);
|
||||
|
||||
pw_protocol_native_end_proxy(proxy, b);
|
||||
}
|
||||
|
||||
static void core_marshal_sync(void *object, uint32_t seq)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
|
|
@ -297,29 +275,6 @@ static void core_marshal_remove_id(void *object, uint32_t id)
|
|||
pw_protocol_native_end_resource(resource, b);
|
||||
}
|
||||
|
||||
static int core_demarshal_client_update(void *object, void *data, size_t size)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_dict props;
|
||||
struct spa_pod_parser prs;
|
||||
uint32_t i;
|
||||
|
||||
spa_pod_parser_init(&prs, data, size, 0);
|
||||
if (spa_pod_parser_get(&prs, "[ i", &props.n_items, NULL) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
props.items = alloca(props.n_items * sizeof(struct spa_dict_item));
|
||||
for (i = 0; i < props.n_items; i++) {
|
||||
if (spa_pod_parser_get(&prs,
|
||||
"s", &props.items[i].key,
|
||||
"s", &props.items[i].value,
|
||||
NULL) < 0)
|
||||
return -EINVAL;
|
||||
}
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, client_update, 0, &props);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int core_demarshal_hello(void *object, void *data, size_t size)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
|
|
@ -1479,7 +1434,6 @@ static const struct pw_core_proxy_methods pw_protocol_native_core_method_marshal
|
|||
&core_marshal_hello,
|
||||
&core_marshal_sync,
|
||||
&core_marshal_get_registry,
|
||||
&core_marshal_client_update,
|
||||
&core_marshal_create_object,
|
||||
&core_marshal_destroy,
|
||||
};
|
||||
|
|
@ -1488,7 +1442,6 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_method_
|
|||
{ &core_demarshal_hello, 0, },
|
||||
{ &core_demarshal_sync, 0, },
|
||||
{ &core_demarshal_get_registry, 0, },
|
||||
{ &core_demarshal_client_update, 0, },
|
||||
{ &core_demarshal_create_object, 0, },
|
||||
{ &core_demarshal_destroy, 0, }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -155,12 +155,6 @@ static void core_hello(void *object, uint32_t version)
|
|||
pw_core_resource_info(resource, &this->info);
|
||||
}
|
||||
|
||||
static void core_client_update(void *object, const struct spa_dict *props)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
pw_client_update_properties(resource->client, props);
|
||||
}
|
||||
|
||||
static void core_sync(void *object, uint32_t seq)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
|
|
@ -314,7 +308,6 @@ static const struct pw_core_proxy_methods core_methods = {
|
|||
.hello = core_hello,
|
||||
.sync = core_sync,
|
||||
.get_registry = core_get_registry,
|
||||
.client_update = core_client_update,
|
||||
.create_object = core_create_object,
|
||||
.destroy = core_destroy,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -69,10 +69,9 @@ struct pw_link_proxy;
|
|||
#define PW_CORE_PROXY_METHOD_HELLO 0
|
||||
#define PW_CORE_PROXY_METHOD_SYNC 1
|
||||
#define PW_CORE_PROXY_METHOD_GET_REGISTRY 2
|
||||
#define PW_CORE_PROXY_METHOD_CLIENT_UPDATE 3
|
||||
#define PW_CORE_PROXY_METHOD_CREATE_OBJECT 4
|
||||
#define PW_CORE_PROXY_METHOD_DESTROY 5
|
||||
#define PW_CORE_PROXY_METHOD_NUM 6
|
||||
#define PW_CORE_PROXY_METHOD_CREATE_OBJECT 3
|
||||
#define PW_CORE_PROXY_METHOD_DESTROY 4
|
||||
#define PW_CORE_PROXY_METHOD_NUM 5
|
||||
|
||||
#define PW_LINK_OUTPUT_NODE_ID "link.output_node.id"
|
||||
#define PW_LINK_OUTPUT_PORT_ID "link.output_port.id"
|
||||
|
|
@ -114,11 +113,6 @@ struct pw_core_proxy_methods {
|
|||
* \param id the client proxy id
|
||||
*/
|
||||
void (*get_registry) (void *object, uint32_t version, uint32_t new_id);
|
||||
/**
|
||||
* Update the client properties
|
||||
* \param props the new client properties
|
||||
*/
|
||||
void (*client_update) (void *object, const struct spa_dict *props);
|
||||
/**
|
||||
* Create a new object on the PipeWire server from a factory.
|
||||
* Use a \a factory_name of "client-node" to create a
|
||||
|
|
@ -166,12 +160,6 @@ pw_core_proxy_get_registry(struct pw_core_proxy *core, uint32_t type, uint32_t v
|
|||
return (struct pw_registry_proxy *) p;
|
||||
}
|
||||
|
||||
static inline void
|
||||
pw_core_proxy_client_update(struct pw_core_proxy *core, const struct spa_dict *props)
|
||||
{
|
||||
pw_proxy_do((struct pw_proxy*)core, struct pw_core_proxy_methods, client_update, props);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
pw_core_proxy_create_object(struct pw_core_proxy *core,
|
||||
const char *factory_name,
|
||||
|
|
|
|||
|
|
@ -313,8 +313,8 @@ int pw_remote_update_properties(struct pw_remote *remote, const struct spa_dict
|
|||
if (!changed)
|
||||
return 0;
|
||||
|
||||
if (remote->core_proxy)
|
||||
pw_core_proxy_client_update(remote->core_proxy, &remote->properties->dict);
|
||||
if (remote->client_proxy)
|
||||
pw_client_proxy_update_properties(remote->client_proxy, &remote->properties->dict);
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
|
@ -358,7 +358,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_client_update(remote->core_proxy, &remote->properties->dict);
|
||||
pw_client_proxy_update_properties(remote->client_proxy, &remote->properties->dict);
|
||||
pw_core_proxy_hello(remote->core_proxy, PW_VERSION_CORE);
|
||||
pw_remote_update_state(remote, PW_REMOTE_STATE_CONNECTED, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue