mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-04-23 00:40:44 +02:00
proxy: add _request_destroy() method for destroying remote objects
Useful to destroy links and endpoint-links
This commit is contained in:
parent
bd0ede2c6a
commit
3b086167ae
2 changed files with 34 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue