Commit Graph

21 Commits

Author SHA1 Message Date
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
George Kiagiadakis
d39307ee70 lib/wp: move internal functions and declarations to a private.h header 2019-11-07 20:44:55 +02:00
George Kiagiadakis
a63f2bb99b lib/wp: merge both WpRemote & WpRemotePipewire in WpCore
In practice we always create a remote and connect to pipewire.
Any other scenario is invalid, therefore, it is not justified
to be confused with so many classes for such small functionality.
This simplifies a lot the modules code.

Also, this commit exposes the pw_core and pw_remote objects
out of WpCore. This is in practice useful when dealing with low-level
pw and spa factories, which are used in the monitors. Let's not
add API wrappers for everything... Bindings will never use this
functionality anyway, since it depends on low level pipewire C API.
2019-09-07 17:55:46 +03:00
George Kiagiadakis
3d46253dd6 proxy: hide the bind() API and fix attaching the listener in wrap mode
In case the proxy was created with wp_proxy_new_wrap(), the event
listener was not attached on the pw_proxy
2019-08-29 21:21:51 +03:00
George Kiagiadakis
e5a05dcc2b proxy-*: improve proxy subclasses
* add proxy sync method
* add wrapers for enum/set/subscribe_params
* move the info structure handling to the subclasses
* expose info->props as WpProperties
2019-08-27 17:40:28 +03:00
George Kiagiadakis
bdce3b4de5 proxy: refactor the proxy class to hide pipewire API and make things easier 2019-08-25 12:44:47 +03:00
Julian Bouzas
dbd763bc9c proxy: throw an error if the proxy is destroyed during async constructions 2019-07-25 12:24:47 +03:00
Julian Bouzas
e73553088b proxy: remove unneeded destroy signal 2019-06-27 07:23:20 -04:00
Julian Bouzas
236ea5e0f2 proxy: add wp_proxy_sync API and DONE signal 2019-06-20 11:59:51 -04:00
Julian Bouzas
fc7ebc2c31 proxy: add global_id property 2019-06-19 09:07:00 -04:00
Julian Bouzas
a471a2df13 proxy: remove unneeded core reference 2019-06-18 10:18:21 -04:00
Julian Bouzas
922065f97d proxy: add destroyed signal 2019-06-18 10:09:40 -04:00
Julian Bouzas
aa1ce5cdd4 proxy: add API 2019-06-17 10:42:29 -04: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
George Kiagiadakis
02c69fd2fa proxy: add methods to get info & enum params 2019-04-26 12:36:49 +03:00
George Kiagiadakis
4fcdb931be proxy/plugin: hold a pointer to the core instead of the respective registry
This makes it more intuitive to get other attached interfaces
from the core
2019-04-22 17:48:02 +03:00
George Kiagiadakis
55365e97c1 lib: proxy: make the pipewire property getter an interface on WpObject
We are going to use this in other object types as well
2019-04-22 12:44:42 +03:00
George Kiagiadakis
ce43cf5f0c refactoring around the registries
* make the registries available as dynamic interfaces of the core
* improve a bit the C API of WpObject & WpInterfaceImpl
2019-04-17 19:09:39 +03:00
George Kiagiadakis
87d60a80aa proxy: subclass from WpObject to allow attaching interfaces dynamically 2019-04-17 16:12:03 +03:00
George Kiagiadakis
f1bb4e3588 lib: implement proxy & proxy-registry 2019-04-15 17:07:06 +03:00
George Kiagiadakis
6f6e2b0e3e lib: implement plugin mechanism and a basic proxy object 2019-04-12 12:37:36 +03:00