Commit graph

436 commits

Author SHA1 Message Date
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
George Kiagiadakis
7b37b31af9 wplua: fix enum <-> lua conversion
Sometimes the GEnumClass is not instantiated, so _peek() doesn't work
We need to acquire a strong ref to make sure it is
2021-02-05 12:00:24 +02:00
George Kiagiadakis
ce66025846 node: change send_command() to take a string
Use the spa type system to locate the enumeration value that corresponds
to that string and send that
2021-02-05 11:05:26 +02:00
Julian Bouzas
a634bf88fd wplua: fix vtables lookup in boxed __index function 2021-02-05 08:47:27 +00: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
1c0f0b8684 wplua: pass SANDBOX_CONFIG as a script argument
avoids keeping it forever as a global
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
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
29559b4065 wp: add wp_get_data_dir() 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
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
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
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
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
Julian Bouzas
b7b3ce212b object-interest: add _ref and _unref APIs 2021-01-21 07:46:59 -05: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
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
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
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
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
Julian Bouzas
2ec43ea885 wp: remove initialization of wireplumber types 2021-01-05 08:43:03 -05:00
Julian Bouzas
866ede214e session: remove default-endpoint-changed signal 2021-01-04 12:46:53 -05:00
Julian Bouzas
bd19c2ddef spa-type: fix param profile's last Id 2020-12-30 12:35:26 -05:00
George Kiagiadakis
86f97b17c6 wplua: expose table to/from properties conversion functions 2020-12-22 11:33:35 +02:00
George Kiagiadakis
b94e54c469 object, pw-obj-mixin: fix warnings 2020-12-21 18:58:20 +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
d0d2f2a59e wplua: use only the basename of the files for debug/error messages 2020-12-18 18:26:31 +02:00
George Kiagiadakis
067da200fc wplua: use the error handler also when loading chunks
... and improve its output
2020-12-18 18:25:43 +02:00
George Kiagiadakis
0054559b91 wplua: implement __tostring for GObject 2020-12-18 18:24:27 +02:00
George Kiagiadakis
da375a7408 wplua: use the registry to store vtables & closures 2020-12-16 23:19:07 +02:00
George Kiagiadakis
70931969b4 wplua: remove TypeClass, push constructors as ClassName_new 2020-12-16 23:14:58 +02:00
George Kiagiadakis
5edfc090c6 wplua: allow checking for a specific GType with isobject/isboxed 2020-12-16 23:12:41 +02:00
George Kiagiadakis
630a6f5e1c configuration: convert file paths from relative to absolute if necessary 2020-12-16 09:43:32 +02:00
George Kiagiadakis
55a6d20def configuration: implement grouping files in subdirectories
This patch allows configuring an "extension" string that filters
files not only by extension, but also by a subdirectory of the
standard configuration path(s).

The "extension" can now have the following format:
  "subdirectory/path/extension"
which is split on the last '/' and looks for files that end with
".extension" in "WIREPLUMBER_CONFIG_DIR/subdirectory/path/"

If no subdirectory is specified, the code behaves just like it did
before.
2020-12-16 09:40:55 +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