pipewire/doc/dox/api/spa-design.dox

36 lines
1.1 KiB
Text
Raw Normal View History

/** \page page_spa_design SPA Design
2020-06-09 17:08:26 +02:00
2020-06-09 17:29:40 +02:00
# Conventions
## Types
Types are generally divided into two categories:
- String types: They identify interfaces and highlevel object types.
2022-05-08 17:06:28 +00:00
- Integer types: These are enumerations used in the parts where high
2020-06-09 17:29:40 +02:00
performance/ease of use/low space overhead is needed.
2024-01-28 10:07:44 +00:00
The SPA type is system is static and very simple but still allows you
2020-06-09 17:29:40 +02:00
to make and introspect complex object type hierarchies.
See the type system docs for more info.
2022-05-08 17:06:28 +00:00
## Error Codes
2020-06-09 17:29:40 +02:00
SPA uses negative integers as errno style error codes. Functions that return an
int result code generated an error when < 0. `spa_strerror()` can be used to
get a string representation of the error code.
SPA also has a way to encode asynchronous results. This is done by setting a
high bit (bit 30, the `ASYNC_BIT`) in the result code and a sequence number
in the lower bits. This result is normally identified as a positive success
result code and the sequence number can later be matched to the completion
event.
2022-05-08 17:06:28 +00:00
## Useful Macros
2020-06-09 17:29:40 +02:00
SPA comes with some useful macros defined in `<spa/utils/defs.h>` and a
2022-05-08 17:06:28 +00:00
number of utility functions, see \ref spa_utils.
*/