Commit graph

161 commits

Author SHA1 Message Date
George Kiagiadakis
33e546d79b lua/pod: convert Id object fields to strings, if possible 2021-02-05 18:58:02 +02:00
Julian Bouzas
dc2ad1f25d rename all foo_iterate APIs to foo_new_iterator
Avoids confusion with LUA iterate API
2021-02-05 11:33:23 -05:00
Julian Bouzas
b32072a2ed tests: wplua: add pod.lua script to validate pod API 2021-02-05 08:47:27 +00:00
George Kiagiadakis
b58eff2b69 tests: wplua: add a script tester to validate lua scripts 2021-02-05 08:47:27 +00:00
George Kiagiadakis
e3a60c6233 examples: add an example interactive lua script 2021-02-04 17:32:59 +02:00
George Kiagiadakis
460ff6591d wplua: allow exchanging arguments and results with scripts 2021-02-03 17:16:51 +02:00
George Kiagiadakis
81d6f055a0 wplua: add GVariant dictionary conversion functions 2021-02-03 17:16:51 +02:00
George Kiagiadakis
a67116b0b9 wptoml: remove, it's not used anymore
and drop cpptoml dependency as well
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
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
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
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
b7b3ce212b object-interest: add _ref and _unref APIs 2021-01-21 07:46:59 -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
f01dd10aaf metadata: refactor API to quickly find a specific value 2021-01-11 13:11:37 -05:00
Julian Bouzas
bef0b178ed state: use GKeyFile API to keep state in disk 2021-01-08 14:34:13 -05: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
70931969b4 wplua: remove TypeClass, push constructors as ClassName_new 2020-12-16 23:14:58 +02:00
George Kiagiadakis
65b817f6fc wplua: add proper GError domain & error codes 2020-12-15 18:36:14 +02:00
George Kiagiadakis
8b4c5af49c wplua: implement sandboxing of scripts
All loaded scripts can now be run in a protected environment
so that they cannot do any harm to the host or to each other
2020-12-15 18:28:28 +02:00
George Kiagiadakis
7d692e0246 wplua: new simple engine to integrate GObject with Lua 2020-12-11 17:07:20 +02:00
George Kiagiadakis
a2181fc3f4 Merge remote-tracking branch 'origin/master' into next 2020-12-01 11:16:13 +02:00
George Kiagiadakis
20da8a946d tests: endpoint: re-enable the params unit test 2020-11-25 22:44:29 +02:00
George Kiagiadakis
3d032cc288 lib: delete WpProps
This is no longer useful, we are going to use WpSpaPod directly
in combination with the param caching for WpPwObjectMixin
2020-11-25 22:44:29 +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
af423398c4 lib: add new WpState API to save and load data from files 2020-11-13 14:20:54 -05:00
George Kiagiadakis
1afc487353 tests: fix library unit tests 2020-11-13 19:54:48 +02: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
7d35191091 m-config-endpoint: refactor and rename to endpoint-creation
Allows implementing device specific endpoint creation logic, which is currently
needed for bluetooth endpoints as they need to be created differenly.
2020-10-05 11:35:24 -04:00
Julian Bouzas
236f6f8fc5 m-si-adapter: use the adapter's name as stream name 2020-10-05 11:35:24 -04:00
Julian Bouzas
b2438f2cef m-si-adapter: set the configured flag when configuration was successful 2020-10-05 11:35:24 -04:00
George Kiagiadakis
40d2a186b6 tests: implement a WpMetadata unit test 2020-08-31 16:16:07 +03:00
George Kiagiadakis
e68f8d4ae2 tests: fix permissions check failure with latest pipewire 2020-08-31 13:53:04 +03:00
George Kiagiadakis
b59ff48156 si-convert: improve node properties for convert nodes
* do not copy the full alsa node properties set
* use a node description that makes the nodes look better in JACK
* use . instead of / as a separator for the node.name, like elsewhere
* add audio.convert spa lib association in the tests that use si-convert;
  previously it used to work because library.name was present in the
  properties copied from the adapter (and it so happens that the adapter
  lives in the audioconvert spa plugin as well ...)
2020-06-29 13:05:44 +03:00
George Kiagiadakis
707518937a tests/config-policy: add "node.autoconnect" on nodes to pass the test 2020-06-16 19:15:09 +03:00
George Kiagiadakis
c72d126374 properties: const-ify the pw_properties in _new_wrap()
and do not allow writing to wrapped pw_properties,
since they are const now
2020-06-15 17:20:10 +03:00
Julian Bouzas
eb39dec68b core: add wp_core_clone API 2020-06-10 13:29:44 -04:00
Julian Bouzas
cd3401bcb5 dbus-device-reservation: add owner-appeared/owner-vanished signals, and remove acquired callback 2020-06-07 16:28:44 -04:00
Julian Bouzas
9728418b6d spa-pod: remove const-ness from API 2020-06-04 09:48:43 -04:00
Julian Bouzas
d3cb1bd84d modules: rename config-static-nodes to config-static-objects 2020-06-02 12:24:47 -04:00
Julian Bouzas
c97eccea16 tests: dbus-device-reservation: free the string properties 2020-06-01 20:05:03 -04:00
Julian Bouzas
5323ee14a5 dbus-device-reservation: emit forced 'release' signal when name is lost and pending task is NULL 2020-06-01 20:05:03 -04:00
Julian Bouzas
d11c67fe98 dbus-device-reservation: change the forced param type from the 'release' signal to boolean 2020-06-01 20:05:03 -04:00
George Kiagiadakis
64347e67e2 tests: si-standard-link: test that endpoint-link properties are set 2020-06-01 19:03:39 +03:00
George Kiagiadakis
9ae7071134 props: refactor WpSpaProps into WpProps
- make it a GObject so that it can emit its own signals
and so that it can be shared between multiple proxies
- share the WpProps instance between endpoints, endpoint-streams
and their underlying nodes
- introduce the concept of the caching mode that redirects _set
to _set_param of the proxy that actually has the props; this allows
shared WpProps to actually set changes on the correct proxy
in a transparent way
- change methods to consume the ref of the pod and reflect that
also on wp_proxy_set_prop()
- refactor the export process on endpoints & endpoint-streams
so that they always get all the required features (info, props, bound)
and make it async so that we can take time to prepare the underlying
node to have FEATURE_PROPS
- update the props & endpoint unit tests, bringing back all the
checks that the endpoint unit test used to have
2020-05-29 18:47:16 +03:00