Commit Graph

42 Commits

Author SHA1 Message Date
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
Julian Bouzas
5a1dfc02d2 lib: make WpImplEndpoint and WpImplEndpointLink public 2021-03-18 12:10:37 -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
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
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
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
d13e411da3 lib: use WP_PROXY_FEATURE_LAST with a shift when declaring additional features
Features are flags, therefore we must NEVER use them without a shift,
otherwise bad mistakes happen, like the previous mistake of declaring
WP_SESSION_FEATURE_LINKS as the number after WP_SESSION_FEATURE_ENDPOINTS,
which ended up being (WP_SESSION_FEATURE_ENDPOINTS | WP_PROXY_FEATURE_PW_PROXY)
and it was always becoming available together with the ENDPOINTS feature.
2020-05-12 18:18:24 +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
33e67f2189 port: add wp_port_get_direction() 2020-04-22 10:59:12 +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
4a1a19d7cd session: add FEATURE_ENDPOINTS, a feature to cache endpoint proxies 2020-04-01 13:38:39 +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
George Kiagiadakis
405e8ba0d5 session-item / endpoint: implement exporting a WpSiEndpoint
* introduces API to export session items
* introduces small changes in the WpSiEndpoint & WpSiStream
  interfaces to make it nicer to work with
* ports WpImplEndpoint to use PW_TYPE_INTERFACE_Endpoint
  to export. Depends on:
  https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/246
  (was merged after 0.3.2)
2020-03-29 15:18:20 +03:00
George Kiagiadakis
d4973363ac lib: add extensive API documentation 2020-02-19 10:43:07 +02:00
George Kiagiadakis
c9cab2cd53 endpoint: refactor into WpEndpoint & WpImplEndpoint 2020-02-12 11:30:21 +02:00
George Kiagiadakis
5c47f1df2c proxy: unify common info/params API in the WpProxy base class 2020-01-22 18:30:44 +02:00
George Kiagiadakis
efb33ddd1b lib: introduce export macros and hide all private symbols 2020-01-16 18:50:07 +02:00
George Kiagiadakis
7b222ebcbd endpoint: export name, media class & direction + finetune the global properties 2019-12-11 19:05:09 +02:00
George Kiagiadakis
a71d433a5e lib: implement WpEndpoint (interface + Proxy + Exported + unit test)
heavily based on the WpSession implementation
2019-12-11 19:05:09 +02:00
George Kiagiadakis
c0455c981d lib: rename WpEndpoint* to WpBaseEndpoint*
to avoid name clashing with the upcoming WpEndpoint interface
that is going to be the common interface of Wp{Proxy,Exported}Endpoint
2019-12-11 19:05:05 +02:00
Julian Bouzas
c8417f8826 endpoint: add get_role API 2019-12-04 16:38:35 -05:00
Julian Bouzas
7bd9f84e6f endpoint: add keep property 2019-12-04 16:38:35 -05:00
Julian Bouzas
d49ffbef1d endpoint: add get_properties API 2019-12-04 16:38:35 -05:00
George Kiagiadakis
e7e5c66853 lib: introduce WpObjectManager
* rework how global objects are stored in the core
* rework how users get notified about global objects
  and proxies of remote global objects

The purpose of this change is to have a class that can manage
objects that are registered in the core or signalled through the
registry. This object can declare interest on certain types
of global objects and only keep & signal those objects that it is
interested in. Additionally, it can prepare proxy features and
asynchronously deliver an 'objects-changed' signal, which is
basically telling us that the list of objects has changed.

This is useful to simplify port proxies management in WpAudioStream.
Now the stream object can declare that it is interested in ports
that have "node.id" == X and the object manager will only maintain
a list of those. Additionally, it will emit the 'objects-changed'
signal when the list of ports is complete, so there is no reason to
do complex operations and core syncs in the WpAudioStream class
in order to figure out when the list of ports is ready.

As a side effect, this also reduces resource management. Now we
don't construct a WpProxy for every global that pipewire reports;
we only construct proxies when there is interest in them!

Another interesting side effect is that we can now register an
object manager at any point in time and get immediately notified
about remote globals that already exist. i.e. when you register
an object manager that is interested in nodes, it will be immediately
notified about all the existing nodes in the graph. This is useful
to avoid race conditions between connecting the signal and objects
beting created in pipewire
2019-11-13 15:49:39 +02:00
Julian Bouzas
44bb78fcb7 endpoint: add creation-time property 2019-11-06 12:15:11 +02:00
Julian Bouzas
dcbf823a5a endpoint: add direction property and remove it from subclasses 2019-08-27 10:05:59 -04:00
Julian Bouzas
27a31498c0 endpoint: add wp_endpoint_unlink API 2019-07-10 11:18:09 -04:00
Julian Bouzas
5429d57cb1 endpoint-link: make contruction async 2019-06-28 12:33:00 -04:00
Julian Bouzas
4333c94531 endpoint: add async initable interface boilerplate 2019-06-24 10:52:02 -04:00
George Kiagiadakis
ca1453febd endpoint: add some useful API for querying info about streams & controls 2019-06-18 17:42:06 +03:00
George Kiagiadakis
ab73fd6eb0 endpoint: maintain a weak ref to the core since construction time
+ add a method to retrieve the core
+ change the register function to not require the core as a parameter
2019-06-18 09:23:40 +03:00
George Kiagiadakis
36bc1795ca Relicense to MIT 2019-05-31 12:13:12 +03:00
George Kiagiadakis
3aa7d6ce78 lib: remove the session-manager object and register endpoints as globals 2019-05-26 19:21:27 +03:00
George Kiagiadakis
8e7f84d888 endpoint: add methods to register to the SM and use them in simple-endpoint
This changes the registration point to be the endpoint and not the
session manager, as it seems easier to implement (the implementation
will not need to keep a pointer to the session manager around)
2019-05-24 17:19:58 +03:00
George Kiagiadakis
5f853d0e53 endpoint: refactor slightly the public API
* Make streams a GVariant array, for future-proofness
* Add API for controls (volume, mute, brightness, contrast, etc...)
* Remove API for profiles (it's not well-thought; may be re-added
  in the future)
2019-05-21 18:27:07 +03:00
George Kiagiadakis
447c968846 Refactor everything!
After discussing things at the AGL May 2019 F2F meeting
and reflecting on the initial design of WirePlumber,
it became clear that it needed a fresh start.
2019-05-17 13:34:07 +03:00