Commit Graph

27 Commits

Author SHA1 Message Date
Jason Francis
ed8346e77d docs: Add brief descriptions to all functions
This ensures all of these functions are picked up by g-ir-scanner.
2021-06-02 17:38:34 +00:00
George Kiagiadakis
b812e912d2 docs: fix C API documentation to work nicely with doxygen & sphinx 2021-05-25 14:19:53 +03:00
Raghavendra
d692f06f0d docs: api: Replace hotdoc specific commands with Doxygen specific commands 2021-05-25 14:19:53 +03:00
Julian Bouzas
8fdd99d956 global-proxy: delay object creation until bound feature is requested
Allows handling errors if creation fails
2021-05-18 09:24:33 -04:00
George Kiagiadakis
0b558eca74 proxy: add a "bind" watch, to watch for proxy errors while binding/exporting
Add a unit test for this. Create a link with invalid nodes and expect
the activation transition to error out.
2021-05-13 08:52:22 -04:00
Julian Bouzas
58db9e1fad global-proxy: destroy the global when proxy is destroyed 2021-05-12 14:04:34 -04:00
George Kiagiadakis
257d5cba47 wp: rename debug.{h,c} to log.{h,c}
Also rename the intermediate lua api table WpDebug -> WpLog

Keeps things more consistent with the function names (wp_log*),
with the lua api (Log.*) and with pipewire using log.{h,c} as well.
After all, these functions are for logging...
2021-05-06 15:50:07 +03:00
George Kiagiadakis
9b74fbc6ac device: debug and enhance spa device event handling 2021-04-16 20:01:56 +03:00
George Kiagiadakis
faff5c644c spa-device: do not assert if the activation transition fails 2021-03-16 16:15:32 +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
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
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
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
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
Julian Bouzas
ffd43f397b device: set parent type to GObject in WpSpaDevice structure 2020-10-15 12:04:05 -04:00
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
b70cbca84e spa-device: store the constructor properties and use them for export + object-info
the spa object undereath doesn't do that and we lose a bunch of
properties otherwise
2020-06-15 11:10:39 +03:00
Julian Bouzas
382b550d26 spa-device: don't destroy the task until the proxy is bound when exporting 2020-06-12 15:04:36 -04:00
George Kiagiadakis
8a0abd4fb8 spa-device: subclass from GObject 2020-06-11 15:05:20 +03:00
Julian Bouzas
9728418b6d spa-pod: remove const-ness from API 2020-06-04 09:48:43 -04:00
George Kiagiadakis
b17dab8c9b spa-device: delay activation until after the device is exported
this allows the created nodes to be able to set their "device.id"
property correctly
2020-06-02 17:24:14 +03:00
George Kiagiadakis
8a94937b2a proxy: refactor how PARAM_Props/PropInfo are handled
+ rename FEATURE_CONTROLS to FEATURE_PROPS
+ add accessor for the standard spa_param_info (info->params)
+ hide the low-level params API that nobody uses
2020-05-25 18:54:41 +03:00
Julian Bouzas
cfbcb5eca3 proxy: use WpSpaPod instead of struct spa_pod in public API 2020-04-21 16:11:05 -04:00
George Kiagiadakis
9ca342f89f debug: update all library code to use the new debug system
+ enable the new log writer on the executables
+ enable structured logging in the tests
2020-04-14 18:31:17 +03:00
George Kiagiadakis
d4973363ac lib: add extensive API documentation 2020-02-19 10:43:07 +02:00
George Kiagiadakis
9330208ada proxy/core: refactor object creation
* core no longer exposes create_remote/local_object
* node, device & link have constructor methods
  to enable the create_remote_object functionality
* added WpImplNode to wrap pw_impl_node and allow creating
  "local" node instances
* added WpSpaDevice to wrap spa_device and allow creating
  "local" device instances
* exporting objects in all cases now happens by requesting
  FEATURE_BOUND from the proxy, eliminating the need for WpExported
* replaced WpMonitor by new, simpler code directly in module-monitor
* the proxy type lookup table in WpProxy is gone, we now
  use a field on the class structure of every WpProxy subclass
  and iterate through all the class structures instead; this is
  more flexible and extensible
2020-02-11 11:07:44 +02:00
George Kiagiadakis
c671b0faca lib: drop the proxy- prefix from client, device, link, port & node 2020-01-22 19:46:17 +02:00