2023-02-08 18:12:00 +01:00
|
|
|
/* PipeWire */
|
|
|
|
|
/* SPDX-FileCopyrightText: Copyright © 2020 Wim Taymans */
|
|
|
|
|
/* SPDX-License-Identifier: MIT */
|
2021-06-18 22:50:32 +02:00
|
|
|
|
2022-02-04 15:15:42 +01:00
|
|
|
#ifndef PULSE_SERVER_REMAP_H
|
|
|
|
|
#define PULSE_SERVER_REMAP_H
|
2021-06-18 22:50:32 +02:00
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
#include <spa/utils/string.h>
|
|
|
|
|
|
|
|
|
|
struct str_map {
|
|
|
|
|
const char *pw_str;
|
|
|
|
|
const char *pa_str;
|
|
|
|
|
const struct str_map *child;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern const struct str_map media_role_map[];
|
|
|
|
|
|
2022-02-04 15:15:42 +01:00
|
|
|
extern const struct str_map props_key_map[];
|
|
|
|
|
|
2021-06-18 22:50:32 +02:00
|
|
|
static inline const struct str_map *str_map_find(const struct str_map *map, const char *pw, const char *pa)
|
|
|
|
|
{
|
|
|
|
|
size_t i;
|
|
|
|
|
for (i = 0; map[i].pw_str; i++)
|
|
|
|
|
if ((pw && spa_streq(map[i].pw_str, pw)) ||
|
|
|
|
|
(pa && spa_streq(map[i].pa_str, pa)))
|
|
|
|
|
return &map[i];
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-04 15:15:42 +01:00
|
|
|
#endif /* PULSE_SERVER_REMAP_H */
|