Commit Graph

22 Commits

Author SHA1 Message Date
George Kiagiadakis
eb6f569be8 Merge branch 'master' into next 2023-10-24 11:09:52 +03:00
George Kiagiadakis
ffd6c0dfb9 docs: fix warnings related to recent policy-dsp changes
- remove dsp.rst, since it's empty and not in the toctree
- fix g-i function param annotation
2023-10-12 19:24:26 +03:00
Dmitry Sharshakov
2ae1b3cbd9 api: module: support loading arguments from file 2023-09-22 19:35:10 +03: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
George Kiagiadakis
cef9b00daf docs: impl-module: add since markers and improve the Lua doc appearence 2021-08-19 17:58:07 +03:00
Arun Raghavan
032aa8edf2 wp: Add a WpImplModule for loading modules in WirePlumber context 2021-08-10 11:33:01 -04:00
George Kiagiadakis
9f50117fa7 lib: remove module.{c,h} 2021-02-25 17:12:04 +02:00
George Kiagiadakis
37134df7c8 iterator: make private stuff public, cleanup private.h further
There is no good reason to keep them private
2020-11-15 20:26:15 +02: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
32859356e8 module: add annotations in wp_module_load() 2020-04-22 17:06:29 +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
George Kiagiadakis
36bc1795ca Relicense to MIT 2019-05-31 12:13:12 +03:00
George Kiagiadakis
98fe322897 meson: export the module & config dirs to the C code
This allows loading of config and modules when deployed in
the target system without setting environment variables.
2019-05-29 17:36:22 +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
George Kiagiadakis
df48fd897d module/factory: add a get_core() method on both 2019-05-22 13:15:49 +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