mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -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
|
|
@ -26,32 +26,8 @@ extern "C" {
|
|||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/pod/event.h>
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/node/node.h>
|
||||
|
||||
#define SPA_TYPE_EVENT__Node SPA_TYPE_EVENT_BASE "Node"
|
||||
#define SPA_TYPE_EVENT_NODE_BASE SPA_TYPE_EVENT__Node ":"
|
||||
|
||||
#define SPA_TYPE_EVENT_NODE__Error SPA_TYPE_EVENT_NODE_BASE "Error"
|
||||
#define SPA_TYPE_EVENT_NODE__Buffering SPA_TYPE_EVENT_NODE_BASE "Buffering"
|
||||
#define SPA_TYPE_EVENT_NODE__RequestRefresh SPA_TYPE_EVENT_NODE_BASE "RequestRefresh"
|
||||
|
||||
struct spa_type_event_node {
|
||||
uint32_t Error;
|
||||
uint32_t Buffering;
|
||||
uint32_t RequestRefresh;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_event_node_map(struct spa_type_map *map, struct spa_type_event_node *type)
|
||||
{
|
||||
if (type->Error == 0) {
|
||||
type->Error = spa_type_map_get_id(map, SPA_TYPE_EVENT_NODE__Error);
|
||||
type->Buffering = spa_type_map_get_id(map, SPA_TYPE_EVENT_NODE__Buffering);
|
||||
type->RequestRefresh = spa_type_map_get_id(map, SPA_TYPE_EVENT_NODE__RequestRefresh);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue