Commit Graph

96 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
George Kiagiadakis
f0d33cb873 endpoint: remove wp_endpoint_create_link()
Not used and not useful with the current design.
May be reverted in the future, if necessary.
2021-05-21 19:57:31 +03:00
George Kiagiadakis
ac9e1e89c4 wp: remove WpSession and WpEndpointLink
We have ended up not using them, so let's not carry them
in the ABI of 0.4

We can always revert that, but let's first decide how
these objects should be used
2021-05-21 19:57:31 +03: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
3485befc81 endpoint: remove useless pw_proxy_destroyed handlers 2021-04-05 16:03:55 +03:00
Julian Bouzas
fb1daa0bf2 modules: use dots instead of dashes for session item properties
Keeps consistency with PipeWire
2021-04-02 11:22:22 -04:00
Julian Bouzas
ebf52adb21 si-interfaces: make WpSiLink work with WpSiPortInfo instead of WpSiEndpoint 2021-03-26 16:16:02 -04:00
Julian Bouzas
120aab04ae session-item: refactor and inherit from WpObject
This adds WP_SESSION_ITEM_FEATURE_ACTIVE and WP_SESSION_ITEM_FEATURE_EXPORTED
features, so _activate and _export APIs have been removed. Modules and unit
tests have also been updated.
2021-03-18 14:30:05 -04:00
Julian Bouzas
12b2c00d0b lib: remove WpEndpointStream API
Add all that goes with it.
2021-03-18 12:10:37 -04:00
Julian Bouzas
dc2ad1f25d rename all foo_iterate APIs to foo_new_iterator
Avoids confusion with LUA iterate API
2021-02-05 11:33:23 -05: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
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
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
94213310a3 private: further cleanup of private.h, sort out header includes 2020-11-16 10:35:50 +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
403bb0643a impl-endpoint{,-stream}: disable FEATURE_PROPS temporarily 2020-11-14 13:23:20 +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
9728418b6d spa-pod: remove const-ness from API 2020-06-04 09:48:43 -04:00
Julian Bouzas
3a93190ec9 lib: fix const compile warnings by using the wp_spa_pod_new_wrap_const API 2020-06-04 09:48:43 -04:00
Julian Bouzas
b9acfcb237 spa-pod: rename spa pod _new_regular_wrap APIs to just _new_warp 2020-06-04 09:48:43 -04:00
George Kiagiadakis
8c40bbbce0 endpoint: add GObject properties to access the name, media-class & direction 2020-06-02 13:09:00 +03:00
George Kiagiadakis
78209c48c7 endpoint/endpoint-stream: remove useless virtual methods
they are not useful anymore because we hijack priv->info from the
impl subclass, so that it points to the impl info struct,
and therefore the base implementations work just fine
2020-06-02 13:09:00 +03:00
George Kiagiadakis
d8a42d2ec3 Revert "lib: return empty WpProperties if the info struct has no properties on SM objects"
This reverts commit 917a019b01.
2020-06-01 18:29:28 +03:00
George Kiagiadakis
917a019b01 lib: return empty WpProperties if the info struct has no properties on SM objects 2020-06-01 17:48:54 +03:00
George Kiagiadakis
5dfe688c35 endpoint: enable FEATURE_PROPS on streams when FEATURE_STREAMS is enabled 2020-05-31 12:17:52 +03:00
George Kiagiadakis
9ae7071134 props: refactor WpSpaProps into WpProps
- make it a GObject so that it can emit its own signals
and so that it can be shared between multiple proxies
- share the WpProps instance between endpoints, endpoint-streams
and their underlying nodes
- introduce the concept of the caching mode that redirects _set
to _set_param of the proxy that actually has the props; this allows
shared WpProps to actually set changes on the correct proxy
in a transparent way
- change methods to consume the ref of the pod and reflect that
also on wp_proxy_set_prop()
- refactor the export process on endpoints & endpoint-streams
so that they always get all the required features (info, props, bound)
and make it async so that we can take time to prepare the underlying
node to have FEATURE_PROPS
- update the props & endpoint unit tests, bringing back all the
checks that the endpoint unit test used to have
2020-05-29 18:47:16 +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
George Kiagiadakis
5eecc5b68a object-manager: remove deprecated API 2020-05-14 16:24:34 +03:00
George Kiagiadakis
fe1ac40919 endpoint: ensure that streams are available when FEATURE_STREAMS is declared as ready 2020-05-11 09:56:06 +03:00
George Kiagiadakis
cc72b3757c si-standard-link: manage lifetime internally 2020-05-07 16:38:14 +03:00
George Kiagiadakis
9db4a54591 session-item: handle destroyed endpoint links
We can now call wp_proxy_request_destroy() on endpoint links and
the WpImplEndpointLink together with the session item that created
it will be cleaned up
2020-05-07 16:02:23 +03:00
George Kiagiadakis
7966a8d456 si-standard-link: fix endpoint linking bugs and add some debug statements 2020-05-05 18:04:05 +03:00
George Kiagiadakis
52b52ea63c session/endpoint/node: proxy the object-manager API for looking up child objects 2020-05-05 18:04:05 +03:00
George Kiagiadakis
b97540a109 endpoint: add wp_endpoint_create_link method 2020-05-05 18:04:05 +03:00
George Kiagiadakis
3617ca07ae lib: align node/endpoint/session features ports/streams/endpoints,links
- Use similar code for consistency
- Add changed signals everywhere
- Port to the new object-manager API
2020-05-03 19:42:42 +03:00
George Kiagiadakis
1c74a83a5c tests: si-simple-node-endpoint: add export test 2020-04-23 17:25:57 +03:00
Julian Bouzas
0045fe03c9 proxy: add set and get control vmethods, and remove them from sub-classes 2020-04-21 16:11:05 -04: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
1dccdcf415 object-manager: replace GPtrArray API with WpIterator
+ add the useful _find_proxy() method
2020-04-21 13:21:03 +03: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
5bf40e86cb endpoint: fix compiler warnings 2020-04-14 15:18:44 +03:00
George Kiagiadakis
5d74bceac0 endpoint: implement create_link() 2020-04-11 11:05:26 +03:00
George Kiagiadakis
17d4b46144 endpoint & stream: use wp_session_item_get_associated_proxy_id() 2020-03-31 19:31:54 +03:00
George Kiagiadakis
bb78b6bbc7 doc: remove references to WpImplEndpoint that is now private 2020-03-31 16:11:08 +03:00
George Kiagiadakis
4adf6105ba endpoint: implement FEATURE_STREAMS
This feature enables the caching of WpEndpointStream objects
inside WpEndpoint, making information about streams readily
accessible to the user of an endpoint
2020-03-31 16:11:08 +03:00