29 Commits

Author SHA1 Message Date
George Kiagiadakis
44a157b506 lib: object: add functions to test active and supported features 2023-11-08 12:08:30 +02:00
George Kiagiadakis
6bab78bf3f object: make wp_object_get_core() return itself if it's the core 2023-06-23 18:01:26 +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
Julian Bouzas
69c241c4b8 object: add ID property
This is a WirePlumber object unique ID, which comes very useful when identifying
objects in the Lua scripts.
2023-04-17 07:47:09 -04:00
Julian Bouzas
8f4a848223 object: abort queued transitions if current transition failed. 2022-02-21 09:37:44 -05:00
George Kiagiadakis
e04acbd2a0 docs: remove protected annotations from functions to show them in the docs 2021-12-22 17:09:20 +02:00
Julian Bouzas
93c0b48bd9 object: add new _abort_activation API
Allows aborting an object activation by returning a transition error for all
pending transitions.
2021-12-13 08:37:01 -05:00
Julian Bouzas
d28f1241cc object: advance pending transitions if activation fails 2021-06-03 09:38:19 -04: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
Julian Bouzas
8698d4f43a object: use weakref when advancing current transition
Fixes reference count leak when activating an object and transition fails
2021-06-01 13:46:52 -04:00
Julian Bouzas
efb0f83d1f object: use destroy notify to keep self alive while advancing transitions 2021-06-01 13:43:25 -04: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
c1f1614eb6 object: deactivate only the features that were previously active 2021-03-25 18:13:11 +02:00
Julian Bouzas
5e69a82d4b object: add wp_object_activate_closure API 2021-03-13 20:10:30 -05:00
George Kiagiadakis
18229e8265 spa-device: derive from WpProxy and manage child objects internally
port module-monitor to follow the changes
2021-01-21 09:42:07 +02:00
George Kiagiadakis
b94e54c469 object, pw-obj-mixin: fix warnings 2020-12-21 18:58:20 +02:00
George Kiagiadakis
36538a54b6 lib: add new WpObject base class
A base class for objects that can have optional
features enabled and disabled. The intention is to make
this the superclass of WpProxy.

Instead of following the augment() pattern of WpProxy,
this one follows the more advanced transition pattern
that has been previously implemented in WpSessionItem.
2020-11-13 19:54:48 +02: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
bd1c233f43 Revert "lib: object: allow also using static interfaces using the WpObject API"
This reverts commit daa49af541.
2019-04-28 11:55:46 +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
cb1b3ebfad proxy: expose pw properties as a spa_dict and store them in a pw_properties
Exposing a spa_dict is necessary to allow using native pipewire API
that deals with these properties.

The internal structure change avoids mem copies when we need to
return a spa_dict.

This commits also removes exposing internal info structures via the
properties mechanism. This needs more thinking...
2019-04-23 16:28:13 +03:00
George Kiagiadakis
daa49af541 lib: object: allow also using static interfaces using the WpObject API 2019-04-22 18:42:59 +03:00
George Kiagiadakis
55365e97c1 lib: proxy: make the pipewire property getter an interface on WpObject
We are going to use this in other object types as well
2019-04-22 12:44:42 +03:00
George Kiagiadakis
ce43cf5f0c refactoring around the registries
* make the registries available as dynamic interfaces of the core
* improve a bit the C API of WpObject & WpInterfaceImpl
2019-04-17 19:09:39 +03:00
George Kiagiadakis
96d801803c switch all headers to use SPDX-License-Identifier 2019-04-12 12:53:54 +03:00
George Kiagiadakis
a50bb17ed6 object: error is allocated by the callee (and inferred) 2019-04-11 09:57:04 +03:00
George Kiagiadakis
9d4731d029 lib: begin working on a library to allow implementing policy plugins 2019-04-10 12:32:51 +03:00