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
|
|
@ -66,8 +66,8 @@ struct spa_handle {
|
|||
* handles.
|
||||
*/
|
||||
struct spa_interface_info {
|
||||
const char *type; /*< the type of the interface, can be
|
||||
* used to get the interface */
|
||||
uint32_t type; /*< the type of the interface, can be
|
||||
* used to get the interface */
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -75,18 +75,18 @@ struct spa_interface_info {
|
|||
* a factory. It can be extra information or interfaces such as logging.
|
||||
*/
|
||||
struct spa_support {
|
||||
const char *type; /*< the type of the support item */
|
||||
void *data; /*< specific data for the item */
|
||||
uint32_t type; /*< the type of the support item */
|
||||
void *data; /*< specific data for the item */
|
||||
};
|
||||
|
||||
/** Find a support item of the given type */
|
||||
static inline void *spa_support_find(const struct spa_support *support,
|
||||
uint32_t n_support,
|
||||
const char *type)
|
||||
uint32_t type)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < n_support; i++) {
|
||||
if (strcmp(support[i].type, type) == 0)
|
||||
if (support[i].type == type)
|
||||
return support[i].data;
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue