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.
Showing
- lib/wp/client.c 86 additions, 39 deletionslib/wp/client.c
- lib/wp/client.h 2 additions, 2 deletionslib/wp/client.h
- lib/wp/debug.c 1 addition, 1 deletionlib/wp/debug.c
- lib/wp/device.c 130 additions, 96 deletionslib/wp/device.c
- lib/wp/device.h 2 additions, 2 deletionslib/wp/device.h
- lib/wp/endpoint-link.c 199 additions, 148 deletionslib/wp/endpoint-link.c
- lib/wp/endpoint-link.h 3 additions, 3 deletionslib/wp/endpoint-link.h
- lib/wp/endpoint-stream.c 281 additions, 276 deletionslib/wp/endpoint-stream.c
- lib/wp/endpoint-stream.h 3 additions, 4 deletionslib/wp/endpoint-stream.h
- lib/wp/endpoint.c 359 additions, 353 deletionslib/wp/endpoint.c
- lib/wp/endpoint.h 4 additions, 16 deletionslib/wp/endpoint.h
- lib/wp/global-proxy.c 293 additions, 0 deletionslib/wp/global-proxy.c
- lib/wp/global-proxy.h 47 additions, 0 deletionslib/wp/global-proxy.h
- lib/wp/link.c 90 additions, 45 deletionslib/wp/link.c
- lib/wp/link.h 2 additions, 2 deletionslib/wp/link.h
- lib/wp/meson.build 5 additions, 2 deletionslib/wp/meson.build
- lib/wp/metadata.c 128 additions, 24 deletionslib/wp/metadata.c
- lib/wp/metadata.h 13 additions, 3 deletionslib/wp/metadata.h
- lib/wp/node.c 203 additions, 171 deletionslib/wp/node.c
- lib/wp/node.h 3 additions, 18 deletionslib/wp/node.h
Loading
Please register or sign in to comment