20 Commits

Author SHA1 Message Date
George Kiagiadakis
67f9f63520 Merge branch '0.4' into next 2023-09-01 19:12:20 +03:00
Tom A. Wagner
6e81dc7a66 docs: Add missing '\since' attributes to types and functions that have been added in versions later than 0.4.0 2023-08-30 11:20:06 +02:00
George Kiagiadakis
4736d56557 log: implement a log topics system, like pipewire
The intention is to make checks for enabled log topics faster.

Every topic has its own structure that is statically defined in the file
where the logs are printed from. The structure is initialized transparently
when it is first used and it contains all the log level flags for the levels
that this topic should print messages. It is then checked on the wp_log()
macro before printing the message.

Topics from SPA/PipeWire are also handled natively, so messages are printed
directly without checking if the topic is enabled, since the PipeWire and SPA
macros do the checking themselves.

Messages coming from GLib are checked inside the handler.

An internal WpLogFields object is used to manage the state of each log
message, populating all the fields appropriately from the place they
are coming from (wp_log, spa_log, glib log), formatting the message and
then printing it. For printing to the journald, we still use the glib
message handler, converting all the needed fields to GLogField on demand.
That message handler does not do any checks for the topic or the level, so
we can just call it to send the message.
2023-05-16 20:42:28 +03:00
Ashok Sidipotu
e2e3c5a69c wp-factory: enumerate pw_factory objects
pw_factory objects allow permissions to be set on its clients,
wp-factory exposes this funtionality to wireplumber clients.
2021-10-19 05:46:46 +00:00
George Kiagiadakis
f6dacf7cf7 lib: remove WpFactory (no longer used) 2020-05-13 15:29:17 +03:00
George Kiagiadakis
9ca342f89f debug: update all library code to use the new debug system
+ enable the new log writer on the executables
+ enable structured logging in the tests
2020-04-14 18:31:17 +03:00
George Kiagiadakis
d4973363ac lib: add extensive API documentation 2020-02-19 10:43:07 +02:00
George Kiagiadakis
c46a48d13f registry: hide again the WpCore struct, separate registry and core better 2020-02-17 18:31:03 +02: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
George Kiagiadakis
d39307ee70 lib/wp: move internal functions and declarations to a private.h header 2019-11-07 20:44:55 +02:00
Julian Bouzas
54721da7c4 Fix doc warnings 2019-07-12 08:20:08 -04:00
Julian Bouzas
cf0e68a0f4 factory: remove unneeded sync construction API 2019-06-28 12:34:03 -04:00
Julian Bouzas
6fbf2527fb factory: add async support 2019-06-24 10:51:40 -04:00
George Kiagiadakis
36bc1795ca Relicense to MIT 2019-05-31 12:13:12 +03:00
George Kiagiadakis
1b6d9720c8 core: allow having a flat list of globals with the same key
and also implement
* global-added/removed signals
* a foreach function to iterate through globals
* registering modules and factories with the same key
2019-05-26 18:58:19 +03:00
George Kiagiadakis
bf60614032 improve debug statements a bit 2019-05-26 12:36:20 +03:00
Julian Bouzas
2fd0f63118 factory: don't use smart pointer when creating a factory 2019-05-23 14:09:59 -04:00
George Kiagiadakis
df48fd897d module/factory: add a get_core() method on both 2019-05-22 13:15:49 +03:00
George Kiagiadakis
06db0e414a factory: improve API and hide its implementation (better for introspection) 2019-05-22 13:03:24 +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