core: load components internally and refactor main to just activate it

+ move the export-core creation and media-session check to be built-in components
+ add WpCore API to find the export core
This commit is contained in:
George Kiagiadakis
2023-06-21 19:35:23 +03:00
parent 6bab78bf3f
commit 840a2304b4
8 changed files with 262 additions and 260 deletions

View File

@@ -37,13 +37,9 @@ get_wp_core (lua_State *L)
static WpCore *
get_wp_export_core (lua_State *L)
{
WpCore *core = NULL;
lua_pushliteral (L, "wireplumber_export_core");
lua_gettable (L, LUA_REGISTRYINDEX);
if (wplua_isobject (L, -1, WP_TYPE_CORE))
core = wplua_toobject (L, -1);
lua_pop (L, 1);
return core ? core : get_wp_core(L);
WpCore *core = get_wp_core (L);
g_autoptr (WpCore) export_core = wp_core_get_export_core (core);
return export_core ? export_core : core;
}
/* GLib */