mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-14 06:59:57 -05:00
Remove dynamic types
Do not use dynamic types anymore. The reason is that it's difficult: - to maintain a shared type database over a network. - the extra overhead when translating between processes and for maintaining the translation tables. - race conditions in translating in RT-threads, this is a problem because we want to make event streams. We now have simple enums with types and extension points for all types. This is also nicer to use in general. We don't need the mapper anymore or pass strings around as types. There is a parallel type info system to get more info about ids and enums and their hierarchy. It can also be used for debugging.
This commit is contained in:
parent
e6977fa178
commit
fca3e1d85d
162 changed files with 5200 additions and 7461 deletions
|
|
@ -24,34 +24,14 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/support/type-map.h>
|
||||
|
||||
/** Base for IO structures to interface with node ports */
|
||||
#define SPA_TYPE__IO SPA_TYPE_POINTER_BASE "IO"
|
||||
#define SPA_TYPE_IO_BASE SPA_TYPE__IO ":"
|
||||
|
||||
/** Base for control structures */
|
||||
#define SPA_TYPE_IO__Control SPA_TYPE_IO_BASE "Control"
|
||||
#define SPA_TYPE_IO_CONTROL_BASE SPA_TYPE_IO__Control ":"
|
||||
|
||||
/** Base for controlable properties */
|
||||
#define SPA_TYPE_IO__Prop SPA_TYPE_IO_BASE "Prop"
|
||||
#define SPA_TYPE_IO_PROP_BASE SPA_TYPE_IO__Prop ":"
|
||||
|
||||
/** An io area to exchange buffers with a port */
|
||||
#define SPA_TYPE_IO__Buffers SPA_TYPE_IO_BASE "Buffers"
|
||||
|
||||
/** IO area with clock information */
|
||||
#define SPA_TYPE_IO__Clock SPA_TYPE_IO_BASE "Clock"
|
||||
|
||||
/** IO area with latency information */
|
||||
#define SPA_TYPE_IO__Latency SPA_TYPE_IO_BASE "Latency"
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
/** Buffers IO area
|
||||
*
|
||||
* IO information for a port on a node. This is allocated
|
||||
* by the host and configured on all ports for which IO is requested.
|
||||
*/
|
||||
|
||||
struct spa_io_buffers {
|
||||
#define SPA_STATUS_OK 0
|
||||
#define SPA_STATUS_NEED_BUFFER (1<<0)
|
||||
|
|
@ -65,9 +45,6 @@ struct spa_io_buffers {
|
|||
|
||||
#define SPA_IO_BUFFERS_INIT (struct spa_io_buffers) { SPA_STATUS_OK, SPA_ID_INVALID, }
|
||||
|
||||
/** Information about requested range */
|
||||
#define SPA_TYPE_IO_CONTROL__Range SPA_TYPE_IO_CONTROL_BASE "Range"
|
||||
|
||||
/** A range, suitable for input ports that can suggest a range to output ports */
|
||||
struct spa_io_control_range {
|
||||
uint64_t offset; /**< offset in range */
|
||||
|
|
@ -92,25 +69,6 @@ struct spa_io_latency {
|
|||
uint64_t max; /**< max latency */
|
||||
};
|
||||
|
||||
struct spa_type_io {
|
||||
uint32_t Buffers;
|
||||
uint32_t ControlRange;
|
||||
uint32_t Prop;
|
||||
uint32_t Clock;
|
||||
uint32_t Latency;
|
||||
};
|
||||
|
||||
static inline void spa_type_io_map(struct spa_type_map *map, struct spa_type_io *type)
|
||||
{
|
||||
if (type->Buffers == 0) {
|
||||
type->Buffers = spa_type_map_get_id(map, SPA_TYPE_IO__Buffers);
|
||||
type->ControlRange = spa_type_map_get_id(map, SPA_TYPE_IO_CONTROL__Range);
|
||||
type->Prop = spa_type_map_get_id(map, SPA_TYPE_IO__Prop);
|
||||
type->Clock = spa_type_map_get_id(map, SPA_TYPE_IO__Clock);
|
||||
type->Latency = spa_type_map_get_id(map, SPA_TYPE_IO__Latency);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue