mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-14 06:59:57 -05:00
Cleanups
Hide GDBus from RTKit API Remove register node from dbus API Add signal Add object and register objects in the registry Add some preregistered types to the registry Let the daemon listen to the registry
This commit is contained in:
parent
e88a376d7c
commit
89bc235924
27 changed files with 568 additions and 462 deletions
|
|
@ -20,38 +20,69 @@
|
|||
#ifndef __PINOS_REGISTRY_H__
|
||||
#define __PINOS_REGISTRY_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define PINOS_REGISTRY_URI "http://pinos.org/ns/registry"
|
||||
#define PINOS_REGISTRY_PREFIX PINOS_REGISTRY_URI "#"
|
||||
|
||||
#include <pinos/client/map.h>
|
||||
#include <pinos/client/signal.h>
|
||||
#include <pinos/client/object.h>
|
||||
#include <spa/include/spa/id-map.h>
|
||||
|
||||
typedef struct _PinosRegistry PinosRegistry;
|
||||
|
||||
typedef struct {
|
||||
uint32_t daemon;
|
||||
uint32_t registry;
|
||||
uint32_t node;
|
||||
uint32_t port;
|
||||
uint32_t link;
|
||||
uint32_t node_factory;
|
||||
uint32_t client;
|
||||
uint32_t spa_node;
|
||||
uint32_t spa_clock;
|
||||
uint32_t spa_monitor;
|
||||
} PinosURI;
|
||||
|
||||
/**
|
||||
* PinosRegistry:
|
||||
*
|
||||
* Pinos registry struct.
|
||||
*/
|
||||
struct _PinosRegistry {
|
||||
SpaIDMap *map;
|
||||
PinosObject object;
|
||||
|
||||
SpaIDMap *map;
|
||||
PinosURI uri;
|
||||
PinosMap objects;
|
||||
|
||||
PinosMap clients;
|
||||
PinosMap node_factories;
|
||||
PinosMap nodes;
|
||||
PinosMap ports;
|
||||
PinosMap links;
|
||||
PinosMap modules;
|
||||
PinosMap monitors;
|
||||
PinosMap devices;
|
||||
PinosSignal object_added;
|
||||
PinosSignal object_removed;
|
||||
};
|
||||
|
||||
void pinos_registry_init (PinosRegistry *reg);
|
||||
|
||||
void pinos_registry_init (PinosRegistry *reg);
|
||||
static inline void
|
||||
pinos_registry_add_object (PinosRegistry *reg,
|
||||
PinosObject *object)
|
||||
{
|
||||
object->id = pinos_map_insert_new (®->objects, object);
|
||||
pinos_signal_emit (®->object_added, object);
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
static inline void
|
||||
pinos_registry_remove_object (PinosRegistry *reg,
|
||||
PinosObject *object)
|
||||
{
|
||||
pinos_signal_emit (®->object_removed, object);
|
||||
pinos_map_remove (®->objects, object->id);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PINOS_REGISTRY_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue