mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	track client resources
This commit is contained in:
		
							parent
							
								
									0d21d633c9
								
							
						
					
					
						commit
						b6ad45bb74
					
				
					 14 changed files with 253 additions and 92 deletions
				
			
		| 
						 | 
					@ -1274,7 +1274,6 @@ proxy_clear (SpaProxy *this)
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * pinos_client_node_new:
 | 
					 * pinos_client_node_new:
 | 
				
			||||||
 * @daemon: a #PinosDaemon
 | 
					 * @daemon: a #PinosDaemon
 | 
				
			||||||
 * @client: the client owner
 | 
					 | 
				
			||||||
 * @name: a name
 | 
					 * @name: a name
 | 
				
			||||||
 * @properties: extra properties
 | 
					 * @properties: extra properties
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
| 
						 | 
					@ -1284,7 +1283,6 @@ proxy_clear (SpaProxy *this)
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
PinosClientNode *
 | 
					PinosClientNode *
 | 
				
			||||||
pinos_client_node_new (PinosCore       *core,
 | 
					pinos_client_node_new (PinosCore       *core,
 | 
				
			||||||
                       PinosClient     *client,
 | 
					 | 
				
			||||||
                       const gchar     *name,
 | 
					                       const gchar     *name,
 | 
				
			||||||
                       PinosProperties *properties)
 | 
					                       PinosProperties *properties)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -1323,16 +1321,15 @@ pinos_client_node_new (PinosCore       *core,
 | 
				
			||||||
  return this;
 | 
					  return this;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
pinos_client_node_destroy (PinosClientNode * this)
 | 
					on_node_remove (PinosNode *node,
 | 
				
			||||||
 | 
					                gpointer   data,
 | 
				
			||||||
 | 
					                SpaResult  res)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  PinosClientNode *this = data;
 | 
				
			||||||
  PinosClientNodeImpl *impl = SPA_CONTAINER_OF (this, PinosClientNodeImpl, this);
 | 
					  PinosClientNodeImpl *impl = SPA_CONTAINER_OF (this, PinosClientNodeImpl, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_log_debug ("client-node %p: destroy", impl);
 | 
					  pinos_log_debug ("client-node %p: finalize", node);
 | 
				
			||||||
  pinos_signal_emit (&this->destroy_signal, this);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  pinos_node_destroy (this->node);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  proxy_clear (&impl->proxy);
 | 
					  proxy_clear (&impl->proxy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (impl->ctrl_fd != -1)
 | 
					  if (impl->ctrl_fd != -1)
 | 
				
			||||||
| 
						 | 
					@ -1342,6 +1339,27 @@ pinos_client_node_destroy (PinosClientNode * this)
 | 
				
			||||||
  free (impl);
 | 
					  free (impl);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SpaResult
 | 
				
			||||||
 | 
					pinos_client_node_destroy (PinosClientNode * this)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  PinosClientNodeImpl *impl = SPA_CONTAINER_OF (this, PinosClientNodeImpl, this);
 | 
				
			||||||
 | 
					  SpaResult res;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  pinos_log_debug ("client-node %p: destroy", impl);
 | 
				
			||||||
 | 
					  pinos_signal_emit (&this->destroy_signal, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  res = pinos_node_destroy (this->node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  pinos_main_loop_defer (this->node->core->main_loop,
 | 
				
			||||||
 | 
					                         this->node,
 | 
				
			||||||
 | 
					                         res,
 | 
				
			||||||
 | 
					                         (PinosDeferFunc) on_node_remove,
 | 
				
			||||||
 | 
					                         this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return res;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * pinos_client_node_get_ctrl_socket:
 | 
					 * pinos_client_node_get_ctrl_socket:
 | 
				
			||||||
 * @node: a #PinosClientNode
 | 
					 * @node: a #PinosClientNode
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,6 +26,9 @@
 | 
				
			||||||
extern "C" {
 | 
					extern "C" {
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define PINOS_CLIENT_NODE_URI                            "http://pinos.org/ns/client-node"
 | 
				
			||||||
 | 
					#define PINOS_CLIENT_NODE_PREFIX                         PINOS_CLIENT_NODE_URI "#"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct _PinosClientNode PinosClientNode;
 | 
					typedef struct _PinosClientNode PinosClientNode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					@ -41,10 +44,9 @@ struct _PinosClientNode {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PinosClientNode *  pinos_client_node_new              (PinosCore       *core,
 | 
					PinosClientNode *  pinos_client_node_new              (PinosCore       *core,
 | 
				
			||||||
                                                       PinosClient     *client,
 | 
					 | 
				
			||||||
                                                       const gchar     *name,
 | 
					                                                       const gchar     *name,
 | 
				
			||||||
                                                       PinosProperties *properties);
 | 
					                                                       PinosProperties *properties);
 | 
				
			||||||
void               pinos_client_node_destroy          (PinosClientNode *node);
 | 
					SpaResult          pinos_client_node_destroy          (PinosClientNode *node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SpaResult          pinos_client_node_get_ctrl_socket  (PinosClientNode *node, int *fd);
 | 
					SpaResult          pinos_client_node_get_ctrl_socket  (PinosClientNode *node, int *fd);
 | 
				
			||||||
SpaResult          pinos_client_node_get_data_socket  (PinosClientNode *node, int *fd);
 | 
					SpaResult          pinos_client_node_get_data_socket  (PinosClientNode *node, int *fd);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,6 @@ typedef struct
 | 
				
			||||||
  guint id;
 | 
					  guint id;
 | 
				
			||||||
  PinosClient1 *iface;
 | 
					  PinosClient1 *iface;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  GList *objects;
 | 
					 | 
				
			||||||
} PinosClientImpl;
 | 
					} PinosClientImpl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					@ -86,44 +85,50 @@ client_watch_name (PinosClient *this)
 | 
				
			||||||
                                             (GDestroyNotify) pinos_client_destroy);
 | 
					                                             (GDestroyNotify) pinos_client_destroy);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					PinosResource *
 | 
				
			||||||
pinos_client_add_object (PinosClient *client,
 | 
					pinos_client_add_resource (PinosClient *client,
 | 
				
			||||||
                         PinosObject *object)
 | 
					                           uint32_t     type,
 | 
				
			||||||
 | 
					                           void        *object,
 | 
				
			||||||
 | 
					                           PinosDestroy destroy)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  PinosClientImpl *impl = SPA_CONTAINER_OF (client, PinosClientImpl, this);
 | 
					  PinosResource *resource;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  g_return_if_fail (client);
 | 
					  resource = calloc (1, sizeof (PinosResource));
 | 
				
			||||||
  g_return_if_fail (object);
 | 
					  resource->core = client->core;
 | 
				
			||||||
 | 
					  resource->id = 0;
 | 
				
			||||||
 | 
					  resource->type = type;
 | 
				
			||||||
 | 
					  resource->object = object;
 | 
				
			||||||
 | 
					  resource->destroy = destroy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  impl->objects = g_list_prepend (impl->objects, object);
 | 
					  pinos_signal_init (&resource->destroy_signal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  pinos_log_debug ("client %p: add resource %p", client, resource);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  spa_list_insert (client->resource_list.prev, &resource->link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return resource;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
pinos_client_remove_object (PinosClient *client,
 | 
					pinos_client_remove_resource (PinosClient   *client,
 | 
				
			||||||
                            PinosObject *object)
 | 
					                              PinosResource *resource)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  PinosClientImpl *impl = SPA_CONTAINER_OF (client, PinosClientImpl, this);
 | 
					  pinos_log_debug ("client %p: resource %p destroy", client, resource);
 | 
				
			||||||
 | 
					  pinos_signal_emit (&resource->destroy_signal, resource);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  g_return_if_fail (client);
 | 
					  spa_list_remove (&resource->link);
 | 
				
			||||||
  g_return_if_fail (object);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  impl->objects = g_list_remove (impl->objects, object);
 | 
					  if (resource->destroy)
 | 
				
			||||||
  pinos_object_destroy (object);
 | 
					    resource->destroy (resource->object);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  free (resource);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
pinos_client_has_object (PinosClient *client,
 | 
					pinos_client_has_resource (PinosClient   *client,
 | 
				
			||||||
                         PinosObject *object)
 | 
					                           PinosResource *resource)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  PinosClientImpl *impl = SPA_CONTAINER_OF (client, PinosClientImpl, this);
 | 
					  return false;
 | 
				
			||||||
  GList *found;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  g_return_val_if_fail (client, false);
 | 
					 | 
				
			||||||
  g_return_val_if_fail (object, false);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  found = g_list_find (impl->objects, object);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return found != NULL;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					@ -153,6 +158,7 @@ pinos_client_new (PinosCore       *core,
 | 
				
			||||||
  this->sender = strdup (sender);
 | 
					  this->sender = strdup (sender);
 | 
				
			||||||
  this->properties = properties;
 | 
					  this->properties = properties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  spa_list_init (&this->resource_list);
 | 
				
			||||||
  pinos_signal_init (&this->destroy_signal);
 | 
					  pinos_signal_init (&this->destroy_signal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  impl->iface = pinos_client1_skeleton_new ();
 | 
					  impl->iface = pinos_client1_skeleton_new ();
 | 
				
			||||||
| 
						 | 
					@ -170,20 +176,19 @@ pinos_client_new (PinosCore       *core,
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Trigger removal of @client
 | 
					 * Trigger removal of @client
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void
 | 
					SpaResult
 | 
				
			||||||
pinos_client_destroy (PinosClient * client)
 | 
					pinos_client_destroy (PinosClient * client)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  PinosClientImpl *impl = SPA_CONTAINER_OF (client, PinosClientImpl, this);
 | 
					  PinosClientImpl *impl = SPA_CONTAINER_OF (client, PinosClientImpl, this);
 | 
				
			||||||
  GList *copy;
 | 
					  PinosResource *resource, *tmp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_log_debug ("client %p: destroy", client);
 | 
					  pinos_log_debug ("client %p: destroy", client);
 | 
				
			||||||
  pinos_signal_emit (&client->destroy_signal, client);
 | 
					  pinos_signal_emit (&client->destroy_signal, client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  spa_list_remove (&client->list);
 | 
					  spa_list_for_each_safe (resource, tmp, &client->resource_list, link)
 | 
				
			||||||
 | 
					    pinos_client_remove_resource (client, resource);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  copy = g_list_copy (impl->objects);
 | 
					  spa_list_remove (&client->list);
 | 
				
			||||||
  g_list_free_full (copy, NULL);
 | 
					 | 
				
			||||||
  g_list_free (impl->objects);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  free (client->sender);
 | 
					  free (client->sender);
 | 
				
			||||||
  if (client->properties)
 | 
					  if (client->properties)
 | 
				
			||||||
| 
						 | 
					@ -191,4 +196,6 @@ pinos_client_destroy (PinosClient * client)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  g_clear_object (&impl->iface);
 | 
					  g_clear_object (&impl->iface);
 | 
				
			||||||
  free (impl);
 | 
					  free (impl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return SPA_RESULT_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,10 +28,25 @@ extern "C" {
 | 
				
			||||||
#define PINOS_CLIENT_PREFIX                         PINOS_CLIENT_URI "#"
 | 
					#define PINOS_CLIENT_PREFIX                         PINOS_CLIENT_URI "#"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct _PinosClient PinosClient;
 | 
					typedef struct _PinosClient PinosClient;
 | 
				
			||||||
 | 
					typedef struct _PinosResource PinosResource;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef void  (*PinosDestroy)  (void *object);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <pinos/client/object.h>
 | 
					#include <pinos/client/object.h>
 | 
				
			||||||
#include <pinos/server/daemon.h>
 | 
					#include <pinos/server/daemon.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct _PinosResource {
 | 
				
			||||||
 | 
					  PinosCore    *core;
 | 
				
			||||||
 | 
					  SpaList       link;
 | 
				
			||||||
 | 
					  uint32_t      id;
 | 
				
			||||||
 | 
					  uint32_t      type;
 | 
				
			||||||
 | 
					  void         *object;
 | 
				
			||||||
 | 
					  PinosDestroy  destroy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
 | 
				
			||||||
 | 
					                                 PinosResource *resource));
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * PinosClient:
 | 
					 * PinosClient:
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
| 
						 | 
					@ -45,6 +60,8 @@ struct _PinosClient {
 | 
				
			||||||
  char *sender;
 | 
					  char *sender;
 | 
				
			||||||
  PinosProperties *properties;
 | 
					  PinosProperties *properties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  SpaList resource_list;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
 | 
					  PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
 | 
				
			||||||
                                 PinosClient *client));
 | 
					                                 PinosClient *client));
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -52,15 +69,18 @@ struct _PinosClient {
 | 
				
			||||||
PinosClient *   pinos_client_new                  (PinosCore       *core,
 | 
					PinosClient *   pinos_client_new                  (PinosCore       *core,
 | 
				
			||||||
                                                   const gchar     *sender,
 | 
					                                                   const gchar     *sender,
 | 
				
			||||||
                                                   PinosProperties *properties);
 | 
					                                                   PinosProperties *properties);
 | 
				
			||||||
void            pinos_client_destroy              (PinosClient     *client);
 | 
					SpaResult       pinos_client_destroy              (PinosClient     *client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void   pinos_client_add_object          (PinosClient *client,
 | 
					PinosResource * pinos_client_add_resource         (PinosClient  *client,
 | 
				
			||||||
                                         PinosObject *object);
 | 
					                                                   uint32_t      type,
 | 
				
			||||||
void   pinos_client_remove_object       (PinosClient *client,
 | 
					                                                   void         *object,
 | 
				
			||||||
                                         PinosObject *object);
 | 
					                                                   PinosDestroy  destroy);
 | 
				
			||||||
bool   pinos_client_has_object          (PinosClient *client,
 | 
					
 | 
				
			||||||
                                         PinosObject *object);
 | 
					void            pinos_client_remove_resource      (PinosClient   *client,
 | 
				
			||||||
 | 
					                                                   PinosResource *resource);
 | 
				
			||||||
 | 
					bool            pinos_client_has_resource         (PinosClient   *client,
 | 
				
			||||||
 | 
					                                                   PinosResource *resource);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __cplusplus
 | 
					#ifdef __cplusplus
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,7 +98,9 @@ pinos_core_add_global (PinosCore           *core,
 | 
				
			||||||
  global->object = object;
 | 
					  global->object = object;
 | 
				
			||||||
  global->skel = skel;
 | 
					  global->skel = skel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  spa_list_insert (core->global_list.prev, &global->list);
 | 
					  pinos_signal_init (&global->destroy_signal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  spa_list_insert (core->global_list.prev, &global->link);
 | 
				
			||||||
  pinos_signal_emit (&core->global_added, core, global);
 | 
					  pinos_signal_emit (&core->global_added, core, global);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return global;
 | 
					  return global;
 | 
				
			||||||
| 
						 | 
					@ -108,8 +110,10 @@ void
 | 
				
			||||||
pinos_core_remove_global (PinosCore      *core,
 | 
					pinos_core_remove_global (PinosCore      *core,
 | 
				
			||||||
                          PinosGlobal    *global)
 | 
					                          PinosGlobal    *global)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  pinos_signal_emit (&global->destroy_signal, global);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  spa_list_remove (&global->link);
 | 
				
			||||||
  pinos_signal_emit (&core->global_removed, core, global);
 | 
					  pinos_signal_emit (&core->global_removed, core, global);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  spa_list_remove (&global->list);
 | 
					 | 
				
			||||||
  free (global);
 | 
					  free (global);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,11 +40,14 @@ typedef struct _PinosGlobal PinosGlobal;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct _PinosGlobal {
 | 
					struct _PinosGlobal {
 | 
				
			||||||
  PinosCore *core;
 | 
					  PinosCore *core;
 | 
				
			||||||
  SpaList    list;
 | 
					  SpaList    link;
 | 
				
			||||||
  uint32_t   id;
 | 
					  uint32_t   id;
 | 
				
			||||||
  uint32_t   type;
 | 
					  uint32_t   type;
 | 
				
			||||||
  void      *object;
 | 
					  void      *object;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
 | 
				
			||||||
 | 
					                                 PinosGlobal   *global));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  PinosObjectSkeleton *skel;
 | 
					  PinosObjectSkeleton *skel;
 | 
				
			||||||
  const char          *object_path;
 | 
					  const char          *object_path;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -74,7 +77,6 @@ struct _PinosCore {
 | 
				
			||||||
  PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
 | 
					  PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
 | 
				
			||||||
                                 PinosCore     *core));
 | 
					                                 PinosCore     *core));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  PINOS_SIGNAL (global_added,  (PinosListener *listener,
 | 
					  PINOS_SIGNAL (global_added,  (PinosListener *listener,
 | 
				
			||||||
                                PinosCore     *core,
 | 
					                                PinosCore     *core,
 | 
				
			||||||
                                PinosGlobal   *global));
 | 
					                                PinosGlobal   *global));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -343,7 +343,6 @@ handle_create_client_node (PinosDaemon1           *interface,
 | 
				
			||||||
  props = pinos_properties_from_variant (arg_properties);
 | 
					  props = pinos_properties_from_variant (arg_properties);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  node = pinos_client_node_new (this->core,
 | 
					  node = pinos_client_node_new (this->core,
 | 
				
			||||||
                                client,
 | 
					 | 
				
			||||||
                                arg_name,
 | 
					                                arg_name,
 | 
				
			||||||
                                props);
 | 
					                                props);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -353,7 +352,10 @@ handle_create_client_node (PinosDaemon1           *interface,
 | 
				
			||||||
  if ((res = pinos_client_node_get_data_socket (node, &data_fd)) < 0)
 | 
					  if ((res = pinos_client_node_get_data_socket (node, &data_fd)) < 0)
 | 
				
			||||||
    goto no_socket;
 | 
					    goto no_socket;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //pinos_client_add_object (client, &node->object);
 | 
					  pinos_client_add_resource (client,
 | 
				
			||||||
 | 
					                             this->core->registry.uri.client_node,
 | 
				
			||||||
 | 
					                             node,
 | 
				
			||||||
 | 
					                             (PinosDestroy) pinos_client_node_destroy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  object_path = node->node->global->object_path;
 | 
					  object_path = node->node->global->object_path;
 | 
				
			||||||
  pinos_log_debug ("daemon %p: add client-node %p, %s", impl, node, object_path);
 | 
					  pinos_log_debug ("daemon %p: add client-node %p, %s", impl, node, object_path);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,6 +42,8 @@ typedef struct
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  PinosLink1 *iface;
 | 
					  PinosLink1 *iface;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  uint32_t seq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SpaFormat **format_filter;
 | 
					  SpaFormat **format_filter;
 | 
				
			||||||
  PinosProperties *properties;
 | 
					  PinosProperties *properties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -622,8 +624,11 @@ on_port_unlinked (PinosPort *port, PinosLink *this, SpaResult res, gulong id)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  pinos_signal_emit (&this->core->port_unlinked, this, port);
 | 
					  pinos_signal_emit (&this->core->port_unlinked, this, port);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (this->input == NULL || this->output == NULL)
 | 
					  if (this->input == NULL || this->output == NULL) {
 | 
				
			||||||
    pinos_link_update_state (this, PINOS_LINK_STATE_UNLINKED);
 | 
					    pinos_link_update_state (this, PINOS_LINK_STATE_UNLINKED);
 | 
				
			||||||
 | 
					    pinos_link_destroy (this);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					@ -636,10 +641,14 @@ on_port_destroy (PinosLink *this,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (port == this->input) {
 | 
					  if (port == this->input) {
 | 
				
			||||||
    pinos_log_debug ("link %p: input port destroyed %p", this, port);
 | 
					    pinos_log_debug ("link %p: input port destroyed %p", this, port);
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->input_port_destroy);
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->input_async_complete);
 | 
				
			||||||
    this->input = NULL;
 | 
					    this->input = NULL;
 | 
				
			||||||
    other = this->output;
 | 
					    other = this->output;
 | 
				
			||||||
  } else if (port == this->output) {
 | 
					  } else if (port == this->output) {
 | 
				
			||||||
    pinos_log_debug ("link %p: output port destroyed %p", this, port);
 | 
					    pinos_log_debug ("link %p: output port destroyed %p", this, port);
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->output_port_destroy);
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->output_async_complete);
 | 
				
			||||||
    this->output = NULL;
 | 
					    this->output = NULL;
 | 
				
			||||||
    other = this->input;
 | 
					    other = this->input;
 | 
				
			||||||
  } else
 | 
					  } else
 | 
				
			||||||
| 
						 | 
					@ -667,7 +676,6 @@ on_input_port_destroy (PinosListener *listener,
 | 
				
			||||||
  PinosLinkImpl *impl = SPA_CONTAINER_OF (listener, PinosLinkImpl, input_port_destroy);
 | 
					  PinosLinkImpl *impl = SPA_CONTAINER_OF (listener, PinosLinkImpl, input_port_destroy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  on_port_destroy (&impl->this, port);
 | 
					  on_port_destroy (&impl->this, port);
 | 
				
			||||||
  pinos_signal_remove (listener);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					@ -725,14 +733,14 @@ pinos_link_new (PinosCore       *core,
 | 
				
			||||||
                    &impl->input_port_destroy,
 | 
					                    &impl->input_port_destroy,
 | 
				
			||||||
                    on_input_port_destroy);
 | 
					                    on_input_port_destroy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_signal_add (&this->output->destroy_signal,
 | 
					 | 
				
			||||||
                    &impl->output_port_destroy,
 | 
					 | 
				
			||||||
                    on_output_port_destroy);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  pinos_signal_add (&this->input->node->async_complete,
 | 
					  pinos_signal_add (&this->input->node->async_complete,
 | 
				
			||||||
                    &impl->input_async_complete,
 | 
					                    &impl->input_async_complete,
 | 
				
			||||||
                    on_input_async_complete_notify);
 | 
					                    on_input_async_complete_notify);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  pinos_signal_add (&this->output->destroy_signal,
 | 
				
			||||||
 | 
					                    &impl->output_port_destroy,
 | 
				
			||||||
 | 
					                    on_output_port_destroy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_signal_add (&this->output->node->async_complete,
 | 
					  pinos_signal_add (&this->output->node->async_complete,
 | 
				
			||||||
                    &impl->output_async_complete,
 | 
					                    &impl->output_async_complete,
 | 
				
			||||||
                    on_output_async_complete_notify);
 | 
					                    on_output_async_complete_notify);
 | 
				
			||||||
| 
						 | 
					@ -754,38 +762,134 @@ pinos_link_new (PinosCore       *core,
 | 
				
			||||||
  return this;
 | 
					  return this;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					static void
 | 
				
			||||||
 * pinos_link_destroy:
 | 
					clear_port_buffers (PinosLink *link, PinosPort *port)
 | 
				
			||||||
 * @link: a #PinosLink
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * Trigger removal of @link
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
void
 | 
					 | 
				
			||||||
pinos_link_destroy (PinosLink * this)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  if (!port->allocated) {
 | 
				
			||||||
 | 
					    pinos_log_debug ("link %p: clear buffers on port %p", link, port);
 | 
				
			||||||
 | 
					    spa_node_port_use_buffers (port->node->node,
 | 
				
			||||||
 | 
					                               port->direction,
 | 
				
			||||||
 | 
					                               port->port_id,
 | 
				
			||||||
 | 
					                               NULL, 0);
 | 
				
			||||||
 | 
					    port->buffers = NULL;
 | 
				
			||||||
 | 
					    port->n_buffers = 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static SpaResult
 | 
				
			||||||
 | 
					do_link_remove_done (SpaPoll        *poll,
 | 
				
			||||||
 | 
					                     bool            async,
 | 
				
			||||||
 | 
					                     uint32_t        seq,
 | 
				
			||||||
 | 
					                     size_t          size,
 | 
				
			||||||
 | 
					                     void           *data,
 | 
				
			||||||
 | 
					                     void           *user_data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  PinosLink *this = user_data;
 | 
				
			||||||
  PinosLinkImpl *impl = SPA_CONTAINER_OF (this, PinosLinkImpl, this);
 | 
					  PinosLinkImpl *impl = SPA_CONTAINER_OF (this, PinosLinkImpl, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_log_debug ("link %p: destroy", impl);
 | 
					 | 
				
			||||||
  pinos_signal_emit (&this->destroy_signal, this);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (this->input) {
 | 
					  if (this->input) {
 | 
				
			||||||
    pinos_signal_remove (&impl->input_port_destroy);
 | 
					    spa_list_remove (&this->input_link);
 | 
				
			||||||
    pinos_signal_remove (&impl->input_async_complete);
 | 
					    this->input->node->n_used_input_links--;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (this->input->node->n_used_input_links == 0 &&
 | 
				
			||||||
 | 
					        this->input->node->n_used_output_links == 0)
 | 
				
			||||||
 | 
					      pinos_node_report_idle (this->input->node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    clear_port_buffers (this, this->input);
 | 
				
			||||||
 | 
					    this->input = NULL;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if (this->output) {
 | 
					  if (this->output) {
 | 
				
			||||||
    pinos_signal_remove (&impl->output_port_destroy);
 | 
					    spa_list_remove (&this->output_link);
 | 
				
			||||||
    pinos_signal_remove (&impl->output_async_complete);
 | 
					    this->output->node->n_used_output_links--;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (this->output->node->n_used_input_links == 0 &&
 | 
				
			||||||
 | 
					        this->output->node->n_used_output_links == 0)
 | 
				
			||||||
 | 
					      pinos_node_report_idle (this->output->node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    clear_port_buffers (this, this->output);
 | 
				
			||||||
 | 
					    this->output = NULL;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_main_loop_defer_cancel (this->core->main_loop, this, 0);
 | 
					  pinos_main_loop_defer_cancel (this->core->main_loop, this, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_core_remove_global (this->core, this->global);
 | 
					 | 
				
			||||||
  spa_list_remove (&this->list);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  g_clear_object (&impl->iface);
 | 
					  g_clear_object (&impl->iface);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (impl->allocated)
 | 
					  if (impl->allocated)
 | 
				
			||||||
    pinos_memblock_free (&impl->buffer_mem);
 | 
					    pinos_memblock_free (&impl->buffer_mem);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  free (impl);
 | 
					  free (impl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return SPA_RESULT_OK;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static SpaResult
 | 
				
			||||||
 | 
					do_link_remove (SpaPoll        *poll,
 | 
				
			||||||
 | 
					                bool            async,
 | 
				
			||||||
 | 
					                uint32_t        seq,
 | 
				
			||||||
 | 
					                size_t          size,
 | 
				
			||||||
 | 
					                void           *data,
 | 
				
			||||||
 | 
					                void           *user_data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  SpaResult res;
 | 
				
			||||||
 | 
					  PinosLink *this = user_data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (this->rt.input) {
 | 
				
			||||||
 | 
					    spa_list_remove (&this->rt.input_link);
 | 
				
			||||||
 | 
					    this->rt.input = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  if (this->rt.output) {
 | 
				
			||||||
 | 
					    spa_list_remove (&this->rt.output_link);
 | 
				
			||||||
 | 
					    this->rt.output = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  res = spa_poll_invoke (this->core->main_loop->poll,
 | 
				
			||||||
 | 
					                         do_link_remove_done,
 | 
				
			||||||
 | 
					                         seq,
 | 
				
			||||||
 | 
					                         0,
 | 
				
			||||||
 | 
					                         NULL,
 | 
				
			||||||
 | 
					                         this);
 | 
				
			||||||
 | 
					  return res;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * pinos_link_destroy:
 | 
				
			||||||
 | 
					 * @link: a #PinosLink
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Trigger removal of @link
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					SpaResult
 | 
				
			||||||
 | 
					pinos_link_destroy (PinosLink * this)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  SpaResult res = SPA_RESULT_OK;
 | 
				
			||||||
 | 
					  PinosLinkImpl *impl = SPA_CONTAINER_OF (this, PinosLinkImpl, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  pinos_log_debug ("link %p: destroy", impl);
 | 
				
			||||||
 | 
					  pinos_signal_emit (&this->destroy_signal, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  pinos_core_remove_global (this->core, this->global);
 | 
				
			||||||
 | 
					  spa_list_remove (&this->list);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (this->input) {
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->input_port_destroy);
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->input_async_complete);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    res = spa_poll_invoke (&this->input->node->data_loop->poll,
 | 
				
			||||||
 | 
					                           do_link_remove,
 | 
				
			||||||
 | 
					                           impl->seq++,
 | 
				
			||||||
 | 
					                           0,
 | 
				
			||||||
 | 
					                           NULL,
 | 
				
			||||||
 | 
					                           this);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  if (this->output) {
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->output_port_destroy);
 | 
				
			||||||
 | 
					    pinos_signal_remove (&impl->output_async_complete);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    res = spa_poll_invoke (&this->output->node->data_loop->poll,
 | 
				
			||||||
 | 
					                           do_link_remove,
 | 
				
			||||||
 | 
					                           impl->seq++,
 | 
				
			||||||
 | 
					                           0,
 | 
				
			||||||
 | 
					                           NULL,
 | 
				
			||||||
 | 
					                           this);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return res;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -79,7 +79,7 @@ PinosLink *     pinos_link_new          (PinosCore       *core,
 | 
				
			||||||
                                         PinosPort       *input,
 | 
					                                         PinosPort       *input,
 | 
				
			||||||
                                         SpaFormat      **format_filter,
 | 
					                                         SpaFormat      **format_filter,
 | 
				
			||||||
                                         PinosProperties *properties);
 | 
					                                         PinosProperties *properties);
 | 
				
			||||||
void            pinos_link_destroy      (PinosLink       *link);
 | 
					SpaResult       pinos_link_destroy      (PinosLink       *link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool            pinos_link_activate     (PinosLink *link);
 | 
					bool            pinos_link_activate     (PinosLink *link);
 | 
				
			||||||
bool            pinos_link_deactivate   (PinosLink *link);
 | 
					bool            pinos_link_deactivate   (PinosLink *link);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -225,9 +225,7 @@ process_work_queue (PinosMainLoop *this)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  impl->work_id = 0;
 | 
					  impl->work_id = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_log_debug ("main-loop %p: %p %p", this, impl->work_list.next, &impl->work_list);
 | 
					 | 
				
			||||||
  spa_list_for_each_safe (item, tmp, &impl->work_list, link) {
 | 
					  spa_list_for_each_safe (item, tmp, &impl->work_list, link) {
 | 
				
			||||||
    pinos_log_debug ("main-loop %p: %p %p %d %p", this, &item->link, impl->work_list.next, item->sync, item->obj);
 | 
					 | 
				
			||||||
    if (item->sync) {
 | 
					    if (item->sync) {
 | 
				
			||||||
      if (&item->link == impl->work_list.next) {
 | 
					      if (&item->link == impl->work_list.next) {
 | 
				
			||||||
        pinos_log_debug ("main-loop %p: found sync item %p", this, item->obj);
 | 
					        pinos_log_debug ("main-loop %p: found sync item %p", this, item->obj);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -399,7 +399,6 @@ handle_remove (PinosNode1             *interface,
 | 
				
			||||||
  PinosNode *this = user_data;
 | 
					  PinosNode *this = user_data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_log_debug ("node %p: remove", this);
 | 
					  pinos_log_debug ("node %p: remove", this);
 | 
				
			||||||
  pinos_node_destroy (this);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  g_dbus_method_invocation_return_value (invocation,
 | 
					  g_dbus_method_invocation_return_value (invocation,
 | 
				
			||||||
                                         g_variant_new ("()"));
 | 
					                                         g_variant_new ("()"));
 | 
				
			||||||
| 
						 | 
					@ -585,9 +584,10 @@ do_node_remove (SpaPoll        *poll,
 | 
				
			||||||
 * Remove @node. This will stop the transfer on the node and
 | 
					 * Remove @node. This will stop the transfer on the node and
 | 
				
			||||||
 * free the resources allocated by @node.
 | 
					 * free the resources allocated by @node.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void
 | 
					SpaResult
 | 
				
			||||||
pinos_node_destroy (PinosNode * this)
 | 
					pinos_node_destroy (PinosNode * this)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  SpaResult res;
 | 
				
			||||||
  PinosNodeImpl *impl = SPA_CONTAINER_OF (this, PinosNodeImpl, this);
 | 
					  PinosNodeImpl *impl = SPA_CONTAINER_OF (this, PinosNodeImpl, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_log_debug ("node %p: destroy", impl);
 | 
					  pinos_log_debug ("node %p: destroy", impl);
 | 
				
			||||||
| 
						 | 
					@ -596,12 +596,13 @@ pinos_node_destroy (PinosNode * this)
 | 
				
			||||||
  spa_list_remove (&this->list);
 | 
					  spa_list_remove (&this->list);
 | 
				
			||||||
  pinos_core_remove_global (this->core, this->global);
 | 
					  pinos_core_remove_global (this->core, this->global);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  spa_poll_invoke (&this->data_loop->poll,
 | 
					  res = spa_poll_invoke (&this->data_loop->poll,
 | 
				
			||||||
                         do_node_remove,
 | 
					                         do_node_remove,
 | 
				
			||||||
                         impl->seq++,
 | 
					                         impl->seq++,
 | 
				
			||||||
                         0,
 | 
					                         0,
 | 
				
			||||||
                         NULL,
 | 
					                         NULL,
 | 
				
			||||||
                         this);
 | 
					                         this);
 | 
				
			||||||
 | 
					  return res;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -95,7 +95,7 @@ PinosNode *         pinos_node_new                     (PinosCore       *core,
 | 
				
			||||||
                                                        SpaNode         *node,
 | 
					                                                        SpaNode         *node,
 | 
				
			||||||
                                                        SpaClock        *clock,
 | 
					                                                        SpaClock        *clock,
 | 
				
			||||||
                                                        PinosProperties *properties);
 | 
					                                                        PinosProperties *properties);
 | 
				
			||||||
void                pinos_node_destroy                 (PinosNode       *node);
 | 
					SpaResult           pinos_node_destroy                 (PinosNode       *node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void                pinos_node_set_data_loop           (PinosNode        *node,
 | 
					void                pinos_node_set_data_loop           (PinosNode        *node,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,6 +26,7 @@
 | 
				
			||||||
#include "pinos/server/node.h"
 | 
					#include "pinos/server/node.h"
 | 
				
			||||||
#include "pinos/server/node-factory.h"
 | 
					#include "pinos/server/node-factory.h"
 | 
				
			||||||
#include "pinos/server/client.h"
 | 
					#include "pinos/server/client.h"
 | 
				
			||||||
 | 
					#include "pinos/server/client-node.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "spa/include/spa/monitor.h"
 | 
					#include "spa/include/spa/monitor.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,6 +41,7 @@ pinos_registry_init (PinosRegistry *reg)
 | 
				
			||||||
  reg->uri.node_factory = spa_id_map_get_id (reg->map, PINOS_NODE_FACTORY_URI);
 | 
					  reg->uri.node_factory = spa_id_map_get_id (reg->map, PINOS_NODE_FACTORY_URI);
 | 
				
			||||||
  reg->uri.link = spa_id_map_get_id (reg->map, PINOS_LINK_URI);
 | 
					  reg->uri.link = spa_id_map_get_id (reg->map, PINOS_LINK_URI);
 | 
				
			||||||
  reg->uri.client = spa_id_map_get_id (reg->map, PINOS_CLIENT_URI);
 | 
					  reg->uri.client = spa_id_map_get_id (reg->map, PINOS_CLIENT_URI);
 | 
				
			||||||
 | 
					  reg->uri.client_node = spa_id_map_get_id (reg->map, PINOS_CLIENT_NODE_URI);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  reg->uri.spa_node = spa_id_map_get_id (reg->map, SPA_NODE_URI);
 | 
					  reg->uri.spa_node = spa_id_map_get_id (reg->map, SPA_NODE_URI);
 | 
				
			||||||
  reg->uri.spa_clock = spa_id_map_get_id (reg->map, SPA_CLOCK_URI);
 | 
					  reg->uri.spa_clock = spa_id_map_get_id (reg->map, SPA_CLOCK_URI);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,6 +41,7 @@ typedef struct {
 | 
				
			||||||
  uint32_t node_factory;
 | 
					  uint32_t node_factory;
 | 
				
			||||||
  uint32_t link;
 | 
					  uint32_t link;
 | 
				
			||||||
  uint32_t client;
 | 
					  uint32_t client;
 | 
				
			||||||
 | 
					  uint32_t client_node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  uint32_t spa_node;
 | 
					  uint32_t spa_node;
 | 
				
			||||||
  uint32_t spa_clock;
 | 
					  uint32_t spa_clock;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue