PipeWire  0.3.33
utils/type-info.h
Go to the documentation of this file.
1 /* Simple Plugin API
2  *
3  * Copyright © 2018 Wim Taymans
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef SPA_TYPE_INFO_H
26 #define SPA_TYPE_INFO_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <spa/utils/defs.h>
33 
39 #ifndef SPA_TYPE_ROOT
40 #define SPA_TYPE_ROOT spa_types
41 #endif
42 
43 /* static */ inline bool spa_type_is_a(const char *type, const char *parent)
44 {
45  return type != NULL && parent != NULL && strncmp(type, parent, strlen(parent)) == 0;
46 }
47 
48 #include <spa/utils/type.h>
49 
50 /* base for parameter object enumerations */
51 #define SPA_TYPE_INFO_Direction SPA_TYPE_INFO_ENUM_BASE "Direction"
52 #define SPA_TYPE_INFO_DIRECTION_BASE SPA_TYPE_INFO_Direction ":"
53 
54 /* static */ const struct spa_type_info spa_type_direction[] = {
57  { 0, 0, NULL, NULL }
58 };
59 
60 #include <spa/monitor/type-info.h>
61 #include <spa/node/type-info.h>
62 #include <spa/param/type-info.h>
63 #include <spa/control/type-info.h>
64 
65 /* base for parameter object enumerations */
66 #define SPA_TYPE_INFO_Choice SPA_TYPE_INFO_ENUM_BASE "Choice"
67 #define SPA_TYPE_INFO_CHOICE_BASE SPA_TYPE_INFO_Choice ":"
68 
69 /* static */ const struct spa_type_info spa_type_choice[] = {
75  { 0, 0, NULL, NULL }
76 };
77 
78 /* static */ const struct spa_type_info spa_types[] = {
79  /* Basic types */
101 
106 
110 
114 
128 
129  { 0, 0, NULL, NULL }
130 };
131 
136 #ifdef __cplusplus
137 } /* extern "C" */
138 #endif
139 
140 #endif /* SPA_TYPE_INFO_H */
SPA_TYPE_INFO_PropInfo
#define SPA_TYPE_INFO_PropInfo
Enum Property info.
Definition: param/type-info.h:137
SPA_TYPE_None
@ SPA_TYPE_None
Definition: build-12683127/doc/spa/utils/type.h:45
spa_type_format
const struct spa_type_info spa_type_format[]
Definition: param/type-info.h:244
SPA_TYPE_Float
@ SPA_TYPE_Float
Definition: build-12683127/doc/spa/utils/type.h:50
SPA_TYPE_Long
@ SPA_TYPE_Long
Definition: build-12683127/doc/spa/utils/type.h:49
SPA_TYPE_OBJECT_ParamBuffers
@ SPA_TYPE_OBJECT_ParamBuffers
Definition: build-12683127/doc/spa/utils/type.h:91
SPA_TYPE_INFO_PARAM_Meta
#define SPA_TYPE_INFO_PARAM_Meta
Definition: param/type-info.h:151
SPA_CHOICE_Range
@ SPA_CHOICE_Range
range: default, min, max
Definition: pod/pod.h:142
SPA_TYPE_INFO_POD_BASE
#define SPA_TYPE_INFO_POD_BASE
Definition: build-12683127/doc/spa/utils/type.h:117
spa_type_param_buffers
const struct spa_type_info spa_type_param_buffers[]
Definition: param/type-info.h:291
spa_type_choice
const struct spa_type_info spa_type_choice[]
Definition: utils/type-info.h:69
SPA_TYPE_OBJECT_Format
@ SPA_TYPE_OBJECT_Format
Definition: build-12683127/doc/spa/utils/type.h:90
SPA_TYPE_Id
@ SPA_TYPE_Id
Definition: build-12683127/doc/spa/utils/type.h:47
spa_type_info::type
uint32_t type
Definition: build-12683127/doc/spa/utils/type.h:138
spa_type_prop_info
const struct spa_type_info spa_type_prop_info[]
Definition: param/type-info.h:140
type-info.h
SPA_TYPE_Int
@ SPA_TYPE_Int
Definition: build-12683127/doc/spa/utils/type.h:48
spa_type_param_io
const struct spa_type_info spa_type_param_io[]
Definition: param/type-info.h:167
spa_type_param_latency
const struct spa_type_info spa_type_param_latency[]
Definition: param/type-info.h:391
SPA_TYPE_EVENT_Device
@ SPA_TYPE_EVENT_Device
Definition: build-12683127/doc/spa/utils/type.h:76
spa_type_info
Definition: build-12683127/doc/spa/utils/type.h:137
spa_type_info::parent
uint32_t parent
Definition: build-12683127/doc/spa/utils/type.h:139
SPA_CHOICE_Enum
@ SPA_CHOICE_Enum
list: default, alternative,...
Definition: pod/pod.h:144
SPA_TYPE_POINTER_Dict
@ SPA_TYPE_POINTER_Dict
Definition: build-12683127/doc/spa/utils/type.h:71
SPA_DIRECTION_INPUT
@ SPA_DIRECTION_INPUT
Definition: defs.h:79
SPA_TYPE_Array
@ SPA_TYPE_Array
Definition: build-12683127/doc/spa/utils/type.h:57
SPA_TYPE_Rectangle
@ SPA_TYPE_Rectangle
Definition: build-12683127/doc/spa/utils/type.h:54
SPA_TYPE_INFO_PARAM_ProcessLatency
#define SPA_TYPE_INFO_PARAM_ProcessLatency
Definition: param/type-info.h:403
SPA_TYPE_OBJECT_START
@ SPA_TYPE_OBJECT_START
Definition: build-12683127/doc/spa/utils/type.h:87
SPA_TYPE_POINTER_Meta
@ SPA_TYPE_POINTER_Meta
Definition: build-12683127/doc/spa/utils/type.h:70
SPA_TYPE_OBJECT_Profiler
@ SPA_TYPE_OBJECT_Profiler
Definition: build-12683127/doc/spa/utils/type.h:97
spa_type_param_process_latency
const struct spa_type_info spa_type_param_process_latency[]
Definition: param/type-info.h:406
SPA_CHOICE_Flags
@ SPA_CHOICE_Flags
flags: default, possible flags,...
Definition: pod/pod.h:145
SPA_TYPE_INFO_PARAM_Latency
#define SPA_TYPE_INFO_PARAM_Latency
Definition: param/type-info.h:388
SPA_TYPE_EVENT_Node
@ SPA_TYPE_EVENT_Node
Definition: build-12683127/doc/spa/utils/type.h:77
SPA_TYPE_INFO_PARAM_Buffers
#define SPA_TYPE_INFO_PARAM_Buffers
Definition: param/type-info.h:285
SPA_TYPE_INFO_Command
#define SPA_TYPE_INFO_Command
Definition: build-12683127/doc/spa/utils/type.h:134
spa_type_param_meta
const struct spa_type_info spa_type_param_meta[]
Definition: param/type-info.h:154
SPA_TYPE_Pointer
@ SPA_TYPE_Pointer
Definition: build-12683127/doc/spa/utils/type.h:61
SPA_TYPE_COMMAND_Node
@ SPA_TYPE_COMMAND_Node
Definition: build-12683127/doc/spa/utils/type.h:83
SPA_TYPE_Fd
@ SPA_TYPE_Fd
Definition: build-12683127/doc/spa/utils/type.h:62
SPA_TYPE_INFO_Format
#define SPA_TYPE_INFO_Format
Definition: param/type-info.h:174
SPA_TYPE_OBJECT_ParamProfile
@ SPA_TYPE_OBJECT_ParamProfile
Definition: build-12683127/doc/spa/utils/type.h:94
SPA_TYPE_COMMAND_Device
@ SPA_TYPE_COMMAND_Device
Definition: build-12683127/doc/spa/utils/type.h:82
spa_types
const struct spa_type_info spa_types[]
Definition: utils/type-info.h:78
SPA_TYPE_String
@ SPA_TYPE_String
Definition: build-12683127/doc/spa/utils/type.h:52
SPA_TYPE_Bitmap
@ SPA_TYPE_Bitmap
Definition: build-12683127/doc/spa/utils/type.h:56
SPA_TYPE_POINTER_START
@ SPA_TYPE_POINTER_START
Definition: build-12683127/doc/spa/utils/type.h:68
type.h
type-info.h
spa_type_node_command
const struct spa_type_info spa_type_node_command[]
Definition: node/type-info.h:92
spa_type_profiler
const struct spa_type_info spa_type_profiler[]
Definition: param/type-info.h:379
SPA_TYPE_OBJECT_ParamIO
@ SPA_TYPE_OBJECT_ParamIO
Definition: build-12683127/doc/spa/utils/type.h:93
spa_type_is_a
bool spa_type_is_a(const char *type, const char *parent)
Definition: utils/type-info.h:43
SPA_TYPE_INFO_BASE
#define SPA_TYPE_INFO_BASE
Definition: build-12683127/doc/spa/utils/type.h:108
SPA_TYPE_INFO_Event
#define SPA_TYPE_INFO_Event
Definition: build-12683127/doc/spa/utils/type.h:131
SPA_TYPE_Bool
@ SPA_TYPE_Bool
Definition: build-12683127/doc/spa/utils/type.h:46
type-info.h
SPA_TYPE_EVENT_START
@ SPA_TYPE_EVENT_START
Definition: build-12683127/doc/spa/utils/type.h:75
SPA_TYPE_INFO_Struct
#define SPA_TYPE_INFO_Struct
Definition: build-12683127/doc/spa/utils/type.h:119
SPA_TYPE_INFO_POINTER_BASE
#define SPA_TYPE_INFO_POINTER_BASE
Definition: build-12683127/doc/spa/utils/type.h:126
SPA_TYPE_OBJECT_ParamProcessLatency
@ SPA_TYPE_OBJECT_ParamProcessLatency
Definition: build-12683127/doc/spa/utils/type.h:99
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: param/type-info.h:164
SPA_TYPE_Bytes
@ SPA_TYPE_Bytes
Definition: build-12683127/doc/spa/utils/type.h:53
SPA_DIRECTION_OUTPUT
@ SPA_DIRECTION_OUTPUT
Definition: defs.h:80
SPA_TYPE_Double
@ SPA_TYPE_Double
Definition: build-12683127/doc/spa/utils/type.h:51
SPA_TYPE_Object
@ SPA_TYPE_Object
Definition: build-12683127/doc/spa/utils/type.h:59
spa_type_device_event
const struct spa_type_info spa_type_device_event[]
Definition: monitor/type-info.h:47
SPA_TYPE_Sequence
@ SPA_TYPE_Sequence
Definition: build-12683127/doc/spa/utils/type.h:60
SPA_TYPE_POINTER_Buffer
@ SPA_TYPE_POINTER_Buffer
Definition: build-12683127/doc/spa/utils/type.h:69
SPA_TYPE_INFO_Profiler
#define SPA_TYPE_INFO_Profiler
Definition: param/type-info.h:376
SPA_TYPE_INFO_Props
#define SPA_TYPE_INFO_Props
Definition: param/type-info.h:71
SPA_TYPE_OBJECT_Props
@ SPA_TYPE_OBJECT_Props
Definition: build-12683127/doc/spa/utils/type.h:89
SPA_TYPE_INFO_Pod
#define SPA_TYPE_INFO_Pod
Definition: build-12683127/doc/spa/utils/type.h:116
SPA_TYPE_Fraction
@ SPA_TYPE_Fraction
Definition: build-12683127/doc/spa/utils/type.h:55
SPA_CHOICE_None
@ SPA_CHOICE_None
no choice, first value is current
Definition: pod/pod.h:141
SPA_TYPE_INFO_PARAM_Route
#define SPA_TYPE_INFO_PARAM_Route
Definition: param/type-info.h:353
SPA_TYPE_OBJECT_ParamMeta
@ SPA_TYPE_OBJECT_ParamMeta
Definition: build-12683127/doc/spa/utils/type.h:92
SPA_TYPE_Pod
@ SPA_TYPE_Pod
Definition: build-12683127/doc/spa/utils/type.h:64
SPA_TYPE_INFO_DIRECTION_BASE
#define SPA_TYPE_INFO_DIRECTION_BASE
Definition: utils/type-info.h:52
SPA_TYPE_COMMAND_START
@ SPA_TYPE_COMMAND_START
Definition: build-12683127/doc/spa/utils/type.h:81
SPA_TYPE_OBJECT_ParamRoute
@ SPA_TYPE_OBJECT_ParamRoute
Definition: build-12683127/doc/spa/utils/type.h:96
spa_type_direction
const struct spa_type_info spa_type_direction[]
Definition: utils/type-info.h:54
SPA_TYPE_START
@ SPA_TYPE_START
Definition: build-12683127/doc/spa/utils/type.h:44
spa_type_node_event
const struct spa_type_info spa_type_node_event[]
Definition: node/type-info.h:70
SPA_TYPE_INFO_COMMAND_BASE
#define SPA_TYPE_INFO_COMMAND_BASE
Definition: build-12683127/doc/spa/utils/type.h:135
SPA_CHOICE_Step
@ SPA_CHOICE_Step
range with step: default, min, max, step
Definition: pod/pod.h:143
SPA_TYPE_INFO_PARAM_Profile
#define SPA_TYPE_INFO_PARAM_Profile
Definition: param/type-info.h:312
SPA_TYPE_OBJECT_ParamLatency
@ SPA_TYPE_OBJECT_ParamLatency
Definition: build-12683127/doc/spa/utils/type.h:98
defs.h
spa_type_param_route
const struct spa_type_info spa_type_param_route[]
Definition: param/type-info.h:356
SPA_TYPE_INFO_EVENT_BASE
#define SPA_TYPE_INFO_EVENT_BASE
Definition: build-12683127/doc/spa/utils/type.h:132
SPA_TYPE_Choice
@ SPA_TYPE_Choice
Definition: build-12683127/doc/spa/utils/type.h:63
SPA_TYPE_OBJECT_PropInfo
@ SPA_TYPE_OBJECT_PropInfo
Definition: build-12683127/doc/spa/utils/type.h:88
spa_type_props
const struct spa_type_info spa_type_props[]
Definition: param/type-info.h:88
spa_type_param_profile
const struct spa_type_info spa_type_param_profile[]
Definition: param/type-info.h:315
SPA_TYPE_INFO_Pointer
#define SPA_TYPE_INFO_Pointer
Definition: build-12683127/doc/spa/utils/type.h:125
SPA_TYPE_OBJECT_ParamPortConfig
@ SPA_TYPE_OBJECT_ParamPortConfig
Definition: build-12683127/doc/spa/utils/type.h:95
type-info.h
SPA_TYPE_INFO_Object
#define SPA_TYPE_INFO_Object
Definition: build-12683127/doc/spa/utils/type.h:122
SPA_TYPE_INFO_PARAM_PortConfig
#define SPA_TYPE_INFO_PARAM_PortConfig
Definition: param/type-info.h:339
SPA_TYPE_INFO_CHOICE_BASE
#define SPA_TYPE_INFO_CHOICE_BASE
Definition: utils/type-info.h:67
spa_type_param_port_config
const struct spa_type_info spa_type_param_port_config[]
Definition: param/type-info.h:342
SPA_TYPE_Struct
@ SPA_TYPE_Struct
Definition: build-12683127/doc/spa/utils/type.h:58