Commit graph

403 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
af423398c4 lib: add new WpState API to save and load data from files 2020-11-13 14:20:54 -05: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
Julian Bouzas
bc17aaa397 plugin: add name property 2020-10-22 08:40:27 -04:00
George Kiagiadakis
268b7dd0a9 transition: stop and return error if cancelled by the GCancellable 2020-10-22 13:27:29 +03:00
Julian Bouzas
ffd43f397b device: set parent type to GObject in WpSpaDevice structure 2020-10-15 12:04:05 -04:00
George Kiagiadakis
fb8d4b1b1f metadata: remove WP_METADATA_FEATURES_STANDARD and fix copyright years 2020-08-31 16:22:11 +03:00
George Kiagiadakis
3f160b552c metadata: improve implementation
* Implement the proxy properly with info caching, methods, etc
* Get rid of useless variables and includes
2020-08-31 16:14:47 +03:00
George Kiagiadakis
3e65325519 metadata: fix more coding style issues 2020-07-31 17:46:09 +03:00
raghu447
65b4562fa0 Implement PW_TYPE_INTERFACE_Metadata 2020-07-30 21:30:14 +05:30
George Kiagiadakis
a3870581fb spa-device / m-monitor: fix pw_proxy leaks reported by pw_core
1. device export proxies must be destroyed manually since they are
   not associated with the WpRegistry
2. the monitors should not disconnect before all WpSpaDevice objects
   are destroyed; remove the manual disconnect call and let GObject
   ref counting do its job (the core will disconnect when its last ref
   count is dropped after the last monitor plugin is destroyed)
2020-06-29 13:05:44 +03:00
George Kiagiadakis
697226f306 session-bin: call parent's reset() in reset()
otherwise the parent never un-exports or de-activates itself
and we leak a bunch of stuff
2020-06-18 19:28:03 +03:00
George Kiagiadakis
d471ba3d9c object-interest: don't use G_GNUC_FALLTRHOUGH
it requires GLib 2.60 and it's not worth it
2020-06-16 19:18:20 +03:00
George Kiagiadakis
1563eeeae6 object-interest: initialize GValue passed to g_object_get_property
g_object_get_property did not support uninitialized GValues prior
to GLib 2.60, and it's not worth requiring 2.60 for this reason

Fixes #11
2020-06-16 19:16:04 +03:00