Commit graph

849 commits

Author SHA1 Message Date
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
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
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
5e02c75574 wpctl: add set-profile option 2020-10-22 11:28:43 +00: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
Julian Bouzas
397a141150 m-endpoint-creation: add bluez5 endpoint creation for bluetooth devices 2020-10-05 11:35:24 -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
6a5a259fc7 modules: add bluez5 endpoint session item 2020-10-05 11:35:24 -04:00
Julian Bouzas
af196f4f5b modules: add fake stream session item 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
Julian Bouzas
c603409c60 m-config-policy: set the stream name to the media role propery by default 2020-10-05 11:35:24 -04:00
George Kiagiadakis
26800b80d6 gitlab-ci: really build with pipewire master
Apparently git cannot directly clone at an arbitrary commit,
it must be a branch or a tag
2020-09-01 11:12:30 +03:00
George Kiagiadakis
294ba3bda5 gitlab-ci: bump pipewire dependency to latest master
because otherwise the metadata unit test fails
2020-08-31 16:27:28 +03:00
George Kiagiadakis
fb8d4b1b1f metadata: remove WP_METADATA_FEATURES_STANDARD and fix copyright years 2020-08-31 16:22:11 +03:00
George Kiagiadakis
df258c3887 module-metadata: s/settings/plugin/ 2020-08-31 16:21:07 +03:00
George Kiagiadakis
40d2a186b6 tests: implement a WpMetadata unit test 2020-08-31 16:16:07 +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
e68f8d4ae2 tests: fix permissions check failure with latest pipewire 2020-08-31 13:53:04 +03:00
George Kiagiadakis
3e65325519 metadata: fix more coding style issues 2020-07-31 17:46:09 +03:00
George Kiagiadakis
3ae506d223 modules: rename metadata module to just 'module-metadata' 2020-07-31 16:34:01 +03:00
raghu447
65b4562fa0 Implement PW_TYPE_INTERFACE_Metadata 2020-07-30 21:30:14 +05:30
George Kiagiadakis
a73e46e246 Makefile: set the default debug level to INFO, if not specified, for make run 2020-07-29 19:25:07 +03:00
George Kiagiadakis
71decc1734 main: allow entire blocks to be in comments without side-effects 2020-07-29 19:25:07 +03:00
Julian Bouzas
0913257d2e m-device-activation: assume last profile as the one with highest priority 2020-07-23 09:12:52 +00:00
Julian Bouzas
6550718823 m-device-activation: fix typo when parsing device profiles 2020-07-23 09:12:52 +00:00
David Runge
fbe1e5177b
Allow system cpptoml
meson.build:
When the 'wrap_mode' option is set to 'nodownload' use a system version
of cpptoml. This does not require using git and having a network
connection during build, which is important for Linux packaging
infrastructure.

subprojects/cpptoml.wrap:
Pin revision to last release tag (v0.1.1).

lib/wptoml/*.cpp:
Remove 'include/' prefix from all cpptoml related includes, at is not
required.

Closes #17
2020-07-22 20:25:58 +02:00
George Kiagiadakis
4eb853ca7a docs: mention that the test SPA plugins are required for unit tests
Related to #18
2020-07-20 12:20:53 +03:00
Julian Bouzas
86b80f4603 dbus-device-reservation: show error message when property request fails 2020-07-10 10:36:24 -04:00
Julian Bouzas
b0cab6c4e4 dbus-device-reservation: return if call_finish fails when requesting a property 2020-07-08 13:44:01 -04:00
George Kiagiadakis
280c0edfa6 config: improve {audio,video}testsrc.node config files
* add library.name to not require adding `add-spa-lib` in pipewire.conf
  or wireplumber.conf for this to work
* add a commented local=true; it can be useful to run those nodes
  locally for testing, sometimes
2020-07-02 17:07:25 +03:00