Commit graph

937 commits

Author SHA1 Message Date
George Kiagiadakis
29559b4065 wp: add wp_get_data_dir() 2021-02-03 17:16:51 +02:00
George Kiagiadakis
e52bd4468d src: move scripts to their own directory, install in $prefix/share/ 2021-02-03 17:16:51 +02:00
George Kiagiadakis
9fa17e04b4 object-interest: add a NOT_EQUALS verb 2021-02-03 17:16:51 +02:00
George Kiagiadakis
fc526af744 m-lua-scripting: allow queuing-in scripts without the plugin being activated
This allows us to load the scripts from the config file without
WpCore being connected yet. We can later activate the lua-scripting
plugin at the right moment to start processing the scripts.
2021-02-03 17:16:51 +02:00
George Kiagiadakis
2d2668100c m-lua-scripting: refactor as a WpComponentLoader
also, add support for loading lua config files, denoted by the
"config/lua" component type
2021-02-03 17:16:51 +02:00
George Kiagiadakis
5647f0bf9e wplua: allow loading relative paths from wplua_load_path()
convert them to absolute before creating the URI
2021-02-03 17:16:51 +02:00
George Kiagiadakis
84f1b4b484 wplua: add g_autoptr support to lua_State 2021-02-03 17:16:51 +02:00
George Kiagiadakis
94d527e187 wplua: add flags to modify the sandbox behavior
with ISOLATE_ENV, it isolates the global environment between scripts
just like it did before; without it, it uses a common environment

with MINIMAL_STD, it restricts even further the available library
functions; useful for configuration files that don't need to do
actual scripting, just to define some tables
2021-02-03 17:16:51 +02:00
George Kiagiadakis
cb228637d6 wp: export functions to get the module & config dirs 2021-02-03 17:16:51 +02:00
George Kiagiadakis
0d072874a1 lib: introduce WpComponentLoader and remove WpModule
The component loader is a more generic and extensible mechanism
of loading components; modules are one type of component...
The idea is to make scripts and config files also be components,
loaded by plugins that inherit WpComponentLoader
2021-02-03 17:16:51 +02:00
George Kiagiadakis
f61e292959 plugin: inherit from WpObject
* use the activate/deactivate system from WpObject,
  which allows async activation and error reporting
* drop 'module' property, use 'core' from WpObject
2021-02-03 17:16:51 +02:00
George Kiagiadakis
596990d718 modules: remove modules that are obsoleted by the lua scripts
+ their configuration
+ their unit tests
2021-01-30 12:58:26 +02:00
George Kiagiadakis
4abd779d69 modules: actually delete module-dbus-reservation.c 2021-01-27 18:13:06 +02:00
George Kiagiadakis
c29d701e4b monitor-alsa: add device reservation logic 2021-01-26 17:24:52 +02:00
George Kiagiadakis
4a15ad05f3 spa-device: add an "object-removed" signal
This is useful for monitors to destroy the associated device reservation
object. And it may be useful for other things in the future...
2021-01-26 16:42:29 +02:00
George Kiagiadakis
13a56a7472 lua: add wp_plugin_find binding 2021-01-26 16:36:47 +02:00
George Kiagiadakis
c78373b1fc modules: delete the old dbus-reservation module 2021-01-26 16:28:22 +02:00
George Kiagiadakis
ef908439c4 modules: implement a new reserve-device module
This one offers API to interract on a lower level with
the D-Bus reservation API and uses GDBus high level bindings only.

Also, this one implements the full Acquire procedure, calling
RequestRelease() on the peer and requesting the name again with
REPLACE_EXISTING
2021-01-26 16:28:22 +02:00
George Kiagiadakis
bf71b73ae2 plugin: add a method to find plugins easily
Similar to wp_si_factory_find()
2021-01-26 16:28:22 +02:00
Julian Bouzas
d315898477 conf: create-endpoint.lua: make sure endpoints always have a valid name 2021-01-25 09:45:52 -05:00
Julian Bouzas
0beefe4d7e conf: create-endpoint.lua: use node id as key in session_items table 2021-01-25 09:44:29 -05:00
George Kiagiadakis
40ce5f0d5f meson: add 'system-lua' project option to toggle the bundled lua
By default system-lua=false, so the bundled version is built.

The default_library for the lua subproject is also set to static
now, so that we don't need to install liblua and mess up the system.
For existing build trees, this needs to be switched manually now with
-Dlua:default_library=static (or just wipe the build dir and start clean)
2021-01-23 19:11:38 +02:00
Julian Bouzas
a3a787c5c8 conf: disable legacy endpoint creation module and replace it with lua script 2021-01-22 10:09:39 -05:00
Julian Bouzas
62f819013d m-lua-scripting: add session item lua API 2021-01-22 10:04:37 -05:00
Julian Bouzas
7c0739af50 session-item: add export API with closure 2021-01-22 09:55:52 -05:00
Julian Bouzas
73c6e65a74 session-item: add activate API with closure 2021-01-22 09:55:52 -05:00
George Kiagiadakis
89d300ea48 docs: update daemon/running.md
pipewire.conf uses a different format now
2021-01-22 12:51:10 +02:00
Julian Bouzas
823abe03ee m-lua-scripting: fix reference count in object manager's lookup API 2021-01-21 07:47:08 -05:00
Julian Bouzas
b7b3ce212b object-interest: add _ref and _unref APIs 2021-01-21 07:46:59 -05:00
George Kiagiadakis
ac87519841 config: enable lua scripts, disable legacy modules 2021-01-21 09:50:50 +02:00
George Kiagiadakis
b8f8238fb4 lua: fix some nasty memory leaks 2021-01-21 09:42:07 +02:00
George Kiagiadakis
7233b7a442 meson: require pipewire 0.3.20
Required for the device event type-info
2021-01-21 09:42:07 +02:00
George Kiagiadakis
674e53c221 spa-device: handle DeviceEvent and configure node props
Depends on DeviceEvent type-info, available on pipewire master as of today
2021-01-21 09:42:07 +02:00
George Kiagiadakis
38f65ca960 m-lua-scripting: do stop the lua engine on deactivate()
deactivate() is normally called from WpCore's dispose() and
that's too late to convert a weak WpCore ref to a strong one,
so we cannot find the WpConfiguration and remove the engine.
So, keep a reference to the WpConfiguration earlier.

If the engine is not stopped on time, proxies on the export_core
are destroyed after their core and pipewire complains
2021-01-21 09:42:07 +02:00
George Kiagiadakis
c0f13fe0f6 main: drop WpConfiguration reference early 2021-01-21 09:42:07 +02:00
George Kiagiadakis
e9c38f365e plugin: debug activation & deactivation 2021-01-21 09:42:07 +02:00
George Kiagiadakis
997e2c7539 wplua: object: unset GValues used when calling action signals 2021-01-21 09:42:07 +02:00
George Kiagiadakis
7b4829f808 config: add lua-based device monitors 2021-01-21 09:42:07 +02:00
George Kiagiadakis
b88ff15725 m-lua-scripting: add bindings required for device monitors
WpDevice, WpSpaDevice, WpNode, WpImplNode, WpObject and object features
2021-01-21 09:42:07 +02:00
George Kiagiadakis
c678cbed2c impl-node: derive from WpProxy 2021-01-21 09:42:07 +02:00
George Kiagiadakis
18229e8265 spa-device: derive from WpProxy and manage child objects internally
port module-monitor to follow the changes
2021-01-21 09:42:07 +02:00
Julian Bouzas
9d6e220ec9 m-default-metadata: handle default nodes 2021-01-19 08:58:08 -05:00
George Kiagiadakis
c42a4def01 config: rename desktop profile to desktop-ep
A new desktop profile without endpoints will be added.
The goal is to be compatible with media-session in the short term
2021-01-15 16:41:22 +02:00
George Kiagiadakis
aa93ecf793 spa-pod: add the ability to specify Id properties as strings
Use the unused 'K' format letter in the varargs builder & parser methods
2021-01-15 16:30:02 +02:00
George Kiagiadakis
3762388831 spa-type: refactor
* Use a more complete API to introspect SPA types
* Avoid the need for the Tables enumeration; the tables
  are now registered with a string
* Avoid the need for initialization, work directly on spa_types
  and other static data
* Allow working with Object pods that are not Params;
  the PARAMS table was previously hardcoded in the pod implementation
* Add a different dynamic type registration system, closer to
  how spa type works. The only regression is that we can no longer
  register additional custom object fields (custom SPA_PROP_* for example),
  but this feature can be re-added later
2021-01-15 16:30:01 +02:00
George Kiagiadakis
7488ec0e25 Merge remote-tracking branch 'origin/master' into next-lua 2021-01-15 16:28:04 +02:00
Julian Bouzas
d96c856f28 m-lua-scripting: handle default endpoints from the metadata 2021-01-15 08:59:13 -05:00
Julian Bouzas
7ec169f231 m-config-policy: handle default endpoints from the metadata 2021-01-15 08:58:52 -05:00
Julian Bouzas
9cb79dc3d6 modules: replace session-settings with default-metadata 2021-01-14 13:34:01 -05:00
Julian Bouzas
453f9a34d2 wpctl: implement set-default using the metadata API 2021-01-14 12:56:51 -05:00