Skip to content
Snippets Groups Projects
Commit 3b086167 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

proxy: add _request_destroy() method for destroying remote objects

Useful to destroy links and endpoint-links
parent bd0ede2c
No related branches found
No related tags found
No related merge requests found
......@@ -433,6 +433,7 @@ wp_proxy_class_init (WpProxyClass * klass)
G_TYPE_NONE, 1, G_TYPE_STRING);
}
/* private */
void
wp_proxy_destroy (WpProxy *self)
{
......@@ -445,6 +446,36 @@ wp_proxy_destroy (WpProxy *self)
pw_proxy_destroy (priv->pw_proxy);
}
/**
* wp_proxy_request_destroy:
* @self: the proxy
*
* Requests the PipeWire server to destroy the object represented by this proxy.
* If the server allows it, the object will be destroyed and the
* WpProxy::pw-proxy-destroyed signal will be emitted. If the server does
* not allow it, nothing will happen.
*
* This is mostly useful for destroying #WpLink and #WpEndpointLink objects.
*/
void
wp_proxy_request_destroy (WpProxy * self)
{
WpProxyPrivate *priv;
g_autoptr (WpCore) core = NULL;
WpRegistry *reg;
g_return_if_fail (WP_IS_PROXY (self));
priv = wp_proxy_get_instance_private (self);
core = wp_proxy_get_core (self);
if (priv->pw_proxy && core) {
reg = wp_core_get_registry (core);
pw_registry_destroy (reg->pw_registry,
pw_proxy_get_bound_id (priv->pw_proxy));
}
}
void
wp_proxy_augment (WpProxy * self,
WpProxyFeatures ft_wanted, GCancellable * cancellable,
......
......@@ -98,6 +98,9 @@ struct _WpProxyClass
void (*control_changed) (WpProxy * self, const char * id_name);
};
WP_API
void wp_proxy_request_destroy (WpProxy * self);
/* features API */
WP_API
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment