Commit graph

556 commits

Author SHA1 Message Date
George Kiagiadakis
697226f306 session-bin: call parent's reset() in reset()
otherwise the parent never un-exports or de-activates itself
and we leak a bunch of stuff
2020-06-18 19:28:03 +03:00
George Kiagiadakis
d471ba3d9c object-interest: don't use G_GNUC_FALLTRHOUGH
it requires GLib 2.60 and it's not worth it
2020-06-16 19:18:20 +03:00
George Kiagiadakis
1563eeeae6 object-interest: initialize GValue passed to g_object_get_property
g_object_get_property did not support uninitialized GValues prior
to GLib 2.60, and it's not worth requiring 2.60 for this reason

Fixes #11
2020-06-16 19:16:04 +03:00
Julian Bouzas
322094565f properties: all properties from other must be included in self for the match to be valid 2020-06-16 12:56:04 +03:00
George Kiagiadakis
083b9ff878 core: wp_core_get_context -> wp_core_get_g_main_context 2020-06-16 12:53:18 +03:00
George Kiagiadakis
7668f4c6c9 core: add methods to work with pw_core_info data and pw_core properties
- pw_core_info has data that represent the remote core
- pw_core properties are the properties of its pw_client,
initially inherited from the pw_context, which can be updated either
when calling pw_context_connect() or later at runtime (the pw_core
calls pw_client_update_properties() on its pw_client)

wp_core_update_properties() is made in such a way so that we can do:
```
clone = wp_core_clone(core);
wp_core_update_properties(clone, ...);
wp_core_connect(clone);
```
and get clone to have different properties than the original core,
while they still share the same pw_context underneath
2020-06-15 17:50:03 +03:00
George Kiagiadakis
0596988945 core: retrieve and store core info
also delay the "connected" signal until info is there
2020-06-15 17:49:21 +03:00
George Kiagiadakis
0d1fcd48a1 properties: add wp_properties_unref_and_take_pw_properties()
a method to take the internal pw_properties without copying
2020-06-15 17:22:47 +03:00
George Kiagiadakis
c72d126374 properties: const-ify the pw_properties in _new_wrap()
and do not allow writing to wrapped pw_properties,
since they are const now
2020-06-15 17:20:10 +03:00
George Kiagiadakis
b70cbca84e spa-device: store the constructor properties and use them for export + object-info
the spa object undereath doesn't do that and we lose a bunch of
properties otherwise
2020-06-15 11:10:39 +03:00
Julian Bouzas
382b550d26 spa-device: don't destroy the task until the proxy is bound when exporting 2020-06-12 15:04:36 -04:00
George Kiagiadakis
8a0abd4fb8 spa-device: subclass from GObject 2020-06-11 15:05:20 +03:00
Julian Bouzas
c7982a8317 core: rename context property to g-main-context 2020-06-10 13:29:52 -04:00
Julian Bouzas
eb39dec68b core: add wp_core_clone API 2020-06-10 13:29:44 -04:00
George Kiagiadakis
8d77793a2a improve some debug logs 2020-06-10 12:53:22 +03:00
George Kiagiadakis
7a486f1f7c impl-node: subclass from GObject
By mistake, WpImplNode was developed by keeping in mind that the proxy
returned by pw_core_export() is a PW_TYPE_INTERFACE_Node, but this
is not true. It's actually a ClientNode...

Unfortunately, making WpImplNode work as if it was a WpNode is
not so easy, especially when it comes to handling params, which
need to be queried syncrhonously on the underlying spa_node.

So, instead of fixing WpImplNode to work as a WpNode, we choose to
disconnect them. This way, WpImplNode will not be used as a proxy
in the registry and the registry will normally create WpNode proxies
instead, making round-trips through the server to change node params.
2020-06-10 11:12:11 +03:00
Julian Bouzas
be8629fbec spa-pod: keep a reference of the pod in the ierator 2020-06-04 09:48:43 -04:00
Julian Bouzas
9728418b6d spa-pod: remove const-ness from API 2020-06-04 09:48:43 -04:00
Julian Bouzas
1e2dcb44ca spa-pod: set the type to regular when creating int spa pod 2020-06-04 09:48:43 -04:00
Julian Bouzas
671d748b4b spa-pod: remove _wrap_copy APIs from the private header 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
e63ca28b3a spa-pod: add _new_wrap_const APIs 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
71d12fe12a debug: add doc comments 2020-06-03 21:40:01 +03:00
George Kiagiadakis
f7d816f5d2 debug: print proxy bound IDs on objects, if they are bound proxies 2020-06-03 21:28:14 +03:00
George Kiagiadakis
1bae4a6a41 proxy: use a core sync to know when Props have been enumerated
This is necessary to finish augmenting nodes that advertise
PropInfo & Props in their param info but they don't actually have
any properties, so there is no param event emitted
(ex. the jack device nodes)

Because the sync is synchronous with the calls over the protocol,
the callback is ensured to be called after all the param events
have been emitted
2020-06-03 20:28:43 +03:00
George Kiagiadakis
a3cf986188 proxy: fix recursion crash in _set_feature_ready 2020-06-02 19:21:04 +03:00
George Kiagiadakis
e1e6411e19 proxy: when requesting Props, only try to enum them if the proxy supports them
otherwise we get stuck waiting for the param event
and we get warnings on the debug log
2020-06-02 19:09:18 +03:00
George Kiagiadakis
8627fdf1a0 proxy: fix crash when _augment_error() is called recursively from within itself 2020-06-02 18:37:42 +03:00
George Kiagiadakis
c8b11fad42 lib: add a version header 2020-06-02 18:26:40 +03:00
George Kiagiadakis
b17dab8c9b spa-device: delay activation until after the device is exported
this allows the created nodes to be able to set their "device.id"
property correctly
2020-06-02 17:24:14 +03:00
George Kiagiadakis
e4e60c2ece endpoint-stream: add GObject property to access the name 2020-06-02 13:09:00 +03: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
0bba0c0df1 properties: fix const-ness warnings 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
a7d657a196 object-manager: do not accept globals without a WpProxy subclass 2020-06-01 17:48:31 +03:00
George Kiagiadakis
6aba49f9e3 properties: implement a wp_properties_iterate() method 2020-06-01 12:07:36 +03:00
George Kiagiadakis
a30761c2f4 registry: forcibly add 'object.id' on all global properties
so that we can filter proxies by id on object managers
2020-05-31 12:19:47 +03:00
George Kiagiadakis
564e8a0db3 object-manager: fix iterator fold object access 2020-05-31 12:18:29 +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
Julian Bouzas
182d4d6276 node: add send command API 2020-05-26 11:29:18 -04:00
George Kiagiadakis
162c1d4574 session: fix the default-endpoint prop
* Use a direction instead of a string prop id
* Emit default-endpoint-changed again
* Get rid of the useless virtual methods
2020-05-25 18:56:21 +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
b8d1f40111 iterator: add a generic GPtrArray iterator implementation 2020-05-25 18:54:41 +03:00
George Kiagiadakis
1f2e2b7fc4 debug: add mechanism to debug spa pods
-> wp_trace_boxed (WP_TYPE_SPA_POD, pod, "some message");
2020-05-25 18:54:41 +03:00
George Kiagiadakis
b807b666a0 debug: don't crash if an object is NULL in wp_*_object() and point it out in the log
by using G_TYPE_NONE (== 1), we can pass this in the log handler
to point out the fact that we expected something but it's null

As a bonus, a null object always gets printed in red because that's
the first color in object_colors
2020-05-20 18:27:09 +03:00
George Kiagiadakis
7428d20c94 proxy: add a wp_proxy_get_property() method to get a single pw property 2020-05-20 18:08:35 +03:00