Commit graph

432 commits

Author SHA1 Message Date
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
Julian Bouzas
1f4d88b915 configuration: fix memleak when reloading 2020-05-19 10:18:51 -04:00
Julian Bouzas
d9ffc1c318 core: finish all pending tasks when core proxy is destroyed 2020-05-19 10:18:51 -04:00
Julian Bouzas
24cfa053eb object-manager: release interest when destroying iterator 2020-05-19 10:18:51 -04:00
George Kiagiadakis
49c6d00e07 session: add a _get_name() method 2020-05-16 12:54:36 +03:00
Julian Bouzas
e1b85e1fe4 session-item: check for core before adding closure if proxy is destroyed 2020-05-15 08:21:49 -04:00
George Kiagiadakis
a2b84e27d1 session: rename the default source/sink controls to have shorter names
+ use a more correct naming scheme to match the one from Spa
+ remove the default video source, since we now use a different
 session for video
2020-05-14 17:31:24 +03:00
George Kiagiadakis
5c8a462a4a debug: use levels 1-5 in WIREPLUMBER_DEBUG
This makes WIREPLUMBER_DEBUG behave just like PIPEWIRE_DEBUG.
Same levels, same syntax, easier for users.

ERROR & CRITICAL are always printed, as they should; there is no point
in disabling them, since:
- ERRORs are always fatal and should never ever happen
- CRITICALs are assertion failures and indicate bugs that need to be fixed
2020-05-14 17:00:55 +03:00
George Kiagiadakis
a45d47f519 debug: shorten a bit the length of the messages
* use a short level name, like pipewire does
* color the timestamp to compensate for the loss of the visible level name
* use 18 chars for the category
2020-05-14 16:37:38 +03:00
George Kiagiadakis
5eecc5b68a object-manager: remove deprecated API 2020-05-14 16:24:34 +03:00
George Kiagiadakis
1e4a79c80e registry: do not expose early removed globals to object managers 2020-05-14 10:27:03 +03:00
George Kiagiadakis
9b0417cb68 core: remove warning on the error callback
libpipewire already prints this, so we get it duplicated on the log
2020-05-13 19:56:55 +03:00
George Kiagiadakis
d89c4ecd94 object-manager: don't try to install if there is no core
This happens when the daemon fails to connect and the
not installed object managers try to get installed, but
the weak ref to the core is already gone
2020-05-13 19:52:25 +03:00
George Kiagiadakis
151480f3e4 object-manager: wait until globals appear before emitting "installed"
object managers that are registered a bit early (such as the one in
wireplumber-cli) have no use if they are declared as installed before
any globals appear. After the initial registry startup, there should
be at least 1 global, the core (id=0), so even if this client has
no access to any object, the object manager should be able to
finish its installation successfully
2020-05-13 19:29:08 +03:00
George Kiagiadakis
f6dacf7cf7 lib: remove WpFactory (no longer used) 2020-05-13 15:29:17 +03:00
George Kiagiadakis
8e87bd323c core: fix disconnecting when pipewire quits 2020-05-13 15:20:26 +03:00
Julian Bouzas
5ea7e6fc0b object-manager: emit the object-removed signal after the object is removed 2020-05-12 13:37:36 -04: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
e63bf86995 lib: add a WpPlugin class
This serves as a base class for daemon plugins, which are implemented
inside modules
2020-05-12 18:18:21 +03:00
George Kiagiadakis
bfe76bf1d1 debug: honor WIREPLUMBER_DEBUG and ignore PIPEWIRE_DEBUG in pw_log
And also provide a way to disable this integration at runtime to
get pipewire's log back, with WIREPLUMBER_NO_PW_LOG=1
2020-05-12 18:16:55 +03:00
George Kiagiadakis
17c1eb3fac debug: downgrade SPA error & warn -> GLib warn & msg
The GLib error level is fatal, but pipewire doesn't use it that way.
Also, the GLib critical level is meant only for programming errors
(assertions) and not for runtime errors. warn & msg levels really
fit well with the error & warn, as they are being used in pipewire
currently.
2020-05-12 18:16:55 +03:00
Julian Bouzas
30ecff5a51 lib: remove deprecated base endpoint and policy APIs 2020-05-12 10:03:31 -04:00
George Kiagiadakis
66a0bf6093 lib: implement a wp_init() function 2020-05-11 15:45:09 +03:00
Julian Bouzas
17ee195902 spa-pod: rename wp_spa_pod_iterator_new to wp_spa_pod_iterate 2020-05-11 12:03:43 +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