Commit graph

880 commits

Author SHA1 Message Date
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
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
2f0799642d config: disable audio sink "streams"; they fail on latest pipewire
Fixes #22
2020-12-21 18:48:21 +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
bb9b59181b meson: enable compiler flags for warnings, if supported
Use the same set of warning flags that pipewire uses

See #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
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
George Kiagiadakis
b9ca4e1425 wplua: convert WpProperties to table and vice versa 2020-12-15 10:27:40 +02:00
George Kiagiadakis
7d692e0246 wplua: new simple engine to integrate GObject with Lua 2020-12-11 17:07:20 +02:00
George Kiagiadakis
404d016852 meson: add dependency on lua 5.3 2020-12-01 11:18:15 +02:00
George Kiagiadakis
a2181fc3f4 Merge remote-tracking branch 'origin/master' into next 2020-12-01 11:16:13 +02:00
George Kiagiadakis
accb91ddb1 tools: port wpctl to the new APIs 2020-12-01 11:00:51 +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
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
7f40a8152d iterator: add version field in the methods struct
Similar to how pipewire interfaces are versioned.
Keeps the struct extensible without breaking ABI.
2020-11-16 11:16:35 +02:00
George Kiagiadakis
3935308250 meson: bump project & API versions 2020-11-16 11:06:11 +02:00
George Kiagiadakis
ea0b96073f spa-pod: make the wrap functions public, remove private.h and sort out the rest 2020-11-16 11:01:18 +02:00
George Kiagiadakis
94213310a3 private: further cleanup of private.h, sort out header includes 2020-11-16 10:35:50 +02:00
George Kiagiadakis
c2221915c9 session-item: move wp_session_item_set_parent() to the public header 2020-11-16 10:34:58 +02:00
George Kiagiadakis
eca28d7b04 defs: add a new WP_PRIVATE_API function annotation
This is to mark private functions that are exposed in public headers.
These functions will not be exported from the library and will
generate a warning when client code is trying to use them.
2020-11-16 10:28:56 +02:00
George Kiagiadakis
37134df7c8 iterator: make private stuff public, cleanup private.h further
There is no good reason to keep them private
2020-11-15 20:26:15 +02:00
George Kiagiadakis
91472c51e9 lib: move WpImplEndpoint* header parts to private/impl-endpoint.h 2020-11-15 20:26:15 +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
a7dcd3b76f src: port daemon to the new APIs 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
George Kiagiadakis
956cc83bfa object-manager: recursively store requested features on children
Now we have a deeper hierarchy, so requesting the features on WP_TYPE_PROXY
wouldn't properly request the features on WP_TYPE_NODE
2020-11-15 20:26:15 +02:00
George Kiagiadakis
403bb0643a impl-endpoint{,-stream}: disable FEATURE_PROPS temporarily 2020-11-14 13:23:20 +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
af423398c4 lib: add new WpState API to save and load data from files 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
George Kiagiadakis
1afc487353 tests: fix library unit tests 2020-11-13 19:54:48 +02:00
George Kiagiadakis
2f3f5f8e66 lib: refactor WpProxy
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.

In this new class layout, we have the following classes:

- WpObject: base class for everything; handles activating
|           and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
 |          handles events from pw_proxy and nothing more
 |- WpGlobalProxy: handles integration with the registry

All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.

All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)

This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.

A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.

This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
2020-11-13 19:54:48 +02:00
George Kiagiadakis
4dec10396a lib: add new proxy-interfaces: interfaces for the refactored WpProxy class 2020-11-13 19:54:48 +02:00
George Kiagiadakis
6b40451657 lib/private: move the registry & global APIs to a separate header 2020-11-13 19:54:48 +02:00
George Kiagiadakis
36538a54b6 lib: add new WpObject base class
A base class for objects that can have optional
features enabled and disabled. The intention is to make
this the superclass of WpProxy.

Instead of following the augment() pattern of WpProxy,
this one follows the more advanced transition pattern
that has been previously implemented in WpSessionItem.
2020-11-13 19:54:48 +02:00