PipeWire  0.1.4
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/defs.h>
24 #include <spa/format.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 #define PW_CORE_CHANGE_MASK_USER_NAME (1 << 0)
78 #define PW_CORE_CHANGE_MASK_HOST_NAME (1 << 1)
79 #define PW_CORE_CHANGE_MASK_VERSION (1 << 2)
80 #define PW_CORE_CHANGE_MASK_NAME (1 << 3)
81 #define PW_CORE_CHANGE_MASK_COOKIE (1 << 4)
82 #define PW_CORE_CHANGE_MASK_PROPS (1 << 5)
83 #define PW_CORE_CHANGE_MASK_ALL (~0)
84  uint64_t change_mask;
85  const char *user_name;
86  const char *host_name;
87  const char *version;
88  const char *name;
89  uint32_t cookie;
90  struct spa_dict *props;
91 };
92 
94 struct pw_core_info *
96  const struct pw_core_info *update);
97 
99 void pw_core_info_free(struct pw_core_info *info);
100 
103  uint64_t change_mask;
104  const char *name;
105  const char *filename;
106  const char *args;
107  struct spa_dict *props;
108 };
109 
111 struct pw_module_info *
113  const struct pw_module_info *update);
114 
116 void pw_module_info_free(struct pw_module_info *info);
117 
120 #define PW_CLIENT_CHANGE_MASK_PROPS (1 << 0)
121  uint64_t change_mask;
122  struct spa_dict *props;
123 };
124 
126 struct pw_client_info *
128  const struct pw_client_info *update);
129 
131 void pw_client_info_free(struct pw_client_info *info);
132 
133 
135 struct pw_node_info {
136 #define PW_NODE_CHANGE_MASK_NAME (1 << 0)
137 #define PW_NODE_CHANGE_MASK_INPUT_PORTS (1 << 1)
138 #define PW_NODE_CHANGE_MASK_INPUT_FORMATS (1 << 2)
139 #define PW_NODE_CHANGE_MASK_OUTPUT_PORTS (1 << 3)
140 #define PW_NODE_CHANGE_MASK_OUTPUT_FORMATS (1 << 4)
141 #define PW_NODE_CHANGE_MASK_STATE (1 << 5)
142 #define PW_NODE_CHANGE_MASK_PROPS (1 << 6)
143  uint64_t change_mask;
144  const char *name;
145  uint32_t max_input_ports;
146  uint32_t n_input_ports;
147  uint32_t n_input_formats;
148  struct spa_format **input_formats;
149  uint32_t max_output_ports;
150  uint32_t n_output_ports;
151  uint32_t n_output_formats;
152  struct spa_format **output_formats;
153  enum pw_node_state state;
154  const char *error;
155  struct spa_dict *props;
156 };
157 
158 struct pw_node_info *
159 pw_node_info_update(struct pw_node_info *info,
160  const struct pw_node_info *update);
161 
162 void
163 pw_node_info_free(struct pw_node_info *info);
164 
165 
167 struct pw_link_info {
168 #define PW_LINK_CHANGE_MASK_OUTPUT (1 << 0)
169 #define PW_LINK_CHANGE_MASK_INPUT (1 << 1)
170 #define PW_LINK_CHANGE_MASK_FORMAT (1 << 2)
171 #define PW_LINK_CHANGE_MASK_PROPS (1 << 3)
172  uint64_t change_mask;
173  uint32_t output_node_id;
174  uint32_t output_port_id;
175  uint32_t input_node_id;
176  uint32_t input_port_id;
177  struct spa_format *format;
178  struct spa_dict *props;
179 };
180 
181 struct pw_link_info *
182 pw_link_info_update(struct pw_link_info *info,
183  const struct pw_link_info *update);
184 
185 void
186 pw_link_info_free(struct pw_link_info *info);
187 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif /* __PIPEWIRE_INTROSPECT_H__ */
struct spa_format ** input_formats
array of input formats
Definition: introspect.h:148
const char * filename
filename of the module
Definition: introspect.h:105
struct pw_core_info * pw_core_info_update(struct pw_core_info *info, const struct pw_core_info *update)
Definition: introspect.c:117
the node is running but there is no active port
Definition: introspect.h:38
struct spa_format ** output_formats
array of output formats
Definition: introspect.h:152
struct spa_dict * props
extra properties
Definition: introspect.h:90
uint32_t n_input_ports
number of inputs
Definition: introspect.h:146
void pw_core_info_free(struct pw_core_info *info)
Definition: introspect.c:160
the link is unlinked
Definition: introspect.h:58
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:84
pw_node_state
The different node states.
Definition: introspect.h:33
void pw_client_info_free(struct pw_client_info *info)
Definition: introspect.c:344
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:103
const char * host_name
name of the machine the core is running on
Definition: introspect.h:86
const char * args
arguments passed to the module
Definition: introspect.h:106
uint32_t max_output_ports
maximum number of outputs
Definition: introspect.h:149
the link is initialized
Definition: introspect.h:59
uint32_t cookie
a random cookie for identifying this instance of PipeWire
Definition: introspect.h:89
pw_link_state
The different link states.
Definition: introspect.h:56
The core information.
Definition: introspect.h:76
const char * version
version of the core
Definition: introspect.h:87
void pw_module_info_free(struct pw_module_info *info)
Definition: introspect.c:309
const char * name
name the node, suitable for display
Definition: introspect.h:144
an input port direction
Definition: introspect.h:48
uint32_t n_output_ports
number of outputs
Definition: introspect.h:150
the link is paused
Definition: introspect.h:62
struct spa_dict * props
extra properties
Definition: introspect.h:122
the node is running
Definition: introspect.h:40
the link is negotiating formats
Definition: introspect.h:60
uint32_t n_input_formats
number of input formats
Definition: introspect.h:147
const char * user_name
name of the user that started the core
Definition: introspect.h:85
The client information.
Definition: introspect.h:119
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
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:121
the link is running
Definition: introspect.h:63
struct spa_dict * props
the properties of the node
Definition: introspect.h:155
the link is allocating buffers
Definition: introspect.h:61
struct spa_dict * props
extra properties
Definition: introspect.h:107
uint32_t max_input_ports
maximum number of inputs
Definition: introspect.h:145
the link is in error
Definition: introspect.h:57
uint32_t n_output_formats
number of output formats
Definition: introspect.h:151
The module information.
Definition: introspect.h:102
void pw_node_info_free(struct pw_node_info *info)
Definition: introspect.c:250
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:143
struct pw_node_info * pw_node_info_update(struct pw_node_info *info, const struct pw_node_info *update)
Definition: introspect.c:175
struct pw_link_info * pw_link_info_update(struct pw_link_info *info, const struct pw_link_info *update)
Definition: introspect.c:351
void pw_link_info_free(struct pw_link_info *info)
Definition: introspect.c:380
error state
Definition: introspect.h:34
the node is suspended, the device might be closed
Definition: introspect.h:36
an output port direction
Definition: introspect.h:49
the node is being created
Definition: introspect.h:35
struct pw_client_info * pw_client_info_update(struct pw_client_info *info, const struct pw_client_info *update)
Definition: introspect.c:323
The node information.
Definition: introspect.h:135
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:88
pw_direction
The direction of a port.
Definition: introspect.h:47
const char * name
name of the module
Definition: introspect.h:104
struct pw_module_info * pw_module_info_update(struct pw_module_info *info, const struct pw_module_info *update)
Definition: introspect.c:273
const char * error
an error reason if state is error
Definition: introspect.h:154