mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
deviceprovider: add device provider
Add device provider Clean up states Make generic object id instead of exposing GDBusProxy Add more introspection API
This commit is contained in:
parent
cbeee04809
commit
7159ea8408
14 changed files with 811 additions and 41 deletions
|
|
@ -555,6 +555,19 @@ pinos_context_connect (PinosContext *context,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
finish_client_disconnect (PinosContext *context)
|
||||
{
|
||||
PinosContextPrivate *priv = context->priv;
|
||||
|
||||
g_clear_object (&priv->client);
|
||||
g_clear_object (&priv->daemon);
|
||||
g_bus_unwatch_name(priv->id);
|
||||
priv->id = 0;
|
||||
|
||||
context_set_state (context, PINOS_CONTEXT_STATE_UNCONNECTED);
|
||||
}
|
||||
|
||||
static void
|
||||
on_client_disconnected (GObject *source_object,
|
||||
GAsyncResult *res,
|
||||
|
|
@ -575,12 +588,7 @@ on_client_disconnected (GObject *source_object,
|
|||
}
|
||||
g_variant_unref (ret);
|
||||
|
||||
g_clear_object (&priv->client);
|
||||
g_clear_object (&priv->daemon);
|
||||
g_bus_unwatch_name(priv->id);
|
||||
priv->id = 0;
|
||||
|
||||
context_set_state (context, PINOS_CONTEXT_STATE_UNCONNECTED);
|
||||
finish_client_disconnect (context);
|
||||
g_object_unref (context);
|
||||
}
|
||||
|
||||
|
|
@ -617,7 +625,11 @@ pinos_context_disconnect (PinosContext *context)
|
|||
g_return_val_if_fail (PINOS_IS_CONTEXT (context), FALSE);
|
||||
|
||||
priv = context->priv;
|
||||
g_return_val_if_fail (priv->client != NULL, FALSE);
|
||||
|
||||
if (priv->client == NULL) {
|
||||
finish_client_disconnect (context);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_main_context_invoke (priv->context,
|
||||
(GSourceFunc) do_disconnect,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue