m-lua-scripting: wrap every script in a WpPlugin and expose async activation api

This allows scripts to declare when they have finished their loading,
so we can now also know when wireplumber is done loading and ready to
handle clients

Related to !313
This commit is contained in:
George Kiagiadakis
2022-04-06 18:11:17 +03:00
parent 031bc65c20
commit ecb6100b77
7 changed files with 387 additions and 68 deletions

View File

@@ -35,7 +35,8 @@ get_wp_export_core (lua_State *L)
WpCore *core = NULL;
lua_pushliteral (L, "wireplumber_export_core");
lua_gettable (L, LUA_REGISTRYINDEX);
core = lua_touserdata (L, -1);
if (wplua_isobject (L, -1, WP_TYPE_CORE))
core = wplua_toobject (L, -1);
lua_pop (L, 1);
return core ? core : get_wp_core(L);
}