mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
proxy/resource: add method to remove
This commit is contained in:
parent
ed9d4e5e80
commit
d5ea24ae2c
5 changed files with 19 additions and 8 deletions
|
|
@ -174,8 +174,7 @@ static int destroy_resource(void *object, void *data)
|
||||||
|
|
||||||
if (resource &&
|
if (resource &&
|
||||||
resource != client->core_resource) {
|
resource != client->core_resource) {
|
||||||
resource->removed = true;
|
pw_resource_remove(resource);
|
||||||
pw_resource_destroy(resource);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -901,7 +901,10 @@ pw_core_find_port(struct pw_core *core,
|
||||||
const struct pw_export_type *pw_core_find_export_type(struct pw_core *core, uint32_t type);
|
const struct pw_export_type *pw_core_find_export_type(struct pw_core *core, uint32_t type);
|
||||||
|
|
||||||
int pw_proxy_install_marshal(struct pw_proxy *proxy, bool implementor);
|
int pw_proxy_install_marshal(struct pw_proxy *proxy, bool implementor);
|
||||||
|
void pw_proxy_remove(struct pw_proxy *proxy);
|
||||||
|
|
||||||
int pw_resource_install_marshal(struct pw_resource *resource, bool implementor);
|
int pw_resource_install_marshal(struct pw_resource *resource, bool implementor);
|
||||||
|
void pw_resource_remove(struct pw_resource *resource);
|
||||||
|
|
||||||
int pw_core_recalc_graph(struct pw_core *core);
|
int pw_core_recalc_graph(struct pw_core *core);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,12 @@ void pw_proxy_destroy(struct pw_proxy *proxy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pw_proxy_remove(struct pw_proxy *proxy)
|
||||||
|
{
|
||||||
|
proxy->removed = true;
|
||||||
|
pw_proxy_destroy(proxy);
|
||||||
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
void pw_proxy_unref(struct pw_proxy *proxy)
|
void pw_proxy_unref(struct pw_proxy *proxy)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -139,10 +139,8 @@ static void core_event_remove_id(void *data, uint32_t id)
|
||||||
struct pw_proxy *proxy;
|
struct pw_proxy *proxy;
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: object remove %u", this, id);
|
pw_log_debug(NAME" %p: object remove %u", this, id);
|
||||||
if ((proxy = pw_map_lookup(&this->objects, id)) != NULL) {
|
if ((proxy = pw_map_lookup(&this->objects, id)) != NULL)
|
||||||
proxy->removed = true;
|
pw_proxy_remove(proxy);
|
||||||
pw_proxy_destroy(proxy);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void core_event_bound_id(void *data, uint32_t id, uint32_t global_id)
|
static void core_event_bound_id(void *data, uint32_t id, uint32_t global_id)
|
||||||
|
|
@ -425,8 +423,7 @@ do_connect(struct spa_loop *loop,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_clean_core_proxy:
|
error_clean_core_proxy:
|
||||||
((struct pw_proxy*)remote->core_proxy)->removed = true;
|
pw_proxy_remove((struct pw_proxy*)remote->core_proxy);
|
||||||
pw_proxy_destroy((struct pw_proxy*)remote->core_proxy);
|
|
||||||
error_disconnect:
|
error_disconnect:
|
||||||
pw_protocol_client_disconnect(remote->conn);
|
pw_protocol_client_disconnect(remote->conn);
|
||||||
pw_remote_update_state(remote, PW_REMOTE_STATE_ERROR, "can't connect: %s", spa_strerror(res));
|
pw_remote_update_state(remote, PW_REMOTE_STATE_ERROR, "can't connect: %s", spa_strerror(res));
|
||||||
|
|
|
||||||
|
|
@ -259,3 +259,9 @@ void pw_resource_destroy(struct pw_resource *resource)
|
||||||
|
|
||||||
free(resource);
|
free(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pw_resource_remove(struct pw_resource *resource)
|
||||||
|
{
|
||||||
|
resource->removed = true;
|
||||||
|
pw_resource_destroy(resource);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue