mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-15 07:00:05 -05:00
types: add function to convert audio channel short name to type
Move some functions around for this
This commit is contained in:
parent
b5cccdb382
commit
41f9abc733
5 changed files with 27 additions and 9 deletions
|
|
@ -20,10 +20,6 @@ extern "C" {
|
|||
#define SPA_TYPE_ROOT spa_types
|
||||
#endif
|
||||
|
||||
static inline bool spa_type_is_a(const char *type, const char *parent)
|
||||
{
|
||||
return type != NULL && parent != NULL && strncmp(type, parent, strlen(parent)) == 0;
|
||||
}
|
||||
|
||||
#include <spa/utils/type.h>
|
||||
#include <spa/utils/enum-types.h>
|
||||
|
|
|
|||
|
|
@ -123,6 +123,19 @@ struct spa_type_info {
|
|||
const struct spa_type_info *values;
|
||||
};
|
||||
|
||||
static inline bool spa_type_is_a(const char *type, const char *parent)
|
||||
{
|
||||
return type != NULL && parent != NULL && strncmp(type, parent, strlen(parent)) == 0;
|
||||
}
|
||||
|
||||
static inline const char *spa_type_short_name(const char *name)
|
||||
{
|
||||
const char *h;
|
||||
if ((h = strrchr(name, ':')) != NULL)
|
||||
name = h + 1;
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* \}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue