PipeWire: type-info.h Source File

PipeWire 0.3.66

Loading...
Searching...
No Matches
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
29extern "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
43static 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#include <spa/utils/enum-types.h>
50
51#include <spa/monitor/type-info.h>
52#include <spa/node/type-info.h>
53#include <spa/param/type-info.h>
54#include <spa/control/type-info.h>
55
56static const struct spa_type_info spa_types[] = {
57 /* Basic types */
58 { SPA_TYPE_START, SPA_TYPE_START, SPA_TYPE_INFO_BASE, NULL },
59 { SPA_TYPE_None, SPA_TYPE_None, SPA_TYPE_INFO_BASE "None", NULL },
60 { SPA_TYPE_Bool, SPA_TYPE_Bool, SPA_TYPE_INFO_BASE "Bool", NULL },
61 { SPA_TYPE_Id, SPA_TYPE_Int, SPA_TYPE_INFO_BASE "Id", NULL },
62 { SPA_TYPE_Int, SPA_TYPE_Int, SPA_TYPE_INFO_BASE "Int", NULL },
63 { SPA_TYPE_Long, SPA_TYPE_Long, SPA_TYPE_INFO_BASE "Long", NULL },
64 { SPA_TYPE_Float, SPA_TYPE_Float, SPA_TYPE_INFO_BASE "Float", NULL },
65 { SPA_TYPE_Double, SPA_TYPE_Double, SPA_TYPE_INFO_BASE "Double", NULL },
66 { SPA_TYPE_String, SPA_TYPE_String, SPA_TYPE_INFO_BASE "String", NULL },
67 { SPA_TYPE_Bytes, SPA_TYPE_Bytes, SPA_TYPE_INFO_BASE "Bytes", NULL },
68 { SPA_TYPE_Rectangle, SPA_TYPE_Rectangle, SPA_TYPE_INFO_BASE "Rectangle", NULL },
69 { SPA_TYPE_Fraction, SPA_TYPE_Fraction, SPA_TYPE_INFO_BASE "Fraction", NULL },
70 { SPA_TYPE_Bitmap, SPA_TYPE_Bitmap, SPA_TYPE_INFO_BASE "Bitmap", NULL },
71 { SPA_TYPE_Array, SPA_TYPE_Array, SPA_TYPE_INFO_BASE "Array", NULL },
72 { SPA_TYPE_Pod, SPA_TYPE_Pod, SPA_TYPE_INFO_Pod, NULL },
73 { SPA_TYPE_Struct, SPA_TYPE_Pod, SPA_TYPE_INFO_Struct, NULL },
74 { SPA_TYPE_Object, SPA_TYPE_Pod, SPA_TYPE_INFO_Object, NULL },
75 { SPA_TYPE_Sequence, SPA_TYPE_Pod, SPA_TYPE_INFO_POD_BASE "Sequence", NULL },
76 { SPA_TYPE_Pointer, SPA_TYPE_Pointer, SPA_TYPE_INFO_Pointer, NULL },
77 { SPA_TYPE_Fd, SPA_TYPE_Fd, SPA_TYPE_INFO_BASE "Fd", NULL },
78 { SPA_TYPE_Choice, SPA_TYPE_Pod, SPA_TYPE_INFO_POD_BASE "Choice", NULL },
79
80 { SPA_TYPE_POINTER_START, SPA_TYPE_Pointer, SPA_TYPE_INFO_Pointer, NULL },
81 { SPA_TYPE_POINTER_Buffer, SPA_TYPE_Pointer, SPA_TYPE_INFO_POINTER_BASE "Buffer", NULL },
82 { SPA_TYPE_POINTER_Meta, SPA_TYPE_Pointer, SPA_TYPE_INFO_POINTER_BASE "Meta", NULL },
83 { SPA_TYPE_POINTER_Dict, SPA_TYPE_Pointer, SPA_TYPE_INFO_POINTER_BASE "Dict", NULL },
84
85 { SPA_TYPE_EVENT_START, SPA_TYPE_Object, SPA_TYPE_INFO_Event, NULL },
86 { SPA_TYPE_EVENT_Device, SPA_TYPE_Object, SPA_TYPE_INFO_EVENT_BASE "Device", spa_type_device_event },
87 { SPA_TYPE_EVENT_Node, SPA_TYPE_Object, SPA_TYPE_INFO_EVENT_BASE "Node", spa_type_node_event },
88
89 { SPA_TYPE_COMMAND_START, SPA_TYPE_Object, SPA_TYPE_INFO_Command, NULL },
90 { SPA_TYPE_COMMAND_Device, SPA_TYPE_Object, SPA_TYPE_INFO_COMMAND_BASE "Device", NULL },
91 { SPA_TYPE_COMMAND_Node, SPA_TYPE_Object, SPA_TYPE_INFO_COMMAND_BASE "Node", spa_type_node_command },
92
93 { SPA_TYPE_OBJECT_START, SPA_TYPE_Object, SPA_TYPE_INFO_Object, NULL },
94 { SPA_TYPE_OBJECT_PropInfo, SPA_TYPE_Object, SPA_TYPE_INFO_PropInfo, spa_type_prop_info, },
95 { SPA_TYPE_OBJECT_Props, SPA_TYPE_Object, SPA_TYPE_INFO_Props, spa_type_props },
96 { SPA_TYPE_OBJECT_Format, SPA_TYPE_Object, SPA_TYPE_INFO_Format, spa_type_format },
97 { SPA_TYPE_OBJECT_ParamBuffers, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Buffers, spa_type_param_buffers, },
98 { SPA_TYPE_OBJECT_ParamMeta, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Meta, spa_type_param_meta },
99 { SPA_TYPE_OBJECT_ParamIO, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_IO, spa_type_param_io },
100 { SPA_TYPE_OBJECT_ParamProfile, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Profile, spa_type_param_profile },
101 { SPA_TYPE_OBJECT_ParamPortConfig, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_PortConfig, spa_type_param_port_config },
102 { SPA_TYPE_OBJECT_ParamRoute, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Route, spa_type_param_route },
103 { SPA_TYPE_OBJECT_Profiler, SPA_TYPE_Object, SPA_TYPE_INFO_Profiler, spa_type_profiler },
104 { SPA_TYPE_OBJECT_ParamLatency, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_Latency, spa_type_param_latency },
105 { SPA_TYPE_OBJECT_ParamProcessLatency, SPA_TYPE_Object, SPA_TYPE_INFO_PARAM_ProcessLatency, spa_type_param_process_latency },
106
107 { 0, 0, NULL, NULL }
108};
109
114#ifdef __cplusplus
115} /* extern "C" */
116#endif
117
118#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: monitor/type-info.h:61
spa_type_node_command
static const struct spa_type_info spa_type_node_command[]
Definition: node/type-info.h:105
spa_type_node_event
static const struct spa_type_info spa_type_node_event[]
Definition: node/type-info.h:80
spa_type_param_profile
static const struct spa_type_info spa_type_param_profile[]
Definition: profile-types.h:51
spa_type_prop_info
static const struct spa_type_info spa_type_prop_info[]
Definition: props-types.h:108
SPA_TYPE_INFO_PARAM_Meta
#define SPA_TYPE_INFO_PARAM_Meta
Definition: buffers-types.h:48
spa_type_param_io
static const struct spa_type_info spa_type_param_io[]
Definition: buffers-types.h:67
spa_type_param_port_config
static const struct spa_type_info spa_type_param_port_config[]
Definition: port-config-types.h:64
SPA_TYPE_INFO_PARAM_Profile
#define SPA_TYPE_INFO_PARAM_Profile
Definition: profile-types.h:47
spa_type_param_latency
static const struct spa_type_info spa_type_param_latency[]
Definition: latency-types.h:51
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: buffers-types.h:63
spa_type_format
static const struct spa_type_info spa_type_format[]
Definition: format-types.h:148
spa_type_param_meta
static const struct spa_type_info spa_type_param_meta[]
Definition: buffers-types.h:52
spa_type_props
static const struct spa_type_info spa_type_props[]
Definition: props-types.h:52
spa_type_param_buffers
static const struct spa_type_info spa_type_param_buffers[]
Definition: buffers-types.h:84
SPA_TYPE_INFO_PropInfo
#define SPA_TYPE_INFO_PropInfo
Enum Property info.
Definition: props-types.h:104
SPA_TYPE_INFO_PARAM_Buffers
#define SPA_TYPE_INFO_PARAM_Buffers
Definition: buffers-types.h:75
SPA_TYPE_INFO_PARAM_Latency
#define SPA_TYPE_INFO_PARAM_Latency
Definition: latency-types.h:47
SPA_TYPE_INFO_Format
#define SPA_TYPE_INFO_Format
Definition: format-types.h:49
SPA_TYPE_INFO_Profiler
#define SPA_TYPE_INFO_Profiler
Definition: profiler-types.h:46
spa_type_param_process_latency
static const struct spa_type_info spa_type_param_process_latency[]
Definition: latency-types.h:68
SPA_TYPE_INFO_PARAM_ProcessLatency
#define SPA_TYPE_INFO_PARAM_ProcessLatency
Definition: latency-types.h:64
SPA_TYPE_INFO_PARAM_Route
#define SPA_TYPE_INFO_PARAM_Route
Definition: route-types.h:48
SPA_TYPE_INFO_Props
#define SPA_TYPE_INFO_Props
Props Param.
Definition: props-types.h:48
spa_type_profiler
static const struct spa_type_info spa_type_profiler[]
Definition: profiler-types.h:50
spa_type_param_route
static const struct spa_type_info spa_type_param_route[]
Definition: route-types.h:52
SPA_TYPE_INFO_PARAM_PortConfig
#define SPA_TYPE_INFO_PARAM_PortConfig
Definition: port-config-types.h:60
SPA_TYPE_INFO_EVENT_BASE
#define SPA_TYPE_INFO_EVENT_BASE
Definition: spa/include/spa/utils/type.h:155
SPA_TYPE_INFO_BASE
#define SPA_TYPE_INFO_BASE
Definition: spa/include/spa/utils/type.h:115
spa_type_is_a
static bool spa_type_is_a(const char *type, const char *parent)
Definition: utils/type-info.h:49
SPA_TYPE_INFO_POD_BASE
#define SPA_TYPE_INFO_POD_BASE
Definition: spa/include/spa/utils/type.h:130
SPA_TYPE_INFO_Struct
#define SPA_TYPE_INFO_Struct
Definition: spa/include/spa/utils/type.h:133
SPA_TYPE_INFO_Event
#define SPA_TYPE_INFO_Event
Definition: spa/include/spa/utils/type.h:153
SPA_TYPE_INFO_Pointer
#define SPA_TYPE_INFO_Pointer
Definition: spa/include/spa/utils/type.h:143
SPA_TYPE_INFO_Pod
#define SPA_TYPE_INFO_Pod
Definition: spa/include/spa/utils/type.h:128
SPA_TYPE_INFO_Command
#define SPA_TYPE_INFO_Command
Definition: spa/include/spa/utils/type.h:158
SPA_TYPE_INFO_POINTER_BASE
#define SPA_TYPE_INFO_POINTER_BASE
Definition: spa/include/spa/utils/type.h:145
SPA_TYPE_INFO_Object
#define SPA_TYPE_INFO_Object
Definition: spa/include/spa/utils/type.h:138
spa_types
static const struct spa_type_info spa_types[]
Definition: utils/type-info.h:62
SPA_TYPE_INFO_COMMAND_BASE
#define SPA_TYPE_INFO_COMMAND_BASE
Definition: spa/include/spa/utils/type.h:160
SPA_TYPE_POINTER_Buffer
@ SPA_TYPE_POINTER_Buffer
Definition: spa/include/spa/utils/type.h:75
SPA_TYPE_OBJECT_ParamPortConfig
@ SPA_TYPE_OBJECT_ParamPortConfig
Definition: spa/include/spa/utils/type.h:101
SPA_TYPE_Int
@ SPA_TYPE_Int
Definition: spa/include/spa/utils/type.h:54
SPA_TYPE_OBJECT_ParamProfile
@ SPA_TYPE_OBJECT_ParamProfile
Definition: spa/include/spa/utils/type.h:100
SPA_TYPE_COMMAND_START
@ SPA_TYPE_COMMAND_START
Definition: spa/include/spa/utils/type.h:87
SPA_TYPE_POINTER_START
@ SPA_TYPE_POINTER_START
Definition: spa/include/spa/utils/type.h:74
SPA_TYPE_Rectangle
@ SPA_TYPE_Rectangle
Definition: spa/include/spa/utils/type.h:60
SPA_TYPE_Long
@ SPA_TYPE_Long
Definition: spa/include/spa/utils/type.h:55
SPA_TYPE_Bool
@ SPA_TYPE_Bool
Definition: spa/include/spa/utils/type.h:52
SPA_TYPE_Bytes
@ SPA_TYPE_Bytes
Definition: spa/include/spa/utils/type.h:59
SPA_TYPE_EVENT_Device
@ SPA_TYPE_EVENT_Device
Definition: spa/include/spa/utils/type.h:82
SPA_TYPE_Pod
@ SPA_TYPE_Pod
Definition: spa/include/spa/utils/type.h:70
SPA_TYPE_OBJECT_PropInfo
@ SPA_TYPE_OBJECT_PropInfo
Definition: spa/include/spa/utils/type.h:94
SPA_TYPE_OBJECT_START
@ SPA_TYPE_OBJECT_START
Definition: spa/include/spa/utils/type.h:93
SPA_TYPE_Bitmap
@ SPA_TYPE_Bitmap
Definition: spa/include/spa/utils/type.h:62
SPA_TYPE_Object
@ SPA_TYPE_Object
Definition: spa/include/spa/utils/type.h:65
SPA_TYPE_POINTER_Dict
@ SPA_TYPE_POINTER_Dict
Definition: spa/include/spa/utils/type.h:77
SPA_TYPE_Float
@ SPA_TYPE_Float
Definition: spa/include/spa/utils/type.h:56
SPA_TYPE_COMMAND_Device
@ SPA_TYPE_COMMAND_Device
Definition: spa/include/spa/utils/type.h:88
SPA_TYPE_OBJECT_ParamBuffers
@ SPA_TYPE_OBJECT_ParamBuffers
Definition: spa/include/spa/utils/type.h:97
SPA_TYPE_Fraction
@ SPA_TYPE_Fraction
Definition: spa/include/spa/utils/type.h:61
SPA_TYPE_None
@ SPA_TYPE_None
Definition: spa/include/spa/utils/type.h:51
SPA_TYPE_OBJECT_ParamIO
@ SPA_TYPE_OBJECT_ParamIO
Definition: spa/include/spa/utils/type.h:99
SPA_TYPE_OBJECT_Props
@ SPA_TYPE_OBJECT_Props
Definition: spa/include/spa/utils/type.h:95
SPA_TYPE_Sequence
@ SPA_TYPE_Sequence
Definition: spa/include/spa/utils/type.h:66
SPA_TYPE_Double
@ SPA_TYPE_Double
Definition: spa/include/spa/utils/type.h:57
SPA_TYPE_OBJECT_Profiler
@ SPA_TYPE_OBJECT_Profiler
Definition: spa/include/spa/utils/type.h:103
SPA_TYPE_OBJECT_ParamLatency
@ SPA_TYPE_OBJECT_ParamLatency
Definition: spa/include/spa/utils/type.h:104
SPA_TYPE_Id
@ SPA_TYPE_Id
Definition: spa/include/spa/utils/type.h:53
SPA_TYPE_EVENT_START
@ SPA_TYPE_EVENT_START
Definition: spa/include/spa/utils/type.h:81
SPA_TYPE_Choice
@ SPA_TYPE_Choice
Definition: spa/include/spa/utils/type.h:69
SPA_TYPE_EVENT_Node
@ SPA_TYPE_EVENT_Node
Definition: spa/include/spa/utils/type.h:83
SPA_TYPE_Pointer
@ SPA_TYPE_Pointer
Definition: spa/include/spa/utils/type.h:67
SPA_TYPE_Array
@ SPA_TYPE_Array
Definition: spa/include/spa/utils/type.h:63
SPA_TYPE_String
@ SPA_TYPE_String
Definition: spa/include/spa/utils/type.h:58
SPA_TYPE_POINTER_Meta
@ SPA_TYPE_POINTER_Meta
Definition: spa/include/spa/utils/type.h:76
SPA_TYPE_COMMAND_Node
@ SPA_TYPE_COMMAND_Node
Definition: spa/include/spa/utils/type.h:89
SPA_TYPE_OBJECT_ParamProcessLatency
@ SPA_TYPE_OBJECT_ParamProcessLatency
Definition: spa/include/spa/utils/type.h:105
SPA_TYPE_Fd
@ SPA_TYPE_Fd
Definition: spa/include/spa/utils/type.h:68
SPA_TYPE_OBJECT_ParamMeta
@ SPA_TYPE_OBJECT_ParamMeta
Definition: spa/include/spa/utils/type.h:98
SPA_TYPE_OBJECT_ParamRoute
@ SPA_TYPE_OBJECT_ParamRoute
Definition: spa/include/spa/utils/type.h:102
SPA_TYPE_Struct
@ SPA_TYPE_Struct
Definition: spa/include/spa/utils/type.h:64
SPA_TYPE_OBJECT_Format
@ SPA_TYPE_OBJECT_Format
Definition: spa/include/spa/utils/type.h:96
SPA_TYPE_START
@ SPA_TYPE_START
Definition: spa/include/spa/utils/type.h:50
type-info.h
spa/monitor/type-info.h
type-info.h
spa/node/type-info.h
type.h
spa/utils/type.h
spa_type_info
Definition: spa/include/spa/utils/type.h:162