Commit Graph

19 Commits

Author SHA1 Message Date
George Kiagiadakis
9970450bfa object.h: don't include core.h 2023-06-23 18:01:26 +03:00
George Kiagiadakis
8a8cd97ca8 core: make the object registration functions public
This allows registering arbitrary objects on the core's registry and
finding them later, without having to add API for each and every object.

I think this is useful enough to have it public, even though it's
probably not going to be used that much... The rationale here is to
allow registering custom component loaders without having to make them
subclass WpPlugin or to create custom API for registering component
loaders specifically.

Also, remove the wp_plugin_register() and wp_si_factory_register()
functions, since they are not going to be used much in the future.
The idea is to let the component loader do the registration under the
scenes, as the component is getting loaded.
2023-06-20 12:39:29 +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
Jason Francis
ed8346e77d docs: Add brief descriptions to all functions
This ensures all of these functions are picked up by g-ir-scanner.
2021-06-02 17:38:34 +00:00
George Kiagiadakis
b812e912d2 docs: fix C API documentation to work nicely with doxygen & sphinx 2021-05-25 14:19:53 +03:00
Raghavendra
d692f06f0d docs: api: Replace hotdoc specific commands with Doxygen specific commands 2021-05-25 14:19:53 +03:00
George Kiagiadakis
257d5cba47 wp: rename debug.{h,c} to log.{h,c}
Also rename the intermediate lua api table WpDebug -> WpLog

Keeps things more consistent with the function names (wp_log*),
with the lua api (Log.*) and with pipewire using log.{h,c} as well.
After all, these functions are for logging...
2021-05-06 15:50:07 +03:00
George Kiagiadakis
f61e292959 plugin: inherit from WpObject
* use the activate/deactivate system from WpObject,
  which allows async activation and error reporting
* drop 'module' property, use 'core' from WpObject
2021-02-03 17:16:51 +02:00
George Kiagiadakis
bf71b73ae2 plugin: add a method to find plugins easily
Similar to wp_si_factory_find()
2021-01-26 16:28:22 +02:00
George Kiagiadakis
e9c38f365e plugin: debug activation & deactivation 2021-01-21 09:42:07 +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
Julian Bouzas
bc17aaa397 plugin: add name property 2020-10-22 08:40:27 -04: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
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
George Kiagiadakis
43365715f7 many crash fixes 2019-04-28 14:20:00 +03:00
George Kiagiadakis
e16e66de2d lib: object/interface: do not (transfer full) interfaces and objects 2019-04-26 13:19:18 +03:00
George Kiagiadakis
4fcdb931be proxy/plugin: hold a pointer to the core instead of the respective registry
This makes it more intuitive to get other attached interfaces
from the core
2019-04-22 17:48:02 +03:00
George Kiagiadakis
9e0e8f62ae plugin: implement default_handle_pw_proxy 2019-04-16 18:27:34 +03:00
George Kiagiadakis
6f6e2b0e3e lib: implement plugin mechanism and a basic proxy object 2019-04-12 12:37:36 +03:00