mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-16 07:00:00 -05:00
rt-poll: make small poll helper object
Remove the event loop code into a separate object so that we can share the same loop for multiple nodes. Some cleanups
This commit is contained in:
parent
b9409e297b
commit
7b53fa8685
11 changed files with 517 additions and 239 deletions
|
|
@ -31,6 +31,7 @@
|
|||
#include "pinos/server/client-node.h"
|
||||
#include "pinos/server/client.h"
|
||||
#include "pinos/server/link.h"
|
||||
#include "pinos/server/rt-loop.h"
|
||||
|
||||
#include "pinos/dbus/org-pinos.h"
|
||||
|
||||
|
|
@ -47,6 +48,7 @@ struct _PinosDaemonPrivate
|
|||
GList *nodes;
|
||||
|
||||
GHashTable *clients;
|
||||
PinosRTLoop *loop;
|
||||
|
||||
PinosProperties *properties;
|
||||
|
||||
|
|
@ -326,9 +328,12 @@ static void
|
|||
on_node_added (PinosDaemon *daemon, PinosNode *node)
|
||||
{
|
||||
PinosNodeState state;
|
||||
PinosDaemonPrivate *priv = daemon->priv;
|
||||
|
||||
g_debug ("daemon %p: node %p added", daemon, node);
|
||||
|
||||
g_object_set (node, "rt-loop", priv->loop, NULL);
|
||||
|
||||
g_signal_connect (node, "state-change", (GCallback) on_node_state_change, daemon);
|
||||
|
||||
state = pinos_node_get_state (node);
|
||||
|
|
@ -763,6 +768,7 @@ pinos_daemon_finalize (GObject * object)
|
|||
g_debug ("daemon %p: finalize", object);
|
||||
g_clear_object (&priv->server_manager);
|
||||
g_clear_object (&priv->iface);
|
||||
g_clear_object (&priv->loop);
|
||||
g_hash_table_unref (priv->clients);
|
||||
g_hash_table_unref (priv->node_factories);
|
||||
|
||||
|
|
@ -820,6 +826,7 @@ pinos_daemon_init (PinosDaemon * daemon)
|
|||
g_str_equal,
|
||||
g_free,
|
||||
g_object_unref);
|
||||
priv->loop = pinos_rtloop_new();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue