registry: hide again the WpCore struct, separate registry and core better

This commit is contained in:
George Kiagiadakis
2020-02-17 18:31:03 +02:00
parent 0b55729e06
commit c46a48d13f
9 changed files with 75 additions and 69 deletions

View File

@@ -73,6 +73,28 @@ wp_loop_source_new (void)
* WpCore
*/
struct _WpCore
{
GObject parent;
/* main loop integration */
GMainContext *context;
/* extra properties */
WpProperties *properties;
/* pipewire main objects */
struct pw_context *pw_context;
struct pw_core *pw_core;
/* pipewire main listeners */
struct spa_hook core_listener;
struct spa_hook proxy_core_listener;
WpRegistry registry;
GHashTable *async_tasks; // <int seq, GTask*>
};
enum {
PROP_0,
PROP_CONTEXT,
@@ -89,7 +111,6 @@ enum {
static guint32 signals[NUM_SIGNALS];
G_DEFINE_TYPE (WpCore, wp_core, G_TYPE_OBJECT)
static void
@@ -402,3 +423,15 @@ wp_core_sync_finish (WpCore * self, GAsyncResult * res, GError ** error)
return g_task_propagate_boolean (G_TASK (res), error);
}
WpRegistry *
wp_core_get_registry (WpCore * self)
{
return &self->registry;
}
WpCore *
wp_registry_get_core (WpRegistry * self)
{
return SPA_CONTAINER_OF (self, WpCore, registry);
}