From dbb57fc58eb6b2115a50bb3f071e90a95609392a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 15 Jun 2017 18:15:13 +0200 Subject: [PATCH] Use client protocol to configure resources --- pipewire/modules/module-protocol-native.c | 10 ---------- pipewire/server/resource.c | 4 ++++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pipewire/modules/module-protocol-native.c b/pipewire/modules/module-protocol-native.c index 6b8ffbd11..5271ba6f8 100644 --- a/pipewire/modules/module-protocol-native.c +++ b/pipewire/modules/module-protocol-native.c @@ -143,15 +143,6 @@ process_messages(struct native_client *client) } } -static void -on_resource_added(struct pw_listener *listener, - struct pw_client *client, struct pw_resource *resource) -{ - resource->iface = pw_protocol_get_interface(client->protocol, - spa_type_map_get_type(client->core->type.map, resource->type), - true); -} - static void on_busy_changed(struct pw_listener *listener, struct pw_client *client) @@ -235,7 +226,6 @@ static struct native_client *client_new(struct impl *impl, int fd) spa_list_insert(impl->client_list.prev, &this->link); - pw_signal_add(&client->resource_added, &this->resource_added, on_resource_added); pw_signal_add(&client->busy_changed, &this->busy_changed, on_busy_changed); pw_global_bind(impl->core->global, client, 0, 0); diff --git a/pipewire/server/resource.c b/pipewire/server/resource.c index 84a8db0c5..c10a3cb90 100644 --- a/pipewire/server/resource.c +++ b/pipewire/server/resource.c @@ -57,6 +57,10 @@ struct pw_resource *pw_resource_new(struct pw_client *client, if (user_data_size > 0) this->user_data = SPA_MEMBER(impl, sizeof(struct impl), void); + this->iface = pw_protocol_get_interface(client->protocol, + spa_type_map_get_type(client->core->type.map, type), + true); + pw_log_debug("resource %p: new for client %p id %u", this, client, id); pw_signal_emit(&client->resource_added, client, this);