introspect.h
Go to the documentation of this file.
/* PipeWire
* Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __PIPEWIRE_INTROSPECT_H__
#define __PIPEWIRE_INTROSPECT_H__
#include <spa/utils/defs.h>
#include <spa/param/param.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <pipewire/properties.h>
enum pw_node_state {
PW_NODE_STATE_ERROR = -1,
PW_NODE_STATE_CREATING = 0,
PW_NODE_STATE_SUSPENDED = 1,
PW_NODE_STATE_IDLE = 2,
PW_NODE_STATE_RUNNING = 3,
};
const char * pw_node_state_as_string(enum pw_node_state state);
enum pw_direction {
PW_DIRECTION_INPUT = SPA_DIRECTION_INPUT,
PW_DIRECTION_OUTPUT = SPA_DIRECTION_OUTPUT
};
const char * pw_direction_as_string(enum pw_direction direction);
enum pw_link_state {
PW_LINK_STATE_ERROR = -2,
PW_LINK_STATE_UNLINKED = -1,
PW_LINK_STATE_INIT = 0,
PW_LINK_STATE_NEGOTIATING = 1,
PW_LINK_STATE_ALLOCATING = 2,
PW_LINK_STATE_PAUSED = 3,
PW_LINK_STATE_RUNNING = 4,
};
const char * pw_link_state_as_string(enum pw_link_state state);
struct pw_core_info {
uint32_t id;
#define PW_CORE_CHANGE_MASK_USER_NAME (1 << 0)
#define PW_CORE_CHANGE_MASK_HOST_NAME (1 << 1)
#define PW_CORE_CHANGE_MASK_VERSION (1 << 2)
#define PW_CORE_CHANGE_MASK_NAME (1 << 3)
#define PW_CORE_CHANGE_MASK_COOKIE (1 << 4)
#define PW_CORE_CHANGE_MASK_PROPS (1 << 5)
#define PW_CORE_CHANGE_MASK_ALL (~0)
uint64_t change_mask;
const char *user_name;
const char *host_name;
const char *version;
const char *name;
uint32_t cookie;
struct spa_dict *props;
};
struct pw_core_info *
pw_core_info_update(struct pw_core_info *info,
const struct pw_core_info *update);
void pw_core_info_free(struct pw_core_info *info);
struct pw_module_info {
uint32_t id;
#define PW_MODULE_CHANGE_MASK_NAME (1 << 0)
#define PW_MODULE_CHANGE_MASK_FILENAME (1 << 1)
#define PW_MODULE_CHANGE_MASK_ARGS (1 << 2)
#define PW_MODULE_CHANGE_MASK_PROPS (1 << 3)
uint64_t change_mask;
const char *name;
const char *filename;
const char *args;
struct spa_dict *props;
};
struct pw_module_info *
pw_module_info_update(struct pw_module_info *info,
const struct pw_module_info *update);
void pw_module_info_free(struct pw_module_info *info);
struct pw_client_info {
uint32_t id;
#define PW_CLIENT_CHANGE_MASK_PROPS (1 << 0)
uint64_t change_mask;
struct spa_dict *props;
};
struct pw_client_info *
pw_client_info_update(struct pw_client_info *info,
const struct pw_client_info *update);
void pw_client_info_free(struct pw_client_info *info);
struct pw_node_info {
uint32_t id;
#define PW_NODE_CHANGE_MASK_NAME (1 << 0)
#define PW_NODE_CHANGE_MASK_INPUT_PORTS (1 << 1)
#define PW_NODE_CHANGE_MASK_OUTPUT_PORTS (1 << 2)
#define PW_NODE_CHANGE_MASK_STATE (1 << 3)
#define PW_NODE_CHANGE_MASK_PROPS (1 << 4)
#define PW_NODE_CHANGE_MASK_ENUM_PARAMS (1 << 5)
uint64_t change_mask;
const char *name;
uint32_t max_input_ports;
uint32_t n_input_ports;
uint32_t max_output_ports;
uint32_t n_output_ports;
enum pw_node_state state;
const char *error;
struct spa_dict *props;
};
struct pw_node_info *
pw_node_info_update(struct pw_node_info *info,
const struct pw_node_info *update);
void
pw_node_info_free(struct pw_node_info *info);
struct pw_port_info {
uint32_t id;
#define PW_PORT_CHANGE_MASK_NAME (1 << 0)
#define PW_PORT_CHANGE_MASK_PROPS (1 << 1)
#define PW_PORT_CHANGE_MASK_ENUM_PARAMS (1 << 2)
uint64_t change_mask;
const char *name;
struct spa_dict *props;
};
struct pw_port_info *
pw_port_info_update(struct pw_port_info *info,
const struct pw_port_info *update);
void
pw_port_info_free(struct pw_port_info *info);
struct pw_factory_info {
uint32_t id;
const char *name;
uint32_t type;
uint32_t version;
#define PW_FACTORY_CHANGE_MASK_PROPS (1 << 0)
uint64_t change_mask;
struct spa_dict *props;
};
struct pw_factory_info *
pw_factory_info_update(struct pw_factory_info *info,
const struct pw_factory_info *update);
void
pw_factory_info_free(struct pw_factory_info *info);
struct pw_link_info {
uint32_t id;
#define PW_LINK_CHANGE_MASK_OUTPUT (1 << 0)
#define PW_LINK_CHANGE_MASK_INPUT (1 << 1)
#define PW_LINK_CHANGE_MASK_FORMAT (1 << 2)
#define PW_LINK_CHANGE_MASK_PROPS (1 << 3)
uint64_t change_mask;
uint32_t output_node_id;
uint32_t output_port_id;
uint32_t input_node_id;
uint32_t input_port_id;
struct spa_pod *format;
struct spa_dict *props;
};
struct pw_link_info *
pw_link_info_update(struct pw_link_info *info,
const struct pw_link_info *update);
void
pw_link_info_free(struct pw_link_info *info);
#ifdef __cplusplus
}
#endif
#endif /* __PIPEWIRE_INTROSPECT_H__ */
pw_module_info::filename
const char * filename
filename of the module
Definition: introspect.h:111
PW_NODE_STATE_IDLE
the node is running but there is no active port
Definition: introspect.h:38
pw_core_info::props
struct spa_dict * props
extra properties
Definition: introspect.h:91
pw_node_info::n_input_ports
uint32_t n_input_ports
number of inputs
Definition: introspect.h:153
PW_LINK_STATE_UNLINKED
the link is unlinked
Definition: introspect.h:58
pw_core_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:85
pw_node_state
pw_node_state
The different node states.
Definition: introspect.h:33
pw_module_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:109
pw_link_info::output_port_id
uint32_t output_port_id
output port id
Definition: introspect.h:212
pw_core_info::host_name
const char * host_name
name of the machine the core is running on
Definition: introspect.h:87
pw_module_info::args
const char * args
arguments passed to the module
Definition: introspect.h:112
pw_node_info::max_output_ports
uint32_t max_output_ports
maximum number of outputs
Definition: introspect.h:154
pw_link_info::format
struct spa_pod * format
format over link
Definition: introspect.h:215
PW_LINK_STATE_INIT
the link is initialized
Definition: introspect.h:59
pw_link::pw_link_state_as_string
const char * pw_link_state_as_string(enum pw_link_state state)
Convert a pw_link_state to a readable string.
Definition: introspect.c:59
pw_link_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:210
pw_factory_info::version
uint32_t version
version of the objects
Definition: introspect.h:190
pw_port_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:173
pw_factory_info::props
struct spa_dict * props
the properties of the factory
Definition: introspect.h:193
pw_core_info::cookie
uint32_t cookie
a random cookie for identifying this instance of PipeWire
Definition: introspect.h:90
pw_port_info
Definition: introspect.h:168
pw_core_info::id
uint32_t id
id of the global
Definition: introspect.h:77
pw_client_info_free
SPA_EXPORT void pw_client_info_free(struct pw_client_info *info)
Definition: introspect.c:372
pw_link_state
pw_link_state
The different link states.
Definition: introspect.h:56
pw_core_info
The core information.
Definition: introspect.h:76
pw_link_info::id
uint32_t id
id of the global
Definition: introspect.h:205
pw_port_info_free
void pw_port_info_free(struct pw_port_info *info)
Definition: introspect.c:256
pw_factory_info::name
const char * name
name the factory
Definition: introspect.h:188
pw_client_info::id
uint32_t id
id of the global
Definition: introspect.h:126
pw_factory_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:192
pw_core_info::version
const char * version
version of the core
Definition: introspect.h:88
pw_core_info_update
SPA_EXPORT struct pw_core_info * pw_core_info_update(struct pw_core_info *info, const struct pw_core_info *update)
Definition: introspect.c:122
pw_node_info::name
const char * name
name the node, suitable for display
Definition: introspect.h:151
PW_DIRECTION_INPUT
an input port direction
Definition: introspect.h:48
pw_node_info::n_output_ports
uint32_t n_output_ports
number of outputs
Definition: introspect.h:155
pw_port_info::props
struct spa_dict * props
the properties of the port
Definition: introspect.h:175
PW_LINK_STATE_PAUSED
the link is paused
Definition: introspect.h:62
pw_node::pw_node_state_as_string
const char * pw_node_state_as_string(enum pw_node_state state)
Convert a pw_node_state to a readable string.
Definition: introspect.c:27
pw_port_info::id
uint32_t id
id of the global
Definition: introspect.h:169
pw_client_info::props
struct spa_dict * props
extra properties
Definition: introspect.h:129
pw_port_info::name
const char * name
name the port, suitable for display
Definition: introspect.h:174
PW_NODE_STATE_RUNNING
the node is running
Definition: introspect.h:40
pw_factory_info_free
void pw_factory_info_free(struct pw_factory_info *info)
Definition: introspect.c:293
PW_LINK_STATE_NEGOTIATING
the link is negotiating formats
Definition: introspect.h:60
pw_node_info::id
uint32_t id
id of the global
Definition: introspect.h:143
pw_module_info_free
SPA_EXPORT void pw_module_info_free(struct pw_module_info *info)
Definition: introspect.c:337
pw_core_info::user_name
const char * user_name
name of the user that started the core
Definition: introspect.h:86
pw_client_info
The client information.
Definition: introspect.h:125
pw_client_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:128
PW_LINK_STATE_RUNNING
the link is running
Definition: introspect.h:63
pw_node_info::props
struct spa_dict * props
the properties of the node
Definition: introspect.h:158
PW_LINK_STATE_ALLOCATING
the link is allocating buffers
Definition: introspect.h:61
pw_module_info::props
struct spa_dict * props
extra properties
Definition: introspect.h:113
pw_node_info::max_input_ports
uint32_t max_input_ports
maximum number of inputs
Definition: introspect.h:152
PW_LINK_STATE_ERROR
the link is in error
Definition: introspect.h:57
pw_factory_info_update
struct pw_factory_info * pw_factory_info_update(struct pw_factory_info *info, const struct pw_factory_info *update)
Definition: introspect.c:266
pw_link_info
The link information.
Definition: introspect.h:204
pw_factory_info
The factory information.
Definition: introspect.h:186
pw_module_info
The module information.
Definition: introspect.h:103
properties.h
pw_link_info::props
struct spa_dict * props
the properties of the link
Definition: introspect.h:216
pw_node_info_free
void pw_node_info_free(struct pw_node_info *info)
Definition: introspect.c:217
pw_node_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: introspect.h:150
pw_node_info_update
struct pw_node_info * pw_node_info_update(struct pw_node_info *info, const struct pw_node_info *update)
Definition: introspect.c:175
pw_link_info_update
struct pw_link_info * pw_link_info_update(struct pw_link_info *info, const struct pw_link_info *update)
Definition: introspect.c:380
pw_link_info_free
void pw_link_info_free(struct pw_link_info *info)
Definition: introspect.c:410
pw_link_info::input_port_id
uint32_t input_port_id
input port id
Definition: introspect.h:214
pw_factory_info::type
uint32_t type
type of the factory
Definition: introspect.h:189
PW_NODE_STATE_ERROR
error state
Definition: introspect.h:34
pw_link_info::input_node_id
uint32_t input_node_id
server side input node id
Definition: introspect.h:213
PW_NODE_STATE_SUSPENDED
the node is suspended, the device might be closed
Definition: introspect.h:36
pw_link_info::output_node_id
uint32_t output_node_id
server side output node id
Definition: introspect.h:211
pw_factory_info::id
uint32_t id
id of the global
Definition: introspect.h:187
PW_DIRECTION_OUTPUT
an output port direction
Definition: introspect.h:49
pw_port_info_update
struct pw_port_info * pw_port_info_update(struct pw_port_info *info, const struct pw_port_info *update)
Definition: introspect.c:228
pw_module_info_update
SPA_EXPORT struct pw_module_info * pw_module_info_update(struct pw_module_info *info, const struct pw_module_info *update)
Definition: introspect.c:302
PW_NODE_STATE_CREATING
the node is being created
Definition: introspect.h:35
pw_client_info_update
SPA_EXPORT struct pw_client_info * pw_client_info_update(struct pw_client_info *info, const struct pw_client_info *update)
Definition: introspect.c:349
pw_module_info::id
uint32_t id
id of the global
Definition: introspect.h:104
pw_node_info
The node information.
Definition: introspect.h:142
pw_introspect::pw_direction_as_string
const char * pw_direction_as_string(enum pw_direction direction)
Convert a pw_direction to a readable string.
Definition: introspect.c:45
pw_core_info::name
const char * name
name of the core
Definition: introspect.h:89
pw_core_info_free
SPA_EXPORT void pw_core_info_free(struct pw_core_info *info)
Definition: introspect.c:163
pw_direction
pw_direction
The direction of a port.
Definition: introspect.h:47
pw_module_info::name
const char * name
name of the module
Definition: introspect.h:110
pw_node_info::error
const char * error
an error reason if state is error
Definition: introspect.h:157