Commit Graph

15 Commits

Author SHA1 Message Date
George Kiagiadakis
c46a48d13f registry: hide again the WpCore struct, separate registry and core better 2020-02-17 18:31:03 +02:00
George Kiagiadakis
0b55729e06 registry: set a free func in the globals list
it doesn't matter, because we don't use it, but for the sake of readability
2020-02-17 16:43:47 +02:00
George Kiagiadakis
949100c9c0 object-manager: reorder code in object-manager.c 2020-02-14 17:19:41 +02:00
George Kiagiadakis
472d63e1b0 registry: fix internal documentation 2020-02-14 17:19:35 +02:00
George Kiagiadakis
51272907fe registry: expose tmp globals in the order they appeared on the pw registry
some code is expecting things to happen in that order...
2020-02-14 17:19:26 +02:00
George Kiagiadakis
813351bcdf registry: safely destroy proxy when its initial augment is still in progress
... in case the global is removed from the registry before
the initial augment completes
2020-02-14 17:19:15 +02:00
George Kiagiadakis
269b9e1998 registry: use a temporary globals list
When a new global is created, it is not certain
if the registry global event or the proxy bound event will
be fired first. In order to make sure we associate all
proxies to their WpGlobals correctly, we now wait a core sync
before exposing globals to the object managers, so that in case
the implementation proxy receives the bound event after the
registry creates the WpGlobal, we can make sure to use this
proxy instead of constructing a new one through the object managers
2020-02-14 17:18:58 +02:00
George Kiagiadakis
753e708544 object-manager: refactor to be able to track locally created proxies
There are 3 kinds of WpProxy objects:
 * the ones that are created as a result of binding a global
   from the registry
 * the ones that are created as a result of calling into a remote
   factory (wp_node_new_from_factory, etc...)
 * the ones that are a local implementation of an object
   (WpImplNode, etc...) and are exported

Previously the object manager was only able to track the first kind.
With these changes we can now also have globals associated with
WpProxies that were created earlier (and caused the creation of the global).
This saves some resources and reduces round-trips (in case client
code wants to change properties of an object that is locally
implemented, it shouldn't need to do a round-trip through the server)
2020-02-14 17:12:23 +02:00
George Kiagiadakis
a92e1a64ec global & object-manager: use GType instead of the pipewire type 2020-02-12 14:15:51 +02:00
George Kiagiadakis
d8ae151aba proxy: replace global-id with bound-id
+ use the pw_proxy API to find the bound id instead
of relying on WpGlobal

This has the advantage that it works also for exported
objects and for objects that have been created by calling
into a remote factory (such as the link-factory), so we can
now know the global id of all proxies, not only the ones
that have been created by the registry.
2020-02-10 18:58:41 +02:00
Julian Bouzas
a9ac1fdc06 update to the latest pipewire API 2020-01-13 15:07:08 -05:00
George Kiagiadakis
92107e8342 object-manager: keep a reference to self while doing a core sync
Otherwise, if the object manager is destroyed while a sync is in progress,
we get an invalid 'self' pointer on the callback later, which is being
called regardless

There is a bit more work that should be done in the core to avoid leaking
this ref in case pipewire disconnects before the sync is completed
2019-12-05 12:05:34 +02:00
Julian Bouzas
58f321f815 object-manager: sync object-changed with pipewire's core 2019-12-04 16:38:35 -05:00
Julian Bouzas
7f8fb72849 object-manager: sync on the core 2019-11-27 13:44:32 -05:00
George Kiagiadakis
73978f76aa object-manager: actually add the object-manager.* files in git 2019-11-13 16:07:36 +02:00