mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
More type fixes
Param ids and IO ids are now simple enums. Move some type info in one place, delete some type-info files Fix type debug Make audio layout an enum Mark more enums as enums in types so they show us with their names in the debug.
This commit is contained in:
parent
93a8747a44
commit
d26aecfef2
82 changed files with 869 additions and 1118 deletions
|
|
@ -38,7 +38,6 @@ spa_debug_format_value(const struct spa_type_info *info,
|
|||
fprintf(stderr, "%s", *(int32_t *) body ? "true" : "false");
|
||||
break;
|
||||
case SPA_ID_Enum:
|
||||
case SPA_ID_Int:
|
||||
{
|
||||
const char *str = spa_debug_type_find_name(info, *(int32_t *) body);
|
||||
char tmp[64];
|
||||
|
|
@ -53,6 +52,9 @@ spa_debug_format_value(const struct spa_type_info *info,
|
|||
fprintf(stderr, "%s", str);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_Int:
|
||||
fprintf(stderr, "%d", *(int32_t *) body);
|
||||
break;
|
||||
case SPA_ID_Long:
|
||||
fprintf(stderr, "%" PRIi64, *(int64_t *) body);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
{
|
||||
struct spa_pod_pointer_body *b = body;
|
||||
spa_debug("%*s" "Pointer %s %p", indent, "",
|
||||
spa_debug_type_find_name(info, b->type), b->value);
|
||||
spa_debug_type_find_name(spa_types, b->type), b->value);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_Rectangle:
|
||||
|
|
@ -89,8 +89,12 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
{
|
||||
struct spa_pod_array_body *b = body;
|
||||
void *p;
|
||||
spa_debug("%*s" "Array: child.size %d, child.type %d", indent, "",
|
||||
b->child.size, b->child.type);
|
||||
const struct spa_type_info *ti = spa_debug_type_find(info, b->child.type);
|
||||
|
||||
spa_debug("%*s" "Array: child.size %d, child.type %s", indent, "",
|
||||
b->child.size, ti ? ti->name : "unknown");
|
||||
|
||||
info = ti ? ti->values : info;
|
||||
|
||||
SPA_POD_ARRAY_BODY_FOREACH(b, size, p)
|
||||
spa_debug_pod_value(indent + 2, info, b->child.type, p, b->child.size);
|
||||
|
|
@ -112,8 +116,11 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
|
||||
spa_debug("%*s" "Object: size %d, id %s, type %s", indent, "", size,
|
||||
spa_debug_type_find_name(info, b->id), ti ? ti->name : "unknown");
|
||||
|
||||
info = ti ? ti->values : info;
|
||||
|
||||
SPA_POD_OBJECT_BODY_FOREACH(b, size, p)
|
||||
spa_debug_pod_value(indent + 2, ti ? ti->values : NULL,
|
||||
spa_debug_pod_value(indent + 2, info,
|
||||
p->type, SPA_POD_BODY(p), p->size);
|
||||
break;
|
||||
}
|
||||
|
|
@ -122,13 +129,18 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
struct spa_pod_prop_body *b = body;
|
||||
void *alt;
|
||||
int i;
|
||||
const struct spa_type_info *ti = spa_debug_type_find(info, b->key);
|
||||
|
||||
spa_debug("%*s" "Prop: key %s, flags %d", indent, "",
|
||||
spa_debug_type_find_name(info, b->key), b->flags);
|
||||
ti ? ti->name : "unknown", b->flags);
|
||||
|
||||
info = ti ? ti->values : info;
|
||||
|
||||
if (b->flags & SPA_POD_PROP_FLAG_UNSET)
|
||||
spa_debug("%*s" "Unset (Default):", indent + 2, "");
|
||||
else
|
||||
spa_debug("%*s" "Value: size %u", indent + 2, "", b->value.size);
|
||||
|
||||
spa_debug_pod_value(indent + 4, info, b->value.type, SPA_POD_BODY(&b->value),
|
||||
b->value.size);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,8 @@ install_headers(spa_node_headers,
|
|||
spa_param_headers = [
|
||||
'param/param.h',
|
||||
'param/props.h',
|
||||
'param/buffers.h',
|
||||
'param/meta.h',
|
||||
'param/io.h',
|
||||
'param/format.h',
|
||||
'param/type-info.h',
|
||||
]
|
||||
|
||||
install_headers(spa_param_headers,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/pod/pod.h>
|
||||
|
||||
/** Buffers IO area
|
||||
*
|
||||
|
|
@ -32,6 +33,17 @@ extern "C" {
|
|||
* by the host and configured on all ports for which IO is requested.
|
||||
*/
|
||||
|
||||
/** Different IO area types */
|
||||
enum spa_io_type {
|
||||
SPA_IO_BASE,
|
||||
|
||||
SPA_IO_Buffers,
|
||||
SPA_IO_ControlRange,
|
||||
SPA_IO_Clock,
|
||||
SPA_IO_Latency,
|
||||
SPA_IO_Events,
|
||||
};
|
||||
|
||||
struct spa_io_buffers {
|
||||
#define SPA_STATUS_OK 0
|
||||
#define SPA_STATUS_NEED_BUFFER (1<<0)
|
||||
|
|
@ -69,6 +81,11 @@ struct spa_io_latency {
|
|||
uint64_t max; /**< max latency */
|
||||
};
|
||||
|
||||
/** event stream */
|
||||
struct spa_io_events {
|
||||
struct spa_pod_sequence sequence; /**< sequence of timed events */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -28,24 +28,12 @@ extern "C" {
|
|||
#include <spa/pod/parser.h>
|
||||
#include <spa/param/audio/format.h>
|
||||
|
||||
#if 0
|
||||
#define SPA_TYPE_FORMAT__Audio SPA_TYPE_FORMAT_BASE "Audio"
|
||||
#define SPA_TYPE_FORMAT_AUDIO_BASE SPA_TYPE_FORMAT__Audio ":"
|
||||
|
||||
#define SPA_TYPE_FORMAT_AUDIO__format SPA_TYPE_FORMAT_AUDIO_BASE "format"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__flags SPA_TYPE_FORMAT_AUDIO_BASE "flags"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__layout SPA_TYPE_FORMAT_AUDIO_BASE "layout"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__rate SPA_TYPE_FORMAT_AUDIO_BASE "rate"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__channels SPA_TYPE_FORMAT_AUDIO_BASE "channels"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__channelMask SPA_TYPE_FORMAT_AUDIO_BASE "channel-mask"
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_raw *info)
|
||||
{
|
||||
return spa_pod_object_parse(format,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", &info->format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", &info->layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", &info->layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", &info->rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", &info->channels,
|
||||
":", SPA_FORMAT_AUDIO_flags, "?i", &info->flags,
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_BUFFERS_TYPES_H__
|
||||
#define __SPA_PARAM_BUFFERS_TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param-types.h>
|
||||
|
||||
#define SPA_TYPE_PARAM__Buffers SPA_TYPE_PARAM_BASE "Buffers"
|
||||
#define SPA_TYPE_PARAM_BUFFERS_BASE SPA_TYPE_PARAM__Buffers ":"
|
||||
|
||||
#define SPA_TYPE_PARAM_BUFFERS__buffers SPA_TYPE_PARAM_BUFFERS_BASE "buffers"
|
||||
#define SPA_TYPE_PARAM_BUFFERS__blocks SPA_TYPE_PARAM_BUFFERS_BASE "blocks"
|
||||
|
||||
#define SPA_TYPE_PARAM__BlockInfo SPA_TYPE_PARAM_BASE "BlockInfo"
|
||||
#define SPA_TYPE_PARAM_BLOCK_INFO_BASE SPA_TYPE_PARAM__BlockInfo ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_buffers_items[] = {
|
||||
{ SPA_PARAM_BUFFERS_buffers, SPA_TYPE_PARAM_BUFFERS_BASE "buffers", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_blocks, SPA_TYPE_PARAM_BUFFERS_BASE "blocks", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_size, SPA_TYPE_PARAM_BLOCK_INFO_BASE "size", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_stride, SPA_TYPE_PARAM_BLOCK_INFO_BASE "stride", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_align, SPA_TYPE_PARAM_BLOCK_INFO_BASE "align", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
static const struct spa_type_info spa_type_param_buffers[] = {
|
||||
{ SPA_ID_OBJECT_ParamBuffers, SPA_TYPE_PARAM__Buffers, SPA_ID_Object,
|
||||
spa_type_param_buffers_items },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_BUFFERS_TYPES_H__ */
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_BUFFERS_H__
|
||||
#define __SPA_PARAM_BUFFERS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamBuffers */
|
||||
enum spa_param_buffers {
|
||||
SPA_PARAM_BUFFERS_buffers, /**< number of buffers */
|
||||
SPA_PARAM_BUFFERS_blocks, /**< number of data blocks per buffer */
|
||||
SPA_PARAM_BUFFERS_size, /**< size of a data block memory */
|
||||
SPA_PARAM_BUFFERS_stride, /**< stride of data block memory */
|
||||
SPA_PARAM_BUFFERS_align, /**< alignment of data block memory */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_BUFFERS_H__ */
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_IO_H__
|
||||
#define __SPA_PARAM_IO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/support/type-map.h>
|
||||
|
||||
/** type ID of property, uniquely identifies the io area for a port */
|
||||
#define SPA_TYPE_PARAM_IO__id SPA_TYPE_PARAM_IO_BASE "id"
|
||||
/** size of the io area for a port */
|
||||
#define SPA_TYPE_PARAM_IO__size SPA_TYPE_PARAM_IO_BASE "size"
|
||||
|
||||
/** enumerate buffer io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Buffers SPA_TYPE_PARAM_ID_IO_BASE "Buffers"
|
||||
/* an io area to exchange buffers */
|
||||
#define SPA_TYPE_PARAM_IO__Buffers SPA_TYPE_PARAM_IO_BASE "Buffers"
|
||||
|
||||
/** enumerate Control io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Control SPA_TYPE_PARAM_ID_IO_BASE "Control"
|
||||
/* an io area to exchange control information */
|
||||
#define SPA_TYPE_PARAM_IO__Control SPA_TYPE_PARAM_IO_BASE "Control"
|
||||
|
||||
/** enumerate input or output properties */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Props SPA_TYPE_PARAM_ID_IO_BASE "Props"
|
||||
#define SPA_TYPE_PARAM_ID_IO_PROPS_BASE SPA_TYPE_PARAM_ID_IO__Props ":"
|
||||
/** enumerate input property io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO_PROPS__In SPA_TYPE_PARAM_ID_IO_PROPS_BASE "In"
|
||||
/** enumerate output property io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO_PROPS__Out SPA_TYPE_PARAM_ID_IO_PROPS_BASE "Out"
|
||||
|
||||
/* an io area to exchange properties. Contents can include
|
||||
* SPA_TYPE_PARAM__PropInfo */
|
||||
#define SPA_TYPE_PARAM_IO__Prop SPA_TYPE_PARAM_IO_BASE "Prop"
|
||||
#define SPA_TYPE_PARAM_IO_PROP_BASE SPA_TYPE_PARAM_IO__Prop ":"
|
||||
|
||||
/** enumerate clock io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Clock SPA_TYPE_PARAM_ID_IO_BASE "Clock"
|
||||
/* an io area to exchange clock information */
|
||||
#define SPA_TYPE_PARAM_IO__Clock SPA_TYPE_PARAM_IO_BASE "Clock"
|
||||
|
||||
struct spa_type_param_io {
|
||||
uint32_t id; /**< id to configure the io area */
|
||||
uint32_t size; /**< size of io area */
|
||||
uint32_t idBuffers; /**< id to enumerate buffer io */
|
||||
uint32_t Buffers; /**< object type of buffer io area */
|
||||
uint32_t idControl; /**< id to enumerate control io */
|
||||
uint32_t Control; /**< object type of Control area */
|
||||
uint32_t idPropsIn; /**< id to enumerate input properties io */
|
||||
uint32_t idPropsOut; /**< id to enumerate output properties io */
|
||||
uint32_t Prop; /**< object type of property area */
|
||||
uint32_t idClock; /**< id to enumerate clock io */
|
||||
uint32_t Clock; /**< object type of clock io area */
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_param_io_map(struct spa_type_map *map,
|
||||
struct spa_type_param_io *type)
|
||||
{
|
||||
if (type->id == 0) {
|
||||
type->id = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__id);
|
||||
type->size = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__size);
|
||||
type->idBuffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO__Buffers);
|
||||
type->Buffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Buffers);
|
||||
type->idControl = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO__Control);
|
||||
type->Control = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Control);
|
||||
type->idPropsIn = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO_PROPS__In);
|
||||
type->idPropsOut = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO_PROPS__Out);
|
||||
type->Prop = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Prop);
|
||||
type->idClock = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO__Clock);
|
||||
type->Clock = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Clock);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_IO_H__ */
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_IO_H__
|
||||
#define __SPA_PARAM_IO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamIO */
|
||||
enum spa_param_io {
|
||||
SPA_PARAM_IO_id, /**< type ID, uniquely identifies the io area */
|
||||
SPA_PARAM_IO_size, /**< size of the io area */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_IO_H__ */
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_META_H__
|
||||
#define __SPA_PARAM_META_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <fcntl.h> /* for off_t */
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/support/type-map.h>
|
||||
|
||||
#define SPA_TYPE_PARAM__Meta SPA_TYPE_PARAM_BASE "Meta"
|
||||
#define SPA_TYPE_PARAM_META_BASE SPA_TYPE_PARAM__Meta ":"
|
||||
#define SPA_TYPE_PARAM_META__type SPA_TYPE_PARAM_META_BASE "type"
|
||||
#define SPA_TYPE_PARAM_META__size SPA_TYPE_PARAM_META_BASE "size"
|
||||
|
||||
struct spa_type_param_meta {
|
||||
uint32_t Meta;
|
||||
uint32_t type;
|
||||
uint32_t size;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_param_meta_map(struct spa_type_map *map,
|
||||
struct spa_type_param_meta *type)
|
||||
{
|
||||
if (type->Meta == 0) {
|
||||
size_t i;
|
||||
#define OFF(n) offsetof(struct spa_type_param_meta, n)
|
||||
static struct { off_t offset; const char *type; } tab[] = {
|
||||
{ OFF(Meta), SPA_TYPE_PARAM__Meta },
|
||||
{ OFF(type), SPA_TYPE_PARAM_META__type },
|
||||
{ OFF(size), SPA_TYPE_PARAM_META__size },
|
||||
};
|
||||
#undef OFF
|
||||
for (i = 0; i < SPA_N_ELEMENTS(tab); i++)
|
||||
*SPA_MEMBER(type, tab[i].offset, uint32_t) = spa_type_map_get_id(map, tab[i].type);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_META_H__ */
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_META_H__
|
||||
#define __SPA_PARAM_META_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamMeta */
|
||||
enum spa_param_meta {
|
||||
SPA_PARAM_META_type, /**< the metadata, one of enum spa_meta_type */
|
||||
SPA_PARAM_META_size, /**< the expected maximum size the meta */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_META_H__ */
|
||||
|
|
@ -41,6 +41,8 @@ extern "C" {
|
|||
/* object with supported parameter id */
|
||||
#define SPA_TYPE_PARAM__List SPA_TYPE_PARAM_BASE "List"
|
||||
#define SPA_TYPE_PARAM_LIST_BASE SPA_TYPE_PARAM__List ":"
|
||||
|
||||
|
||||
#define SPA_TYPE_PARAM_LIST__id SPA_TYPE_PARAM_LIST_BASE "id"
|
||||
|
||||
/** Enum Property info */
|
||||
|
|
|
|||
|
|
@ -26,11 +26,43 @@ extern "C" {
|
|||
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
/** different parameter types that can be queried */
|
||||
enum spa_param_type {
|
||||
SPA_PARAM_List, /**< available params */
|
||||
SPA_PARAM_PropInfo, /**< property information */
|
||||
SPA_PARAM_Props, /**< properties */
|
||||
SPA_PARAM_EnumFormat, /**< available formats */
|
||||
SPA_PARAM_Format, /**< configured format */
|
||||
SPA_PARAM_Buffers, /**< buffer configurations */
|
||||
SPA_PARAM_Meta, /**< allowed metadata for buffers */
|
||||
SPA_PARAM_IO, /**< configurable IO areas */
|
||||
};
|
||||
|
||||
/** Properties for SPA_ID_OBJECT_ParamList */
|
||||
enum spa_param_list {
|
||||
SPA_PARAM_LIST_id, /**< id of the supported list param */
|
||||
};
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamBuffers */
|
||||
enum spa_param_buffers {
|
||||
SPA_PARAM_BUFFERS_buffers, /**< number of buffers */
|
||||
SPA_PARAM_BUFFERS_blocks, /**< number of data blocks per buffer */
|
||||
SPA_PARAM_BUFFERS_size, /**< size of a data block memory */
|
||||
SPA_PARAM_BUFFERS_stride, /**< stride of data block memory */
|
||||
SPA_PARAM_BUFFERS_align, /**< alignment of data block memory */
|
||||
};
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamMeta */
|
||||
enum spa_param_meta {
|
||||
SPA_PARAM_META_type, /**< the metadata, one of enum spa_meta_type */
|
||||
SPA_PARAM_META_size, /**< the expected maximum size the meta */
|
||||
};
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamIO */
|
||||
enum spa_param_io {
|
||||
SPA_PARAM_IO_id, /**< type ID, uniquely identifies the io area */
|
||||
SPA_PARAM_IO_size, /**< size of the io area */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_PROPS_TYPES_H__
|
||||
#define __SPA_PARAM_PROPS_TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/param/param.h>
|
||||
|
||||
#define SPA_TYPE__Props SPA_TYPE_PARAM_BASE "Props"
|
||||
#define SPA_TYPE_PROPS_BASE SPA_TYPE__Props ":"
|
||||
|
||||
/** an unknown property */
|
||||
#define SPA_TYPE_PROPS__unknown SPA_TYPE_PROPS_BASE "unknown"
|
||||
|
||||
/** Common property ids */
|
||||
#define SPA_TYPE_PROPS__device SPA_TYPE_PROPS_BASE "device"
|
||||
#define SPA_TYPE_PROPS__deviceName SPA_TYPE_PROPS_BASE "deviceName"
|
||||
#define SPA_TYPE_PROPS__deviceFd SPA_TYPE_PROPS_BASE "deviceFd"
|
||||
#define SPA_TYPE_PROPS__card SPA_TYPE_PROPS_BASE "card"
|
||||
#define SPA_TYPE_PROPS__cardName SPA_TYPE_PROPS_BASE "cardName"
|
||||
|
||||
#define SPA_TYPE_PROPS__minLatency SPA_TYPE_PROPS_BASE "minLatency"
|
||||
#define SPA_TYPE_PROPS__maxLatency SPA_TYPE_PROPS_BASE "maxLatency"
|
||||
#define SPA_TYPE_PROPS__periods SPA_TYPE_PROPS_BASE "periods"
|
||||
#define SPA_TYPE_PROPS__periodSize SPA_TYPE_PROPS_BASE "periodSize"
|
||||
#define SPA_TYPE_PROPS__periodEvent SPA_TYPE_PROPS_BASE "periodEvent"
|
||||
|
||||
#define SPA_TYPE_PROPS__live SPA_TYPE_PROPS_BASE "live"
|
||||
#define SPA_TYPE_PROPS__waveType SPA_TYPE_PROPS_BASE "waveType"
|
||||
#define SPA_TYPE_PROPS__frequency SPA_TYPE_PROPS_BASE "frequency"
|
||||
#define SPA_TYPE_PROPS__volume SPA_TYPE_PROPS_BASE "volume"
|
||||
#define SPA_TYPE_PROPS__mute SPA_TYPE_PROPS_BASE "mute"
|
||||
#define SPA_TYPE_PROPS__patternType SPA_TYPE_PROPS_BASE "patternType"
|
||||
#define SPA_TYPE_PROPS__ditherType SPA_TYPE_PROPS_BASE "ditherType"
|
||||
#define SPA_TYPE_PROPS__truncate SPA_TYPE_PROPS_BASE "truncate"
|
||||
|
||||
#define SPA_TYPE_PROPS__brightness SPA_TYPE_PROPS_BASE "brightness"
|
||||
#define SPA_TYPE_PROPS__contrast SPA_TYPE_PROPS_BASE "contrast"
|
||||
#define SPA_TYPE_PROPS__saturation SPA_TYPE_PROPS_BASE "saturation"
|
||||
#define SPA_TYPE_PROPS__hue SPA_TYPE_PROPS_BASE "hue"
|
||||
#define SPA_TYPE_PROPS__gamma SPA_TYPE_PROPS_BASE "gamma"
|
||||
#define SPA_TYPE_PROPS__exposure SPA_TYPE_PROPS_BASE "exposure"
|
||||
#define SPA_TYPE_PROPS__gain SPA_TYPE_PROPS_BASE "gain"
|
||||
#define SPA_TYPE_PROPS__sharpness SPA_TYPE_PROPS_BASE "sharpness"
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_PROPS_TYPES_H__ */
|
||||
148
spa/include/spa/param/type-info.h
Normal file
148
spa/include/spa/param/type-info.h
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_TYPES_H__
|
||||
#define __SPA_PARAM_TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/utils/type-info.h>
|
||||
#include <spa/param/props.h>
|
||||
|
||||
/* base for parameter objects */
|
||||
#define SPA_TYPE__Param SPA_TYPE_OBJECT_BASE "Param"
|
||||
#define SPA_TYPE_PARAM_BASE SPA_TYPE__Param ":"
|
||||
|
||||
/* object with supported parameter id */
|
||||
#define SPA_TYPE_PARAM__List SPA_TYPE_PARAM_BASE "List"
|
||||
#define SPA_TYPE_PARAM_LIST_BASE SPA_TYPE_PARAM__List ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_list[] = {
|
||||
{ SPA_PARAM_LIST_id, SPA_TYPE_PARAM_LIST_BASE "id", SPA_ID_Enum, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#define SPA_TYPE__Props SPA_TYPE_PARAM_BASE "Props"
|
||||
#define SPA_TYPE_PROPS_BASE SPA_TYPE__Props ":"
|
||||
|
||||
static const struct spa_type_info spa_type_props[] = {
|
||||
{ SPA_PROP_unknown, SPA_TYPE_PROPS_BASE "unknown", SPA_ID_INVALID, },
|
||||
{ SPA_PROP_device, SPA_TYPE_PROPS_BASE "device", SPA_ID_String, },
|
||||
{ SPA_PROP_deviceName, SPA_TYPE_PROPS_BASE "deviceName", SPA_ID_String, },
|
||||
{ SPA_PROP_deviceFd, SPA_TYPE_PROPS_BASE "deviceFd", SPA_ID_Fd, },
|
||||
{ SPA_PROP_card, SPA_TYPE_PROPS_BASE "card", SPA_ID_String, },
|
||||
{ SPA_PROP_cardName, SPA_TYPE_PROPS_BASE "cardName", SPA_ID_String, },
|
||||
{ SPA_PROP_minLatency, SPA_TYPE_PROPS_BASE "minLatency", SPA_ID_Int, },
|
||||
{ SPA_PROP_maxLatency, SPA_TYPE_PROPS_BASE "maxLatency", SPA_ID_Int, },
|
||||
{ SPA_PROP_periods, SPA_TYPE_PROPS_BASE "periods", SPA_ID_Int, },
|
||||
{ SPA_PROP_periodSize, SPA_TYPE_PROPS_BASE "periodSize", SPA_ID_Int, },
|
||||
{ SPA_PROP_periodEvent, SPA_TYPE_PROPS_BASE "periodEvent", SPA_ID_Bool, },
|
||||
{ SPA_PROP_live, SPA_TYPE_PROPS_BASE "live", SPA_ID_Bool, },
|
||||
{ SPA_PROP_waveType, SPA_TYPE_PROPS_BASE "waveType", SPA_ID_Enum, },
|
||||
{ SPA_PROP_frequency, SPA_TYPE_PROPS_BASE "frequency", SPA_ID_Int, },
|
||||
{ SPA_PROP_volume, SPA_TYPE_PROPS_BASE "volume", SPA_ID_Float, },
|
||||
{ SPA_PROP_mute, SPA_TYPE_PROPS_BASE "mute", SPA_ID_Bool, },
|
||||
{ SPA_PROP_patternType, SPA_TYPE_PROPS_BASE "patternType", SPA_ID_Enum, },
|
||||
{ SPA_PROP_ditherType, SPA_TYPE_PROPS_BASE "ditherType", SPA_ID_Enum, },
|
||||
{ SPA_PROP_truncate, SPA_TYPE_PROPS_BASE "truncate", SPA_ID_Bool, },
|
||||
{ SPA_PROP_brightness, SPA_TYPE_PROPS_BASE "brightness", SPA_ID_Int, },
|
||||
{ SPA_PROP_contrast, SPA_TYPE_PROPS_BASE "contrast", SPA_ID_Int, },
|
||||
{ SPA_PROP_saturation, SPA_TYPE_PROPS_BASE "saturation", SPA_ID_Int, },
|
||||
{ SPA_PROP_hue, SPA_TYPE_PROPS_BASE "hue", SPA_ID_Int, },
|
||||
{ SPA_PROP_gamma, SPA_TYPE_PROPS_BASE "gamma", SPA_ID_Int, },
|
||||
{ SPA_PROP_exposure, SPA_TYPE_PROPS_BASE "exposure", SPA_ID_Int, },
|
||||
{ SPA_PROP_gain, SPA_TYPE_PROPS_BASE "gain", SPA_ID_Int, },
|
||||
{ SPA_PROP_sharpness, SPA_TYPE_PROPS_BASE "sharpness", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
/** Enum Property info */
|
||||
#define SPA_TYPE__PropInfo SPA_TYPE_PARAM_BASE "PropInfo"
|
||||
#define SPA_TYPE_PROP_INFO_BASE SPA_TYPE__PropInfo ":"
|
||||
|
||||
static const struct spa_type_info spa_type_prop_info[] = {
|
||||
{ SPA_PROP_INFO_id, SPA_TYPE_PROP_INFO_BASE "id", SPA_ID_Enum, spa_type_props },
|
||||
{ SPA_PROP_INFO_name, SPA_TYPE_PROP_INFO_BASE "name", SPA_ID_String, },
|
||||
{ SPA_PROP_INFO_type, SPA_TYPE_PROP_INFO_BASE "type", SPA_ID_Prop, },
|
||||
{ SPA_PROP_INFO_labels, SPA_TYPE_PROP_INFO_BASE "labels", SPA_ID_Struct, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#define SPA_TYPE_PARAM__Meta SPA_TYPE_PARAM_BASE "Meta"
|
||||
#define SPA_TYPE_PARAM_META_BASE SPA_TYPE_PARAM__Meta ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_meta[] = {
|
||||
{ SPA_PARAM_META_type, SPA_TYPE_PARAM_META_BASE "type", SPA_ID_Enum, },
|
||||
{ SPA_PARAM_META_size, SPA_TYPE_PARAM_META_BASE "size", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
/** Base for parameters that describe IO areas to exchange data,
|
||||
* control and properties with a node.
|
||||
*/
|
||||
#define SPA_TYPE_PARAM__IO SPA_TYPE_PARAM_BASE "IO"
|
||||
#define SPA_TYPE_PARAM_IO_BASE SPA_TYPE_PARAM__IO ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_io[] = {
|
||||
{ SPA_PARAM_IO_id, SPA_TYPE_PARAM_IO_BASE "id", SPA_ID_Enum, },
|
||||
{ SPA_PARAM_IO_size, SPA_TYPE_PARAM_IO_BASE "size", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#include <spa/param/format-types.h>
|
||||
|
||||
#define SPA_TYPE_PARAM__Buffers SPA_TYPE_PARAM_BASE "Buffers"
|
||||
#define SPA_TYPE_PARAM_BUFFERS_BASE SPA_TYPE_PARAM__Buffers ":"
|
||||
|
||||
#define SPA_TYPE_PARAM__BlockInfo SPA_TYPE_PARAM_BUFFERS_BASE "BlockInfo"
|
||||
#define SPA_TYPE_PARAM_BLOCK_INFO_BASE SPA_TYPE_PARAM__BlockInfo ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_buffers[] = {
|
||||
{ SPA_PARAM_BUFFERS_buffers, SPA_TYPE_PARAM_BUFFERS_BASE "buffers", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_blocks, SPA_TYPE_PARAM_BUFFERS_BASE "blocks", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_size, SPA_TYPE_PARAM_BLOCK_INFO_BASE "size", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_stride, SPA_TYPE_PARAM_BLOCK_INFO_BASE "stride", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_align, SPA_TYPE_PARAM_BLOCK_INFO_BASE "align", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
/* base for parameter object enumerations */
|
||||
#define SPA_TYPE__ParamId SPA_TYPE_ENUM_BASE "ParamId"
|
||||
#define SPA_TYPE_PARAM_ID_BASE SPA_TYPE__ParamId ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param[] = {
|
||||
{ SPA_PARAM_List, SPA_TYPE_PARAM_ID_BASE "List", SPA_ID_Int, },
|
||||
{ SPA_PARAM_PropInfo, SPA_TYPE_PARAM_ID_BASE "PropInfo", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Props, SPA_TYPE_PARAM_ID_BASE "Props", SPA_ID_Int, },
|
||||
{ SPA_PARAM_EnumFormat, SPA_TYPE_PARAM_ID_BASE "EnumFormat", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Format, SPA_TYPE_PARAM_ID_BASE "Format", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Buffers, SPA_TYPE_PARAM_ID_BASE "Buffers", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Meta, SPA_TYPE_PARAM_ID_BASE "Meta", SPA_ID_Int, },
|
||||
{ SPA_PARAM_IO, SPA_TYPE_PARAM_ID_BASE "IO", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_TYPES_H__ */
|
||||
|
|
@ -195,11 +195,11 @@ static inline uint32_t spa_pod_builder_bool(struct spa_pod_builder *builder, boo
|
|||
return spa_pod_builder_primitive(builder, &p.pod);
|
||||
}
|
||||
|
||||
#define SPA_POD_ID_INIT(val) (struct spa_pod_id){ { sizeof(uint32_t), SPA_ID_Enum }, val, 0 }
|
||||
#define SPA_POD_ENUM_INIT(val) (struct spa_pod_enum){ { sizeof(uint32_t), SPA_ID_Enum }, val, 0 }
|
||||
|
||||
static inline uint32_t spa_pod_builder_id(struct spa_pod_builder *builder, uint32_t val)
|
||||
static inline uint32_t spa_pod_builder_enum(struct spa_pod_builder *builder, uint32_t val)
|
||||
{
|
||||
const struct spa_pod_id p = SPA_POD_ID_INIT(val);
|
||||
const struct spa_pod_enum p = SPA_POD_ENUM_INIT(val);
|
||||
return spa_pod_builder_primitive(builder, &p.pod);
|
||||
}
|
||||
|
||||
|
|
@ -412,7 +412,7 @@ do { \
|
|||
spa_pod_builder_bool(builder, va_arg(args, int)); \
|
||||
break; \
|
||||
case 'I': \
|
||||
spa_pod_builder_id(builder, va_arg(args, uint32_t)); \
|
||||
spa_pod_builder_enum(builder, va_arg(args, uint32_t)); \
|
||||
break; \
|
||||
case 'i': \
|
||||
spa_pod_builder_int(builder, va_arg(args, int)); \
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct spa_pod_bool {
|
|||
int32_t __padding;
|
||||
};
|
||||
|
||||
struct spa_pod_id {
|
||||
struct spa_pod_enum {
|
||||
struct spa_pod pod;
|
||||
uint32_t value;
|
||||
int32_t __padding;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ struct spa_type_info {
|
|||
|
||||
#include <spa/monitor/type-info.h>
|
||||
#include <spa/node/type-info.h>
|
||||
#include <spa/param/type-info.h>
|
||||
|
||||
static const struct spa_type_info spa_types[] = {
|
||||
{ SPA_ID_INVALID, "*invalid*", SPA_ID_INVALID, },
|
||||
|
|
@ -97,6 +98,11 @@ static const struct spa_type_info spa_types[] = {
|
|||
{ SPA_ID_Fd, SPA_TYPE_BASE "Fd", SPA_ID_Fd, },
|
||||
{ SPA_ID_Prop, SPA_TYPE_POD_BASE "Prop", SPA_ID_Pod, },
|
||||
|
||||
{ SPA_ID_POINTER_BASE, SPA_TYPE__Pointer, SPA_ID_Pointer, },
|
||||
{ SPA_ID_POINTER_Buffer, SPA_TYPE_POINTER_BASE "Buffer", SPA_ID_Pointer, },
|
||||
{ SPA_ID_POINTER_Meta, SPA_TYPE_POINTER_BASE "Meta", SPA_ID_Pointer, },
|
||||
{ SPA_ID_POINTER_Dict, SPA_TYPE_POINTER_BASE "Dict", SPA_ID_Pointer, },
|
||||
|
||||
{ SPA_ID_INTERFACE_BASE, SPA_TYPE__Interface, SPA_ID_Pointer, },
|
||||
{ SPA_ID_INTERFACE_Handle, SPA_TYPE_INTERFACE_BASE "Handle", SPA_ID_INTERFACE_BASE, },
|
||||
{ SPA_ID_INTERFACE_HandleFactory, SPA_TYPE_INTERFACE_BASE "HandleFactory", SPA_ID_INTERFACE_BASE, },
|
||||
|
|
@ -117,6 +123,16 @@ static const struct spa_type_info spa_types[] = {
|
|||
{ SPA_ID_COMMAND_BASE, SPA_TYPE__Command, SPA_ID_Object, },
|
||||
{ SPA_ID_COMMAND_Node, SPA_TYPE_COMMAND_BASE "Node", SPA_ID_COMMAND_BASE, },
|
||||
|
||||
{ SPA_ID_OBJECT_BASE, SPA_TYPE__Object, SPA_ID_Object, },
|
||||
{ SPA_ID_OBJECT_MonitorItem, SPA_TYPE__MonitorItem, SPA_ID_Object, spa_type_monitor_item },
|
||||
{ SPA_ID_OBJECT_ParamList, SPA_TYPE_PARAM__List, SPA_ID_Object, spa_type_param_list, },
|
||||
{ SPA_ID_OBJECT_PropInfo, SPA_TYPE__PropInfo, SPA_ID_Object, spa_type_prop_info, },
|
||||
{ SPA_ID_OBJECT_Props, SPA_TYPE__Props, SPA_ID_Object, spa_type_props },
|
||||
{ SPA_ID_OBJECT_Format, SPA_TYPE__Format, SPA_ID_Object, },
|
||||
{ SPA_ID_OBJECT_ParamBuffers, SPA_TYPE_PARAM__Buffers, SPA_ID_Object, spa_type_param_buffers, },
|
||||
{ SPA_ID_OBJECT_ParamMeta, SPA_TYPE_PARAM__Meta, SPA_ID_Object, spa_type_param_meta },
|
||||
{ SPA_ID_OBJECT_ParamIO, SPA_TYPE_PARAM__IO, SPA_ID_Object, spa_type_param_io },
|
||||
|
||||
{ 0, NULL, }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,14 @@ enum {
|
|||
SPA_ID_Prop,
|
||||
SPA_ID_Pod,
|
||||
|
||||
/* Pointers */
|
||||
SPA_ID_POINTER_BASE = 0x10000,
|
||||
SPA_ID_POINTER_Buffer,
|
||||
SPA_ID_POINTER_Meta,
|
||||
SPA_ID_POINTER_Dict,
|
||||
|
||||
/* Interfaces */
|
||||
SPA_ID_INTERFACE_BASE = 0x10000,
|
||||
SPA_ID_INTERFACE_BASE = 0x20000,
|
||||
SPA_ID_INTERFACE_Handle,
|
||||
SPA_ID_INTERFACE_HandleFactory,
|
||||
SPA_ID_INTERFACE_Log,
|
||||
|
|
@ -67,18 +73,17 @@ enum {
|
|||
SPA_ID_INTERFACE_Node,
|
||||
|
||||
/* Events */
|
||||
SPA_ID_EVENT_BASE = 0x20000,
|
||||
SPA_ID_EVENT_BASE = 0x30000,
|
||||
SPA_ID_EVENT_Monitor,
|
||||
SPA_ID_EVENT_Node,
|
||||
|
||||
/* Commands */
|
||||
SPA_ID_COMMAND_BASE = 0x30000,
|
||||
SPA_ID_COMMAND_BASE = 0x40000,
|
||||
SPA_ID_COMMAND_Node,
|
||||
|
||||
/* Objects */
|
||||
SPA_ID_OBJECT_BASE = 0x40000,
|
||||
SPA_ID_OBJECT_BASE = 0x50000,
|
||||
SPA_ID_OBJECT_MonitorItem,
|
||||
|
||||
SPA_ID_OBJECT_ParamList,
|
||||
SPA_ID_OBJECT_PropInfo,
|
||||
SPA_ID_OBJECT_Props,
|
||||
|
|
@ -87,31 +92,6 @@ enum {
|
|||
SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_ID_OBJECT_ParamIO,
|
||||
|
||||
/* IO */
|
||||
SPA_ID_IO_BASE = 0x40000,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_ID_IO_ControlRange,
|
||||
SPA_ID_IO_Clock,
|
||||
SPA_ID_IO_Prop,
|
||||
SPA_ID_IO_Latency,
|
||||
|
||||
/* Params */
|
||||
SPA_ID_PARAM_BASE = 0x50000,
|
||||
SPA_ID_PARAM_List, /**< available params */
|
||||
SPA_ID_PARAM_PropInfo, /**< property information */
|
||||
SPA_ID_PARAM_Props, /**< properties */
|
||||
SPA_ID_PARAM_EnumFormat, /**< available formats */
|
||||
SPA_ID_PARAM_Format, /**< configured format */
|
||||
SPA_ID_PARAM_Buffers, /**< buffer configurations */
|
||||
SPA_ID_PARAM_Meta, /**< allowed metadata for buffers */
|
||||
SPA_ID_PARAM_IO, /**< configurable IO areas */
|
||||
|
||||
/* Pointers */
|
||||
SPA_ID_POINTER_BASE = 0x60000,
|
||||
SPA_ID_POINTER_Buffer,
|
||||
SPA_ID_POINTER_Meta,
|
||||
SPA_ID_POINTER_Dict,
|
||||
|
||||
/* vendor extensions */
|
||||
SPA_ID_VENDOR_PipeWire = 0x01000000,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue