mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
WIP
Change object model
This commit is contained in:
parent
d0f95fc323
commit
190f01d88e
38 changed files with 1594 additions and 3562 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "pinos/client/pinos.h"
|
||||
#include "pinos/server/core.h"
|
||||
#include "pinos/server/daemon.h"
|
||||
#include "pinos/server/registry.h"
|
||||
#include "pinos/server/node.h"
|
||||
|
|
@ -33,6 +34,7 @@ pinos_registry_init (PinosRegistry *reg)
|
|||
{
|
||||
reg->map = pinos_id_map_get_default();
|
||||
|
||||
reg->uri.core = spa_id_map_get_id (reg->map, PINOS_CORE_URI);
|
||||
reg->uri.daemon = spa_id_map_get_id (reg->map, PINOS_DAEMON_URI);
|
||||
reg->uri.registry = spa_id_map_get_id (reg->map, PINOS_REGISTRY_URI);
|
||||
reg->uri.node = spa_id_map_get_id (reg->map, PINOS_NODE_URI);
|
||||
|
|
@ -50,3 +52,21 @@ pinos_registry_init (PinosRegistry *reg)
|
|||
pinos_signal_init (®->object_added);
|
||||
pinos_signal_init (®->object_removed);
|
||||
}
|
||||
|
||||
PinosObject *
|
||||
pinos_registry_iterate_objects (PinosRegistry *reg,
|
||||
uint32_t type,
|
||||
void **state)
|
||||
{
|
||||
unsigned int idx;
|
||||
PinosObject *o;
|
||||
|
||||
while (true) {
|
||||
idx = SPA_PTR_TO_INT (*state);
|
||||
*state = SPA_INT_TO_PTR (idx+1);
|
||||
o = pinos_map_lookup (®->objects, idx);
|
||||
if (o != NULL && (type == SPA_ID_INVALID || o->type == type))
|
||||
break;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue