Commit graph

586 commits

Author SHA1 Message Date
Julian Bouzas
81163a52c0 m-lua-scripting: add WpSpaPod api 2021-02-05 08:47:27 +00:00
George Kiagiadakis
651b4b7377 m-lua-scripting/api: add wp_object_manager_iterate_filtered() 2021-02-04 17:31:25 +02:00
George Kiagiadakis
096a9b4c15 proxy: add a method to query the interface type 2021-02-04 16:51:25 +02:00
George Kiagiadakis
e0f1c8710f daemon: add a mode to execute lua scripts from the command line
This can be useful for quick testing of scripts, or to build small
utilities that do something in pipewire utilizing our lua API
2021-02-04 16:44:56 +02:00
George Kiagiadakis
02142b899b m-lua-scripting/api: add WpCore bindings 2021-02-04 13:52:24 +02:00
George Kiagiadakis
fb5706eacc m-lua-scripting/api: fix access to core in session_item_new() 2021-02-03 18:02:03 +02:00
George Kiagiadakis
03b17bcb5f m-lua-scripting/api: add WpImplSession bindings 2021-02-03 17:16:51 +02:00
George Kiagiadakis
f7c0f9cfc6 m-lua-scripting: pass component arguments to scripts 2021-02-03 17:16:51 +02:00
George Kiagiadakis
460ff6591d wplua: allow exchanging arguments and results with scripts 2021-02-03 17:16:51 +02:00
George Kiagiadakis
ef9b6ef982 m-lua-scripting: use wplua_table_to_asv() instead of custom function 2021-02-03 17:16:51 +02:00
George Kiagiadakis
ddf7eb1ecb m-lua-scripting: fixes 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
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
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
Julian Bouzas
62f819013d m-lua-scripting: add session item lua API 2021-01-22 10:04:37 -05:00
Julian Bouzas
823abe03ee m-lua-scripting: fix reference count in object manager's lookup API 2021-01-21 07:47:08 -05:00
George Kiagiadakis
b8f8238fb4 lua: fix some nasty memory leaks 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
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
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
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
bef0b178ed state: use GKeyFile API to keep state in disk 2021-01-08 14:34:13 -05:00
George Kiagiadakis
680b0a7d93 m-lua-scripting: expose session, endpoint, endpoint-link APIs
... and make WpIterator Lua-friendly so that it can be used
with the generic for loop
2020-12-22 11:35:04 +02:00
George Kiagiadakis
af01155093 Merge branch 'master' into next-lua 2020-12-21 18:56:52 +02:00
George Kiagiadakis
e48cb30828 Fix compiler warnings that appear with the warning flags enabled
Fixes #20
2020-12-20 22:16:37 +02:00
George Kiagiadakis
879f771d7f modules: implement module-lua-scripting
a module that allows loading and executing Lua
scripts from a configured directory
2020-12-20 18:10:22 +02:00
George Kiagiadakis
a2181fc3f4 Merge remote-tracking branch 'origin/master' into next 2020-12-01 11:16:13 +02:00
George Kiagiadakis
bd65517b7d pw-object-mixin: refactor, implement param caching and features for impl objects
Now the WpPipewireObject interface is directly implemented by the mixin
and there is another interface that users of the mixin must implement
in order for the mixin to work proprely.

A lot of manual stuff that proxy classes had to do before are now
in the mixin. Also most of the data that would normally reside in Private
structures is now in the mixin data structure (stored as qdata on the object).
This is achieving the best amount of code reuse so far.

For impl objects (WpImpl*) there are also default implementations of the
standard pipewire object methods and the INFO & PARAM_* features are
more coherently enabled during the whole lifetime of these objects.
2020-11-25 22:44:29 +02:00
George Kiagiadakis
58310c73aa m-metadata: add callback for wp_object_activate()
A callback is required, NULL is not accepted by GCClosure
2020-11-15 20:26:15 +02:00
George Kiagiadakis
ccdc354445 modules: port modules and their tests to the new proxy APIs
Disable m-session-settings for now, as it needs further work
2020-11-15 20:26:15 +02:00
Julian Bouzas
e0e2e3920e m-endpoint-creation: remove undefined API 2020-11-13 14:20:54 -05:00
Julian Bouzas
f196803f88 m-endpoint-creation: remove unnused variable in Bluez5 endpoint creation 2020-11-13 14:20:54 -05:00
Julian Bouzas
f486cd389d m-device-activation: use profile from default-profile module if loaded 2020-11-13 14:20:54 -05:00
Julian Bouzas
af70cac05f modules: add module to store device profiles each time they change 2020-11-13 14:20:54 -05:00
Julian Bouzas
763f0f1795 m-monitor: add use-acp flag 2020-11-13 14:20:54 -05:00
Julian Bouzas
321545a32c modules: refactor dbus reservation
The Dbus device reservation has been moved into a separate module, and has also
been refactored to allow reserving a device name before an actual device is
created. Devices now are created and destroyed by the monitor depending on
whether PipeWire owns the device or not. This also simplifies a lot the device
activation module to always enable devices when they are created, and never
worry about checking whether a device is acquired by PipeWire or not.
2020-10-22 14:33:59 -04:00
Julian Bouzas
bc17aaa397 plugin: add name property 2020-10-22 08:40:27 -04:00
Julian Bouzas
397a141150 m-endpoint-creation: add bluez5 endpoint creation for bluetooth devices 2020-10-05 11:35:24 -04:00