type-info.h
Go to the documentation of this file.
/* Simple Plugin API
*
* Copyright © 2018 Wim Taymans
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef SPA_TYPE_INFO_H
#define SPA_TYPE_INFO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/utils/defs.h>
#ifndef SPA_TYPE_ROOT
#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>
/* base for parameter object enumerations */
#define SPA_TYPE_INFO_Direction SPA_TYPE_INFO_ENUM_BASE "Direction"
#define SPA_TYPE_INFO_DIRECTION_BASE SPA_TYPE_INFO_Direction ":"
static const struct spa_type_info spa_type_direction[] = {
{ SPA_DIRECTION_INPUT, SPA_TYPE_Int, SPA_TYPE_INFO_DIRECTION_BASE "Input", NULL },
{ SPA_DIRECTION_OUTPUT, SPA_TYPE_Int, SPA_TYPE_INFO_DIRECTION_BASE "Output", NULL },
{ 0, 0, NULL, NULL }
};
#include <spa/monitor/type-info.h>
#include <spa/node/type-info.h>
#include <spa/param/type-info.h>
#include <spa/control/type-info.h>
/* base for parameter object enumerations */
#define SPA_TYPE_INFO_Choice SPA_TYPE_INFO_ENUM_BASE "Choice"
#define SPA_TYPE_INFO_CHOICE_BASE SPA_TYPE_INFO_Choice ":"
static const struct spa_type_info spa_type_choice[] = {
{ SPA_CHOICE_None, SPA_TYPE_Int, SPA_TYPE_INFO_CHOICE_BASE "None", NULL },
{ SPA_CHOICE_Range, SPA_TYPE_Int, SPA_TYPE_INFO_CHOICE_BASE "Range", NULL },
{ SPA_CHOICE_Step, SPA_TYPE_Int, SPA_TYPE_INFO_CHOICE_BASE "Step", NULL },
{ SPA_CHOICE_Enum, SPA_TYPE_Int, SPA_TYPE_INFO_CHOICE_BASE "Enum", NULL },
{ SPA_CHOICE_Flags, SPA_TYPE_Int, SPA_TYPE_INFO_CHOICE_BASE "Flags", NULL },
{ 0, 0, NULL, NULL }
};
static const struct spa_type_info spa_types[] = {
/* Basic types */
{ SPA_TYPE_START, SPA_TYPE_START, SPA_TYPE_INFO_BASE, NULL },
{ SPA_TYPE_None, SPA_TYPE_None, SPA_TYPE_INFO_BASE "None", NULL },
{ SPA_TYPE_Bool, SPA_TYPE_Bool, SPA_TYPE_INFO_BASE "Bool", NULL },
{ SPA_TYPE_Id, SPA_TYPE_Int, SPA_TYPE_INFO_BASE "Id", NULL },
{ SPA_TYPE_Int, SPA_TYPE_Int, SPA_TYPE_INFO_BASE "Int", NULL },
{ SPA_TYPE_Long, SPA_TYPE_Long, SPA_TYPE_INFO_BASE "Long", NULL },
{ SPA_TYPE_Float, SPA_TYPE_Float, SPA_TYPE_INFO_BASE "Float", NULL },
{ SPA_TYPE_Double, SPA_TYPE_Double, SPA_TYPE_INFO_BASE "Double", NULL },
{ SPA_TYPE_String, SPA_TYPE_String, SPA_TYPE_INFO_BASE "String", NULL },
{ SPA_TYPE_Bytes, SPA_TYPE_Bytes, SPA_TYPE_INFO_BASE "Bytes", NULL },
{ SPA_TYPE_Rectangle, SPA_TYPE_Rectangle, SPA_TYPE_INFO_BASE "Rectangle", NULL },
{ SPA_TYPE_Fraction, SPA_TYPE_Fraction, SPA_TYPE_INFO_BASE "Fraction", NULL },
{ SPA_TYPE_Bitmap, SPA_TYPE_Bitmap, SPA_TYPE_INFO_BASE "Bitmap", NULL },
{ SPA_TYPE_Array, SPA_TYPE_Array, SPA_TYPE_INFO_BASE "Array", NULL },
{ SPA_TYPE_Pod, SPA_TYPE_Pod, SPA_TYPE_INFO_Pod, NULL },
{ SPA_TYPE_Struct, SPA_TYPE_Pod, SPA_TYPE_INFO_Struct, NULL },
{ SPA_TYPE_Object, SPA_TYPE_Pod, SPA_TYPE_INFO_Object, NULL },
{ SPA_TYPE_Sequence, SPA_TYPE_Pod, SPA_TYPE_INFO_POD_BASE "Sequence", NULL },
{ SPA_TYPE_Pointer, SPA_TYPE_Pointer, SPA_TYPE_INFO_Pointer, NULL },
{ SPA_TYPE_Fd, SPA_TYPE_Fd, SPA_TYPE_INFO_BASE "Fd", NULL },
{ SPA_TYPE_Choice, SPA_TYPE_Pod, SPA_TYPE_INFO_POD_BASE "Choice", NULL },
{ SPA_TYPE_POINTER_START, SPA_TYPE_Pointer, SPA_TYPE_INFO_Pointer, NULL },
{ SPA_TYPE_POINTER_Buffer, SPA_TYPE_Pointer, SPA_TYPE_INFO_POINTER_BASE "Buffer", NULL },
{ SPA_TYPE_POINTER_Meta, SPA_TYPE_Pointer, SPA_TYPE_INFO_POINTER_BASE "Meta", NULL },
{ SPA_TYPE_POINTER_Dict, SPA_TYPE_Pointer, SPA_TYPE_INFO_POINTER_BASE "Dict", NULL },
{ SPA_TYPE_EVENT_START, SPA_TYPE_Object, SPA_TYPE_INFO_Event, NULL },
{ SPA_TYPE_EVENT_Device, SPA_TYPE_Object, SPA_TYPE_INFO_EVENT_BASE "Device", spa_type_device_event },
{ SPA_TYPE_EVENT_Node, SPA_TYPE_Object, SPA_TYPE_INFO_EVENT_BASE "Node", spa_type_node_event },
{ SPA_TYPE_COMMAND_START, SPA_TYPE_Object, SPA_TYPE_INFO_Command, NULL },
{ SPA_TYPE_COMMAND_Device, SPA_TYPE_Object, SPA_TYPE_INFO_COMMAND_BASE "Device", NULL },
{ SPA_TYPE_COMMAND_Node, SPA_TYPE_Object, SPA_TYPE_INFO_COMMAND_BASE "Node", spa_type_node_command },
{ SPA_TYPE_OBJECT_START, SPA_TYPE_Object, SPA_TYPE_INFO_Object, NULL },
{ SPA_TYPE_OBJECT_PropInfo, SPA_TYPE_Object, SPA_TYPE_INFO_PropInfo, spa_type_prop_info, },
{ SPA_TYPE_OBJECT_Props, SPA_TYPE_Object, SPA_TYPE_INFO_Props, spa_type_props },
{ SPA_TYPE_OBJECT_Format, SPA_TYPE_Object, SPA_TYPE_INFO_Format, spa_type_format },
{ SPA_TYPE_OBJECT_ParamBuffers, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Buffers, spa_type_param_buffers, },
{ SPA_TYPE_OBJECT_ParamMeta, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Meta, spa_type_param_meta },
{ SPA_TYPE_OBJECT_ParamIO, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_IO, spa_type_param_io },
{ SPA_TYPE_OBJECT_ParamProfile, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Profile, spa_type_param_profile },
{ SPA_TYPE_OBJECT_ParamPortConfig, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_PortConfig, spa_type_param_port_config },
{ SPA_TYPE_OBJECT_ParamRoute, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Route, spa_type_param_route },
{ SPA_TYPE_OBJECT_Profiler, SPA_TYPE_Object, SPA_TYPE_INFO_Profiler, spa_type_profiler },
{ SPA_TYPE_OBJECT_ParamLatency, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Latency, spa_type_param_latency },
{ SPA_TYPE_OBJECT_ParamProcessLatency, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_ProcessLatency, spa_type_param_process_latency },
{ 0, 0, NULL, NULL }
};
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* SPA_TYPE_INFO_H */
type-info.h
spa/control/type-info.h
defs.h
spa/utils/defs.h
spa_type_device_event
static const struct spa_type_info spa_type_device_event[]
Definition: type-info.h:61
spa_type_node_command
static const struct spa_type_info spa_type_node_command[]
Definition: type-info.h:105
spa_type_node_event
static const struct spa_type_info spa_type_node_event[]
Definition: type-info.h:80
spa_type_param_profile
static const struct spa_type_info spa_type_param_profile[]
Definition: type-info.h:380
spa_type_prop_info
static const struct spa_type_info spa_type_prop_info[]
Definition: type-info.h:171
SPA_TYPE_INFO_PARAM_Meta
#define SPA_TYPE_INFO_PARAM_Meta
Definition: type-info.h:184
spa_type_param_io
static const struct spa_type_info spa_type_param_io[]
Definition: type-info.h:203
spa_type_param_port_config
static const struct spa_type_info spa_type_param_port_config[]
Definition: type-info.h:411
SPA_TYPE_INFO_PARAM_Profile
#define SPA_TYPE_INFO_PARAM_Profile
Definition: type-info.h:376
spa_type_param_latency
static const struct spa_type_info spa_type_param_latency[]
Definition: type-info.h:466
SPA_TYPE_INFO_PARAM_IO
#define SPA_TYPE_INFO_PARAM_IO
Base for parameters that describe IO areas to exchange data, control and properties with a node.
Definition: type-info.h:199
spa_type_format
static const struct spa_type_info spa_type_format[]
Definition: type-info.h:294
spa_type_param_meta
static const struct spa_type_info spa_type_param_meta[]
Definition: type-info.h:188
spa_type_props
static const struct spa_type_info spa_type_props[]
Definition: type-info.h:116
spa_type_param_buffers
static const struct spa_type_info spa_type_param_buffers[]
Definition: type-info.h:352
SPA_TYPE_INFO_PropInfo
#define SPA_TYPE_INFO_PropInfo
Enum Property info.
Definition: type-info.h:167
SPA_TYPE_INFO_PARAM_Buffers
#define SPA_TYPE_INFO_PARAM_Buffers
Definition: type-info.h:343
SPA_TYPE_INFO_PARAM_Latency
#define SPA_TYPE_INFO_PARAM_Latency
Definition: type-info.h:462
SPA_TYPE_INFO_Format
#define SPA_TYPE_INFO_Format
Definition: type-info.h:211
SPA_TYPE_INFO_Profiler
#define SPA_TYPE_INFO_Profiler
Definition: type-info.h:448
spa_type_param_process_latency
static const struct spa_type_info spa_type_param_process_latency[]
Definition: type-info.h:483
SPA_TYPE_INFO_PARAM_ProcessLatency
#define SPA_TYPE_INFO_PARAM_ProcessLatency
Definition: type-info.h:479
SPA_TYPE_INFO_PARAM_Route
#define SPA_TYPE_INFO_PARAM_Route
Definition: type-info.h:423
SPA_TYPE_INFO_Props
#define SPA_TYPE_INFO_Props
Definition: type-info.h:81
spa_type_profiler
static const struct spa_type_info spa_type_profiler[]
Definition: type-info.h:452
spa_type_param_route
static const struct spa_type_info spa_type_param_route[]
Definition: type-info.h:427
SPA_TYPE_INFO_PARAM_PortConfig
#define SPA_TYPE_INFO_PARAM_PortConfig
Definition: type-info.h:407
SPA_CHOICE_Step
@ SPA_CHOICE_Step
range with step: default, min, max, step
Definition: pod.h:169
SPA_CHOICE_None
@ SPA_CHOICE_None
no choice, first value is current
Definition: pod.h:167
SPA_CHOICE_Flags
@ SPA_CHOICE_Flags
flags: default, possible flags,...
Definition: pod.h:171
SPA_CHOICE_Range
@ SPA_CHOICE_Range
range: default, min, max
Definition: pod.h:168
SPA_CHOICE_Enum
@ SPA_CHOICE_Enum
list: default, alternative,...
Definition: pod.h:170
SPA_TYPE_INFO_EVENT_BASE
#define SPA_TYPE_INFO_EVENT_BASE
Definition: type.h:155
SPA_TYPE_INFO_BASE
#define SPA_TYPE_INFO_BASE
Definition: type.h:115
SPA_TYPE_INFO_CHOICE_BASE
#define SPA_TYPE_INFO_CHOICE_BASE
Definition: type-info.h:77
spa_type_is_a
static bool spa_type_is_a(const char *type, const char *parent)
Definition: type-info.h:49
spa_type_choice
static const struct spa_type_info spa_type_choice[]
Definition: type-info.h:79
SPA_TYPE_INFO_POD_BASE
#define SPA_TYPE_INFO_POD_BASE
Definition: type.h:130
SPA_TYPE_INFO_Struct
#define SPA_TYPE_INFO_Struct
Definition: type.h:133
SPA_TYPE_INFO_Event
#define SPA_TYPE_INFO_Event
Definition: type.h:153
SPA_TYPE_INFO_Pointer
#define SPA_TYPE_INFO_Pointer
Definition: type.h:143
SPA_TYPE_INFO_Pod
#define SPA_TYPE_INFO_Pod
Definition: type.h:128
SPA_TYPE_INFO_Command
#define SPA_TYPE_INFO_Command
Definition: type.h:158
SPA_TYPE_INFO_DIRECTION_BASE
#define SPA_TYPE_INFO_DIRECTION_BASE
Definition: type-info.h:60
SPA_TYPE_INFO_POINTER_BASE
#define SPA_TYPE_INFO_POINTER_BASE
Definition: type.h:145
SPA_TYPE_INFO_Object
#define SPA_TYPE_INFO_Object
Definition: type.h:138
spa_types
static const struct spa_type_info spa_types[]
Definition: type-info.h:88
SPA_TYPE_INFO_COMMAND_BASE
#define SPA_TYPE_INFO_COMMAND_BASE
Definition: type.h:160
spa_type_direction
static const struct spa_type_info spa_type_direction[]
Definition: type-info.h:62
SPA_TYPE_POINTER_Buffer
@ SPA_TYPE_POINTER_Buffer
Definition: type.h:75
SPA_TYPE_OBJECT_ParamPortConfig
@ SPA_TYPE_OBJECT_ParamPortConfig
Definition: type.h:101
SPA_TYPE_Int
@ SPA_TYPE_Int
Definition: type.h:54
SPA_TYPE_OBJECT_ParamProfile
@ SPA_TYPE_OBJECT_ParamProfile
Definition: type.h:100
SPA_TYPE_COMMAND_START
@ SPA_TYPE_COMMAND_START
Definition: type.h:87
SPA_TYPE_POINTER_START
@ SPA_TYPE_POINTER_START
Definition: type.h:74
SPA_TYPE_Rectangle
@ SPA_TYPE_Rectangle
Definition: type.h:60
SPA_TYPE_Long
@ SPA_TYPE_Long
Definition: type.h:55
SPA_TYPE_Bool
@ SPA_TYPE_Bool
Definition: type.h:52
SPA_TYPE_Bytes
@ SPA_TYPE_Bytes
Definition: type.h:59
SPA_TYPE_EVENT_Device
@ SPA_TYPE_EVENT_Device
Definition: type.h:82
SPA_TYPE_Pod
@ SPA_TYPE_Pod
Definition: type.h:70
SPA_TYPE_OBJECT_PropInfo
@ SPA_TYPE_OBJECT_PropInfo
Definition: type.h:94
SPA_TYPE_OBJECT_START
@ SPA_TYPE_OBJECT_START
Definition: type.h:93
SPA_TYPE_Bitmap
@ SPA_TYPE_Bitmap
Definition: type.h:62
SPA_TYPE_Object
@ SPA_TYPE_Object
Definition: type.h:65
SPA_TYPE_POINTER_Dict
@ SPA_TYPE_POINTER_Dict
Definition: type.h:77
SPA_TYPE_Float
@ SPA_TYPE_Float
Definition: type.h:56
SPA_TYPE_COMMAND_Device
@ SPA_TYPE_COMMAND_Device
Definition: type.h:88
SPA_TYPE_OBJECT_ParamBuffers
@ SPA_TYPE_OBJECT_ParamBuffers
Definition: type.h:97
SPA_TYPE_Fraction
@ SPA_TYPE_Fraction
Definition: type.h:61
SPA_TYPE_None
@ SPA_TYPE_None
Definition: type.h:51
SPA_TYPE_OBJECT_ParamIO
@ SPA_TYPE_OBJECT_ParamIO
Definition: type.h:99
SPA_TYPE_OBJECT_Props
@ SPA_TYPE_OBJECT_Props
Definition: type.h:95
SPA_TYPE_Sequence
@ SPA_TYPE_Sequence
Definition: type.h:66
SPA_TYPE_Double
@ SPA_TYPE_Double
Definition: type.h:57
SPA_TYPE_OBJECT_Profiler
@ SPA_TYPE_OBJECT_Profiler
Definition: type.h:103
SPA_TYPE_OBJECT_ParamLatency
@ SPA_TYPE_OBJECT_ParamLatency
Definition: type.h:104
SPA_TYPE_Id
@ SPA_TYPE_Id
Definition: type.h:53
SPA_TYPE_EVENT_START
@ SPA_TYPE_EVENT_START
Definition: type.h:81
SPA_TYPE_Choice
@ SPA_TYPE_Choice
Definition: type.h:69
SPA_TYPE_EVENT_Node
@ SPA_TYPE_EVENT_Node
Definition: type.h:83
SPA_TYPE_Pointer
@ SPA_TYPE_Pointer
Definition: type.h:67
SPA_TYPE_Array
@ SPA_TYPE_Array
Definition: type.h:63
SPA_TYPE_String
@ SPA_TYPE_String
Definition: type.h:58
SPA_TYPE_POINTER_Meta
@ SPA_TYPE_POINTER_Meta
Definition: type.h:76
SPA_TYPE_COMMAND_Node
@ SPA_TYPE_COMMAND_Node
Definition: type.h:89
SPA_TYPE_OBJECT_ParamProcessLatency
@ SPA_TYPE_OBJECT_ParamProcessLatency
Definition: type.h:105
SPA_TYPE_Fd
@ SPA_TYPE_Fd
Definition: type.h:68
SPA_TYPE_OBJECT_ParamMeta
@ SPA_TYPE_OBJECT_ParamMeta
Definition: type.h:98
SPA_TYPE_OBJECT_ParamRoute
@ SPA_TYPE_OBJECT_ParamRoute
Definition: type.h:102
SPA_TYPE_Struct
@ SPA_TYPE_Struct
Definition: type.h:64
SPA_TYPE_OBJECT_Format
@ SPA_TYPE_OBJECT_Format
Definition: type.h:96
SPA_TYPE_START
@ SPA_TYPE_START
Definition: type.h:50
SPA_DIRECTION_INPUT
@ SPA_DIRECTION_INPUT
Definition: defs.h:91
SPA_DIRECTION_OUTPUT
@ SPA_DIRECTION_OUTPUT
Definition: defs.h:92
type-info.h
spa/monitor/type-info.h
type-info.h
spa/node/type-info.h
type-info.h
spa/param/type-info.h
type.h
spa/utils/type.h
spa_type_info
Definition: type.h:162