PipeWire  0.2.0
introspect.h
Go to the documentation of this file.
1 /* PipeWire
2  * Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __PIPEWIRE_INTROSPECT_H__
21 #define __PIPEWIRE_INTROSPECT_H__
22 
23 #include <spa/utils/defs.h>
24 #include <spa/param/param.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include <pipewire/properties.h>
31 
41 };
42 
44 const char * pw_node_state_as_string(enum pw_node_state state);
45 
48  PW_DIRECTION_INPUT = SPA_DIRECTION_INPUT,
49  PW_DIRECTION_OUTPUT = SPA_DIRECTION_OUTPUT
50 };
51 
53 const char * pw_direction_as_string(enum pw_direction direction);
54 
64 };
65 
67 const char * pw_link_state_as_string(enum pw_link_state state);
68 
76 struct pw_core_info {
77  uint32_t id;
78 #define PW_CORE_CHANGE_MASK_USER_NAME (1 << 0)
79 #define PW_CORE_CHANGE_MASK_HOST_NAME (1 << 1)
80 #define PW_CORE_CHANGE_MASK_VERSION (1 << 2)
81 #define PW_CORE_CHANGE_MASK_NAME (1 << 3)
82 #define PW_CORE_CHANGE_MASK_COOKIE (1 << 4)
83 #define PW_CORE_CHANGE_MASK_PROPS (1 << 5)
84 #define PW_CORE_CHANGE_MASK_ALL (~0)
85  uint64_t change_mask;
86  const char *user_name;
87  const char *host_name;
88  const char *version;
89  const char *name;
90  uint32_t cookie;
91  struct spa_dict *props;
92 };
93 
95 struct pw_core_info *
97  const struct pw_core_info *update);
98 
100 void pw_core_info_free(struct pw_core_info *info);
101 
104  uint32_t id;
105 #define PW_MODULE_CHANGE_MASK_NAME (1 << 0)
106 #define PW_MODULE_CHANGE_MASK_FILENAME (1 << 1)
107 #define PW_MODULE_CHANGE_MASK_ARGS (1 << 2)
108 #define PW_MODULE_CHANGE_MASK_PROPS (1 << 3)
109  uint64_t change_mask;
110  const char *name;
111  const char *filename;
112  const char *args;
113  struct spa_dict *props;
114 };
115 
117 struct pw_module_info *
119  const struct pw_module_info *update);
120 
122 void pw_module_info_free(struct pw_module_info *info);
123 
126  uint32_t id;
127 #define PW_CLIENT_CHANGE_MASK_PROPS (1 << 0)
128  uint64_t change_mask;
129  struct spa_dict *props;
130 };
131 
133 struct pw_client_info *
135  const struct pw_client_info *update);
136 
138 void pw_client_info_free(struct pw_client_info *info);
139 
140 
142 struct pw_node_info {
143  uint32_t id;
144 #define PW_NODE_CHANGE_MASK_NAME (1 << 0)
145 #define PW_NODE_CHANGE_MASK_INPUT_PORTS (1 << 1)
146 #define PW_NODE_CHANGE_MASK_OUTPUT_PORTS (1 << 2)
147 #define PW_NODE_CHANGE_MASK_STATE (1 << 3)
148 #define PW_NODE_CHANGE_MASK_PROPS (1 << 4)
149 #define PW_NODE_CHANGE_MASK_ENUM_PARAMS (1 << 5)
150  uint64_t change_mask;
151  const char *name;
152  uint32_t max_input_ports;
153  uint32_t n_input_ports;
154  uint32_t max_output_ports;
155  uint32_t n_output_ports;
157  const char *error;
158  struct spa_dict *props;
159 };
160 
161 struct pw_node_info *
162 pw_node_info_update(struct pw_node_info *info,
163  const struct pw_node_info *update);
164 
165 void
166 pw_node_info_free(struct pw_node_info *info);
167 
168 struct pw_port_info {
169  uint32_t id;
170 #define PW_PORT_CHANGE_MASK_NAME (1 << 0)
171 #define PW_PORT_CHANGE_MASK_PROPS (1 << 1)
172 #define PW_PORT_CHANGE_MASK_ENUM_PARAMS (1 << 2)
173  uint64_t change_mask;
174  const char *name;
175  struct spa_dict *props;
176 };
177 
178 struct pw_port_info *
179 pw_port_info_update(struct pw_port_info *info,
180  const struct pw_port_info *update);
181 
182 void
183 pw_port_info_free(struct pw_port_info *info);
184 
187  uint32_t id;
188  const char *name;
189  uint32_t type;
190  uint32_t version;
191 #define PW_FACTORY_CHANGE_MASK_PROPS (1 << 0)
192  uint64_t change_mask;
193  struct spa_dict *props;
194 };
195 
196 struct pw_factory_info *
198  const struct pw_factory_info *update);
199 
200 void
202 
204 struct pw_link_info {
205  uint32_t id;
206 #define PW_LINK_CHANGE_MASK_OUTPUT (1 << 0)
207 #define PW_LINK_CHANGE_MASK_INPUT (1 << 1)
208 #define PW_LINK_CHANGE_MASK_FORMAT (1 << 2)
209 #define PW_LINK_CHANGE_MASK_PROPS (1 << 3)
210  uint64_t change_mask;
211  uint32_t output_node_id;
212  uint32_t output_port_id;
213  uint32_t input_node_id;
214  uint32_t input_port_id;
215  struct spa_pod *format;
216  struct spa_dict *props;
217 };
218 
219 struct pw_link_info *
220 pw_link_info_update(struct pw_link_info *info,
221  const struct pw_link_info *update);
222 
223 void
224 pw_link_info_free(struct pw_link_info *info);
225 
226 #ifdef __cplusplus
227 }
228 #endif
229 
230 #endif /* __PIPEWIRE_INTROSPECT_H__ */
const char * filename
filename of the module
Definition: introspect.h:111
the node is running but there is no active port
Definition: introspect.h:38
struct spa_dict * props
extra properties
Definition: introspect.h:91
uint32_t n_input_ports
number of inputs
Definition: introspect.h:153
the link is unlinked
Definition: introspect.h:58
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:85
pw_node_state
The different node states.
Definition: introspect.h:33
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:109
const char * host_name
name of the machine the core is running on
Definition: introspect.h:87
const char * args
arguments passed to the module
Definition: introspect.h:112
uint32_t max_output_ports
maximum number of outputs
Definition: introspect.h:154
the link is initialized
Definition: introspect.h:59
uint32_t version
version of the objects
Definition: introspect.h:190
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:173
struct spa_dict * props
the properties of the factory
Definition: introspect.h:193
uint32_t cookie
a random cookie for identifying this instance of PipeWire
Definition: introspect.h:90
Definition: introspect.h:168
uint32_t id
id of the global
Definition: introspect.h:77
struct pw_module_info * pw_module_info_update(struct pw_module_info *info, const struct pw_module_info *update)
Update and existing pw_module_info with update.
Definition: introspect.c:306
pw_link_state
The different link states.
Definition: introspect.h:56
The core information.
Definition: introspect.h:76
void pw_port_info_free(struct pw_port_info *info)
Definition: introspect.c:260
const char * name
name the factory
Definition: introspect.h:188
enum pw_node_state state
the current state of the node
Definition: introspect.h:156
uint32_t id
id of the global
Definition: introspect.h:126
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:192
const char * version
version of the core
Definition: introspect.h:88
const char * name
name the node, suitable for display
Definition: introspect.h:151
an input port direction
Definition: introspect.h:48
uint32_t n_output_ports
number of outputs
Definition: introspect.h:155
struct spa_dict * props
the properties of the port
Definition: introspect.h:175
the link is paused
Definition: introspect.h:62
const char * pw_node_state_as_string(enum pw_node_state state)
Convert a pw_node_state to a readable string.
Definition: introspect.c:26
uint32_t id
id of the global
Definition: introspect.h:169
struct spa_dict * props
extra properties
Definition: introspect.h:129
void pw_client_info_free(struct pw_client_info *info)
Free a pw_client_info.
Definition: introspect.c:379
const char * name
name the port, suitable for display
Definition: introspect.h:174
struct pw_client_info * pw_client_info_update(struct pw_client_info *info, const struct pw_client_info *update)
Update and existing pw_client_info with update.
Definition: introspect.c:357
the node is running
Definition: introspect.h:40
void pw_factory_info_free(struct pw_factory_info *info)
Definition: introspect.c:297
the link is negotiating formats
Definition: introspect.h:60
uint32_t id
id of the global
Definition: introspect.h:143
const char * user_name
name of the user that started the core
Definition: introspect.h:86
The client information.
Definition: introspect.h:125
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:128
the link is running
Definition: introspect.h:63
struct spa_dict * props
the properties of the node
Definition: introspect.h:158
the link is allocating buffers
Definition: introspect.h:61
struct spa_dict * props
extra properties
Definition: introspect.h:113
uint32_t max_input_ports
maximum number of inputs
Definition: introspect.h:152
the link is in error
Definition: introspect.h:57
struct pw_factory_info * pw_factory_info_update(struct pw_factory_info *info, const struct pw_factory_info *update)
Definition: introspect.c:270
The factory information.
Definition: introspect.h:186
The module information.
Definition: introspect.h:103
void pw_core_info_free(struct pw_core_info *info)
Free a pw_core_info.
Definition: introspect.c:162
void pw_node_info_free(struct pw_node_info *info)
Definition: introspect.c:220
void pw_module_info_free(struct pw_module_info *info)
Free a pw_module_info.
Definition: introspect.c:343
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:150
struct pw_node_info * pw_node_info_update(struct pw_node_info *info, const struct pw_node_info *update)
Definition: introspect.c:177
struct pw_link_info * pw_link_info_update(struct pw_link_info *info, const struct pw_link_info *update)
Definition: introspect.c:386
void pw_link_info_free(struct pw_link_info *info)
Definition: introspect.c:416
uint32_t type
type of the factory
Definition: introspect.h:189
error state
Definition: introspect.h:34
the node is suspended, the device might be closed
Definition: introspect.h:36
uint32_t id
id of the global
Definition: introspect.h:187
an output port direction
Definition: introspect.h:49
struct pw_port_info * pw_port_info_update(struct pw_port_info *info, const struct pw_port_info *update)
Definition: introspect.c:232
the node is being created
Definition: introspect.h:35
uint32_t id
id of the global
Definition: introspect.h:104
The node information.
Definition: introspect.h:142
const char * pw_direction_as_string(enum pw_direction direction)
Convert a pw_direction to a readable string.
Definition: introspect.c:43
const char * name
name of the core
Definition: introspect.h:89
struct pw_core_info * pw_core_info_update(struct pw_core_info *info, const struct pw_core_info *update)
Update and existing pw_core_info with update.
Definition: introspect.c:118
pw_direction
The direction of a port.
Definition: introspect.h:47
const char * name
name of the module
Definition: introspect.h:110
const char * error
an error reason if state is error
Definition: introspect.h:157