Commit graph

32 commits

Author SHA1 Message Date
George Kiagiadakis
6f3a307e6f spa-pod: don't use assertion macro in code that needs to run always 2023-11-08 20:41:34 +02:00
George Kiagiadakis
9b8987e8c0 spa-pod: fix parser to be able to collect IDs as strings ('K') 2023-11-08 20:40:19 +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
Wim Taymans
3239c03e2f lib: assert non-NULL input for wp_spa_pod_equal
It should not be called with NULL values or it'll crash.
2022-01-21 13:55:26 +00:00
Julian Bouzas
bc76cb7d74
spa-pod: fix different architecture errors for boolean values 2022-01-09 10:22:47 +02:00
George Kiagiadakis
52c4839a8c spa-pod: accept NULL object/struct/pod in a property field
This is what the original SPA_POD_BUILDER_COLLECT() does as well
2021-10-13 11:51:22 +03:00
George Kiagiadakis
9dca92c698 spa-pod: add _filter() method 2021-10-13 11:10:32 +03:00
George Kiagiadakis
9e5aaccab0 spa-pod: add _fixate() method 2021-10-12 20:00:10 +03:00
Julian Bouzas
711d1ee686 spa-pod: add support for custom Id properties
Allows creating and parsing Pod Objects with custom properties.
2021-09-21 12:29:54 -04:00
Julian Bouzas
a12c41aca1 spa-pod: check if pod is valid before _parser_can_collect
Spotted with clang-tidy, avoids possible segfault if pod is NULL.
2021-06-07 11:33:21 -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
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
Julian Bouzas
419af5a228 spa-pod: respect the SPA size for long and int APIs
Fixes some issues for 32bit architectures
2021-05-12 11:53:31 -04:00
George Kiagiadakis
7eed2acd76 lib: documentation fixes 2021-03-04 19:10:10 +02:00
Julian Bouzas
dc2ad1f25d rename all foo_iterate APIs to foo_new_iterator
Avoids confusion with LUA iterate API
2021-02-05 11:33:23 -05:00
George Kiagiadakis
aa93ecf793 spa-pod: add the ability to specify Id properties as strings
Use the unused 'K' format letter in the varargs builder & parser methods
2021-01-15 16:30:02 +02:00
George Kiagiadakis
3762388831 spa-type: refactor
* Use a more complete API to introspect SPA types
* Avoid the need for the Tables enumeration; the tables
  are now registered with a string
* Avoid the need for initialization, work directly on spa_types
  and other static data
* Allow working with Object pods that are not Params;
  the PARAMS table was previously hardcoded in the pod implementation
* Add a different dynamic type registration system, closer to
  how spa type works. The only regression is that we can no longer
  register additional custom object fields (custom SPA_PROP_* for example),
  but this feature can be re-added later
2021-01-15 16:30:01 +02:00
George Kiagiadakis
7f40a8152d iterator: add version field in the methods struct
Similar to how pipewire interfaces are versioned.
Keeps the struct extensible without breaking ABI.
2020-11-16 11:16:35 +02:00
George Kiagiadakis
ea0b96073f spa-pod: make the wrap functions public, remove private.h and sort out the rest 2020-11-16 11:01:18 +02:00
Julian Bouzas
be8629fbec spa-pod: keep a reference of the pod in the ierator 2020-06-04 09:48:43 -04:00
Julian Bouzas
9728418b6d spa-pod: remove const-ness from API 2020-06-04 09:48:43 -04:00
Julian Bouzas
1e2dcb44ca spa-pod: set the type to regular when creating int spa pod 2020-06-04 09:48:43 -04:00
Julian Bouzas
671d748b4b spa-pod: remove _wrap_copy APIs from the private header 2020-06-04 09:48:43 -04:00
Julian Bouzas
e63ca28b3a spa-pod: add _new_wrap_const APIs 2020-06-04 09:48:43 -04:00
Julian Bouzas
b9acfcb237 spa-pod: rename spa pod _new_regular_wrap APIs to just _new_warp 2020-06-04 09:48:43 -04: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
17ee195902 spa-pod: rename wp_spa_pod_iterator_new to wp_spa_pod_iterate 2020-05-11 12:03:43 +03:00
Julian Bouzas
fe4bef8bbc spa-pod: fix constness and add get_object_type_name and get_choice_type_name 2020-04-21 16:11:05 -04:00
Julian Bouzas
058f8ae1e0 spa-pod: add wp_spa_pod_equal API 2020-04-21 09:38:36 -04: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
Julian Bouzas
8c209ecf48 lib: add spa pod API 2020-04-13 13:32:04 -04:00