PipeWire  0.3.33
impl-node.h
Go to the documentation of this file.
1 /* PipeWire
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 PIPEWIRE_IMPL_NODE_H
26 #define PIPEWIRE_IMPL_NODE_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
42 struct pw_impl_node;
43 struct pw_impl_port;
44 
45 #include <spa/node/node.h>
46 #include <spa/node/event.h>
47 
48 #include <pipewire/impl.h>
49 
52 #define PW_VERSION_IMPL_NODE_EVENTS 0
53  uint32_t version;
54 
56  void (*destroy) (void *data);
58  void (*free) (void *data);
60  void (*initialized) (void *data);
61 
63  void (*port_init) (void *data, struct pw_impl_port *port);
65  void (*port_added) (void *data, struct pw_impl_port *port);
67  void (*port_removed) (void *data, struct pw_impl_port *port);
68 
70  void (*info_changed) (void *data, const struct pw_node_info *info);
72  void (*port_info_changed) (void *data, struct pw_impl_port *port,
73  const struct pw_port_info *info);
75  void (*active_changed) (void *data, bool active);
76 
78  void (*state_request) (void *data, enum pw_node_state state);
80  void (*state_changed) (void *data, enum pw_node_state old,
81  enum pw_node_state state, const char *error);
82 
84  void (*result) (void *data, int seq, int res, uint32_t type, const void *result);
85 
87  void (*event) (void *data, const struct spa_event *event);
88 
90  void (*driver_changed) (void *data, struct pw_impl_node *old, struct pw_impl_node *driver);
91 
93  void (*peer_added) (void *data, struct pw_impl_node *peer);
95  void (*peer_removed) (void *data, struct pw_impl_node *peer);
96 };
97 
99 struct pw_impl_node *
100 pw_context_create_node(struct pw_context *context,
101  struct pw_properties *properties,
102  size_t user_data_size );
103 
105 int pw_impl_node_register(struct pw_impl_node *node,
106  struct pw_properties *properties );
107 
109 void pw_impl_node_destroy(struct pw_impl_node *node);
110 
112 const struct pw_node_info *pw_impl_node_get_info(struct pw_impl_node *node);
113 
115 void * pw_impl_node_get_user_data(struct pw_impl_node *node);
116 
118 struct pw_context *pw_impl_node_get_context(struct pw_impl_node *node);
119 
121 struct pw_global *pw_impl_node_get_global(struct pw_impl_node *node);
122 
124 const struct pw_properties *pw_impl_node_get_properties(struct pw_impl_node *node);
125 
127 int pw_impl_node_update_properties(struct pw_impl_node *node, const struct spa_dict *dict);
128 
130 int pw_impl_node_set_implementation(struct pw_impl_node *node, struct spa_node *spa_node);
131 
133 struct spa_node *pw_impl_node_get_implementation(struct pw_impl_node *node);
134 
136 void pw_impl_node_add_listener(struct pw_impl_node *node,
137  struct spa_hook *listener,
138  const struct pw_impl_node_events *events,
139  void *data);
140 
145 int pw_impl_node_for_each_port(struct pw_impl_node *node,
146  enum pw_direction direction,
147  int (*callback) (void *data, struct pw_impl_port *port),
148  void *data);
149 
150 int pw_impl_node_for_each_param(struct pw_impl_node *node,
151  int seq, uint32_t param_id,
152  uint32_t index, uint32_t max,
153  const struct spa_pod *filter,
154  int (*callback) (void *data, int seq,
155  uint32_t id, uint32_t index, uint32_t next,
156  struct spa_pod *param),
157  void *data);
158 
161 struct pw_impl_port *
162 pw_impl_node_find_port(struct pw_impl_node *node, enum pw_direction direction, uint32_t port_id);
163 
165 uint32_t pw_impl_node_get_free_port_id(struct pw_impl_node *node, enum pw_direction direction);
166 
167 int pw_impl_node_initialized(struct pw_impl_node *node);
168 
171 int pw_impl_node_set_active(struct pw_impl_node *node, bool active);
172 
174 bool pw_impl_node_is_active(struct pw_impl_node *node);
175 
180 #ifdef __cplusplus
181 }
182 #endif
183 
184 #endif /* PIPEWIRE_IMPL_NODE_H */
SPA_MAX
#define SPA_MAX(a, b)
Definition: defs.h:129
PW_DIRECTION_INPUT
#define PW_DIRECTION_INPUT
Definition: port.h:57
SPA_IO_SEGMENT_VIDEO_FLAG_VALID
#define SPA_IO_SEGMENT_VIDEO_FLAG_VALID
Definition: io.h:188
spa_source::mask
uint32_t mask
Definition: build-12683127/doc/spa/support/loop.h:63
pw_properties_get
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
pw_work_queue_destroy
void pw_work_queue_destroy(struct pw_work_queue *queue)
Destroy a work queue.
Definition: work-queue.c:132
SPA_STATUS_DRAINED
#define SPA_STATUS_DRAINED
Definition: io.h:98
spa_rectangle::width
uint32_t width
Definition: defs.h:87
spa_io_segment::version
uint32_t version
Definition: io.h:224
PW_KEY_NODE_SESSION
#define PW_KEY_NODE_SESSION
the session id this node is part of
Definition: src/pipewire/keys.h:145
pw_impl_node_for_each_param
int pw_impl_node_for_each_param(struct pw_impl_node *node, int seq, uint32_t param_id, uint32_t index, uint32_t max, const struct spa_pod *filter, int(*callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
Definition: impl-node.c:1839
PW_KEY_MEDIA_ROLE
#define PW_KEY_MEDIA_ROLE
Role: Movie, Music, Camera, Screen, Communication, Game, Notification, DSP, Production,...
Definition: src/pipewire/keys.h:281
spa_direction
spa_direction
Definition: defs.h:78
node::props
struct pw_properties * props
Definition: alsa-monitor.c:74
spa_node_callbacks
Node callbacks.
Definition: build-12683127/doc/spa/node/node.h:207
spa_result_node_params::next
uint32_t next
next index of iteration
Definition: build-12683127/doc/spa/node/node.h:140
PW_VERSION_NODE
#define PW_VERSION_NODE
Definition: src/pipewire/node.h:52
resource_data::subscribe_ids
uint32_t subscribe_ids[MAX_PARAMS]
Definition: impl-device.c:68
result_node_params_data
Definition: impl-node.c:1804
PW_NODE_CHANGE_MASK_ALL
#define PW_NODE_CHANGE_MASK_ALL
Definition: src/pipewire/node.h:79
pw_impl_node_events::destroy
void(* destroy)(void *data)
the node is destroyed
Definition: impl-node.h:56
PW_KEY_NODE_PAUSE_ON_IDLE
#define PW_KEY_NODE_PAUSE_ON_IDLE
pause the node when idle
Definition: src/pipewire/keys.h:169
spa_node_info
Node information structure.
Definition: build-12683127/doc/spa/node/node.h:60
SPA_IO_Position
@ SPA_IO_Position
position information in the graph, struct spa_io_position
Definition: io.h:59
SPA_VERSION_NODE_CALLBACKS
#define SPA_VERSION_NODE_CALLBACKS
Definition: build-12683127/doc/spa/node/node.h:208
SPA_NODE_CHANGE_MASK_PROPS
#define SPA_NODE_CHANGE_MASK_PROPS
Definition: build-12683127/doc/spa/node/node.h:64
PW_MEMBLOCK_FLAG_READWRITE
@ PW_MEMBLOCK_FLAG_READWRITE
Definition: src/pipewire/mem.h:53
spa_zero
#define spa_zero(x)
Definition: defs.h:303
PW_KEY_OBJECT_ID
#define PW_KEY_OBJECT_ID
a global object id
Definition: src/pipewire/keys.h:66
pw_impl_port_set_param
int pw_impl_port_set_param(struct pw_impl_port *port, uint32_t id, uint32_t flags, const struct spa_pod *param)
Definition: impl-port.c:1365
pw_global_register
int pw_global_register(struct pw_global *global)
Register a global object to the context registry.
Definition: global.c:125
SPA_IO_POSITION_MAX_SEGMENTS
#define SPA_IO_POSITION_MAX_SEGMENTS
the maximum number of segments visible in the future
Definition: io.h:257
spa_node_set_io
#define spa_node_set_io(n,...)
Definition: build-12683127/doc/spa/node/node.h:653
types.h
pw_impl_node_get_free_port_id
uint32_t pw_impl_node_get_free_port_id(struct pw_impl_node *node, enum pw_direction direction)
Get a free unused port_id from the node.
Definition: impl-node.c:1963
pw_impl_node_initialized
int pw_impl_node_initialized(struct pw_impl_node *this)
Definition: impl-node.c:727
pw_impl_node_find_port
struct pw_impl_port * pw_impl_node_find_port(struct pw_impl_node *node, enum pw_direction direction, uint32_t port_id)
Find the port with direction and port_id or NULL when not found.
Definition: impl-node.c:1928
node.h
pw_impl_node_get_properties
const struct pw_properties * pw_impl_node_get_properties(struct pw_impl_node *node)
Get the node properties.
Definition: impl-node.c:1255
spa_io_video_size::flags
uint32_t flags
optional flags
Definition: io.h:153
PW_KEY_MODULE_ID
#define PW_KEY_MODULE_ID
module properties
Definition: src/pipewire/keys.h:249
PW_KEY_NODE_RATE
#define PW_KEY_NODE_RATE
the requested rate of the graph as a fraction.
Definition: src/pipewire/keys.h:160
event.h
node::name
char name[256]
Definition: module-filter-chain.c:156
resource_data
Definition: impl-core.c:74
name
const char * name
Definition: media-session.c:2379
resource_data::seq
int seq
Definition: impl-device.c:72
PW_NODE_STATE_RUNNING
@ PW_NODE_STATE_RUNNING
the node is running
Definition: src/pipewire/node.h:63
SYNC_CHECK
#define SYNC_CHECK
Definition: impl-node.c:1429
string.h
spa_node_info::props
struct spa_dict * props
extra node properties
Definition: build-12683127/doc/spa/node/node.h:82
node::link
struct spa_list link
link in impl node_list
Definition: module-filter-chain.c:151
pw_context_recalc_graph
int pw_context_recalc_graph(struct pw_context *context, const char *reason)
Definition: context.c:1092
PW_VERSION_NODE_METHODS
#define PW_VERSION_NODE_METHODS
Definition: src/pipewire/node.h:136
data
user data to add to an object
Definition: filter.c:75
SPA_FRACTION
#define SPA_FRACTION(num, denom)
Definition: defs.h:103
pw_global_new
struct pw_global * pw_global_new(struct pw_context *context, const char *type, uint32_t version, struct pw_properties *properties, pw_global_bind_func_t func, void *object)
Create a new global object.
Definition: global.c:66
pw_global_add_resource
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:230
pw_mempool_alloc
struct pw_memblock * pw_mempool_alloc(struct pw_mempool *pool, enum pw_memblock_flags flags, uint32_t type, size_t size)
Allocate a memory block from the pool.
Definition: mem.c:464
spa_streq
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
PW_KEY_OBJECT_PATH
#define PW_KEY_OBJECT_PATH
object properties
Definition: src/pipewire/keys.h:65
spa_io_segment::duration
uint64_t duration
duration when this info becomes invalid expressed in running time.
Definition: io.h:235
resource_data::resource_listener
struct spa_hook resource_listener
Definition: impl-core.c:76
spa_list_for_each
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
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:34
impl::param_list
struct spa_list param_list
Definition: impl-device.c:40
pw_impl_node_update_properties
int pw_impl_node_update_properties(struct pw_impl_node *node, const struct spa_dict *dict)
Update the node properties.
Definition: impl-node.c:1286
pw_context_create_port
struct pw_impl_port * pw_context_create_port(struct pw_context *context, enum pw_direction direction, uint32_t port_id, const struct spa_port_info *info, size_t user_data_size)
Create a new port.
Definition: impl-port.c:443
spa_aprintf
#define spa_aprintf(_fmt,...)
Definition: defs.h:323
SPA_EXPORT
#define SPA_EXPORT
Definition: defs.h:208
PW_NODE_STATE_IDLE
@ PW_NODE_STATE_IDLE
the node is running but there is no active port
Definition: src/pipewire/node.h:61
pw_impl_node_is_active
bool pw_impl_node_is_active(struct pw_impl_node *node)
Check if a node is active.
Definition: impl-node.c:2133
pw_global_events
Global events, use pw_global_add_listener.
Definition: global.h:68
impl::seq
int seq
Definition: policy-ep.c:65
result_node_params_data::count
uint32_t count
Definition: impl-node.c:1811
pw_log_trace
#define pw_log_trace(...)
Definition: src/pipewire/log.h:90
spa_result_node_params::id
uint32_t id
id of parameter
Definition: build-12683127/doc/spa/node/node.h:138
spa_node_enum_params
#define spa_node_enum_params(n,...)
Definition: build-12683127/doc/spa/node/node.h:651
result_node_params_data::impl
struct impl * impl
Definition: impl-node.c:1805
spa_io_segment::rate
double rate
overall rate of the segment, can be negative for backwards time reporting.
Definition: io.h:240
SPA_EVENT_TYPE
#define SPA_EVENT_TYPE(ev)
Definition: pod/event.h:48
spa_source::fd
int fd
Definition: build-12683127/doc/spa/support/loop.h:62
node
Definition: module-filter-chain.c:150
node::listener
struct spa_hook listener
Definition: bluez-autoswitch.c:81
PW_NODE_STATE_CREATING
@ PW_NODE_STATE_CREATING
the node is being created
Definition: src/pipewire/node.h:58
spa_loop_remove_source
#define spa_loop_remove_source(l,...)
Definition: build-12683127/doc/spa/support/loop.h:117
pw_impl_port_register
int pw_impl_port_register(struct pw_impl_port *port, struct pw_properties *properties)
Definition: impl-port.c:877
SPA_NODE_FLAG_IN_DYNAMIC_PORTS
#define SPA_NODE_FLAG_IN_DYNAMIC_PORTS
input ports can be added/removed
Definition: build-12683127/doc/spa/node/node.h:69
spa_fraction
Definition: defs.h:104
spa_io_position::video
struct spa_io_video_size video
size of the video in the current cycle
Definition: io.h:274
spa_result_node_params::index
uint32_t index
index of parameter
Definition: build-12683127/doc/spa/node/node.h:139
impl
Definition: control.c:33
spa_io_position
The position information adds extra meaning to the raw clock times.
Definition: io.h:271
PW_NODE_STATE_ERROR
@ PW_NODE_STATE_ERROR
error state
Definition: src/pipewire/node.h:57
pw_work_queue_complete
int pw_work_queue_complete(struct pw_work_queue *queue, void *obj, uint32_t seq, int res)
Complete a work item.
Definition: work-queue.c:247
PW_NODE_CHANGE_MASK_STATE
#define PW_NODE_CHANGE_MASK_STATE
Definition: src/pipewire/node.h:76
SPA_PARAM_INFO_READ
#define SPA_PARAM_INFO_READ
Definition: param.h:68
pw_impl_node_set_implementation
int pw_impl_node_set_implementation(struct pw_impl_node *node, struct spa_node *spa_node)
Set the node implementation.
Definition: impl-node.c:1663
result_node_params_data::data
void * data
Definition: impl-node.c:1806
spa_io_segment::flags
uint32_t flags
extra flags
Definition: io.h:230
spa_node_process
#define spa_node_process(n)
Definition: build-12683127/doc/spa/node/node.h:663
SPA_NSEC_PER_SEC
#define SPA_NSEC_PER_SEC
Definition: defs.h:184
spa_hook_list_append
void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data)
Append a hook.
Definition: hook.h:316
spa_list
Definition: list.h:37
SPA_PTROFF
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
pw_impl_node_events::peer_added
void(* peer_added)(void *data, struct pw_impl_node *peer)
a peer was added
Definition: impl-node.h:93
SPA_RESULT_IS_ERROR
#define SPA_RESULT_IS_ERROR(res)
Definition: result.h:45
spa_io_segment_video::flags
uint32_t flags
flags
Definition: io.h:192
PW_NODE_CHANGE_MASK_PARAMS
#define PW_NODE_CHANGE_MASK_PARAMS
Definition: src/pipewire/node.h:78
impl::id
uint32_t id
Definition: module-echo-cancel.c:139
spa_source::func
spa_source_func_t func
Definition: build-12683127/doc/spa/support/loop.h:60
pw_impl_node_events::version
uint32_t version
Definition: impl-node.h:53
spa_io_clock
Absolute time reporting.
Definition: io.h:132
impl::info
struct spa_audio_info_raw info
Definition: module-echo-cancel.c:145
impl.h
spa_source
Definition: build-12683127/doc/spa/support/loop.h:58
spa_loop
Definition: build-12683127/doc/spa/support/loop.h:44
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
spa_pod_filter
int spa_pod_filter(struct spa_pod_builder *b, struct spa_pod **result, const struct spa_pod *pod, const struct spa_pod *filter)
Definition: build-12683127/doc/spa/pod/filter.h:387
SPA_CONTAINER_OF
#define SPA_CONTAINER_OF(p, t, m)
Definition: defs.h:170
SPA_IO_POSITION_STATE_STARTING
@ SPA_IO_POSITION_STATE_STARTING
Definition: io.h:252
SPA_LIKELY
#define SPA_LIKELY(x)
Definition: defs.h:234
SPA_PARAM_Format
@ SPA_PARAM_Format
configured format as SPA_TYPE_OBJECT_Format
Definition: param.h:48
spa_param_info::flags
uint32_t flags
Definition: param.h:71
spa_list_consume
#define spa_list_consume(pos, head, member)
Definition: list.h:96
spa_node_info::max_output_ports
uint32_t max_output_ports
Definition: build-12683127/doc/spa/node/node.h:62
PW_KEY_NODE_LOCK_QUANTUM
#define PW_KEY_NODE_LOCK_QUANTUM
don't change quantum when this node is active
Definition: src/pipewire/keys.h:158
SYNC_START
#define SYNC_START
Definition: impl-node.c:1430
SPA_VERSION_NODE_EVENTS
#define SPA_VERSION_NODE_EVENTS
Definition: build-12683127/doc/spa/node/node.h:157
spa_pod
Definition: pod/pod.h:50
pw_port_info
Definition: port.h:63
PW_KEY_NODE_NICK
#define PW_KEY_NODE_NICK
short node name
Definition: src/pipewire/keys.h:139
spa_io_position::segments
struct spa_io_segment segments[SPA_IO_POSITION_MAX_SEGMENTS]
segments
Definition: io.h:283
PW_KEY_NODE_GROUP
#define PW_KEY_NODE_GROUP
the group id this node is part of.
Definition: src/pipewire/keys.h:146
pw_impl_node_get_global
struct pw_global * pw_impl_node_get_global(struct pw_impl_node *node)
Get the global of this node.
Definition: impl-node.c:1249
pw_impl_node_set_state
int pw_impl_node_set_state(struct pw_impl_node *node, enum pw_node_state state)
Set the node state.
Definition: impl-node.c:2057
pw_global_add_listener
void pw_global_add_listener(struct pw_global *global, struct spa_hook *listener, const struct pw_global_events *events, void *data)
Add an event listener on the global.
Definition: global.c:255
spa_result_node_params::param
struct spa_pod * param
the result param
Definition: build-12683127/doc/spa/node/node.h:141
spa_system
Definition: system.h:52
pw_impl_node_events::port_added
void(* port_added)(void *data, struct pw_impl_port *port)
a port was added
Definition: impl-node.h:65
spa_io_video_size::stride
uint32_t stride
video stride in bytes
Definition: io.h:154
pw_impl_node_events::state_request
void(* state_request)(void *data, enum pw_node_state state)
a new state is requested on the node
Definition: impl-node.h:78
spa_source::data
void * data
Definition: build-12683127/doc/spa/support/loop.h:61
node::active
unsigned char active
Definition: bluez-autoswitch.c:82
spa_list_remove
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
pw_resource_add_object_listener
void pw_resource_add_object_listener(struct pw_resource *resource, struct spa_hook *listener, const void *funcs, void *data)
Set the resource implementation.
Definition: resource.c:174
port
Definition: buffers.c:44
spa_node_send_command
#define spa_node_send_command(n,...)
Definition: build-12683127/doc/spa/node/node.h:654
SPA_IO_POSITION_STATE_RUNNING
@ SPA_IO_POSITION_STATE_RUNNING
Definition: io.h:253
SPA_N_ELEMENTS
#define SPA_N_ELEMENTS(arr)
Definition: defs.h:109
SPA_NODE_EVENT_ID
#define SPA_NODE_EVENT_ID(ev)
Definition: node/event.h:46
SPA_NODE_COMMAND_ID
#define SPA_NODE_COMMAND_ID(cmd)
Definition: node/command.h:59
resource_data::object_listener
struct spa_hook object_listener
Definition: impl-core.c:77
PW_TYPE_INTERFACE_Node
#define PW_TYPE_INTERFACE_Node
Definition: src/pipewire/node.h:50
pw_impl_node_events::port_info_changed
void(* port_info_changed)(void *data, struct pw_impl_port *port, const struct pw_port_info *info)
a port on the node changed info
Definition: impl-node.h:72
SPA_STATUS_HAVE_DATA
#define SPA_STATUS_HAVE_DATA
Definition: io.h:96
PW_MEMBLOCK_FLAG_SEAL
@ PW_MEMBLOCK_FLAG_SEAL
seal the fd
Definition: src/pipewire/mem.h:48
SPA_TIMESPEC_TO_NSEC
#define SPA_TIMESPEC_TO_NSEC(ts)
Definition: defs.h:191
PW_KEY_FACTORY_ID
#define PW_KEY_FACTORY_ID
Factory properties.
Definition: src/pipewire/keys.h:259
SPA_FD_NONBLOCK
#define SPA_FD_NONBLOCK
Definition: system.h:62
PW_KEY_NODE_DESCRIPTION
#define PW_KEY_NODE_DESCRIPTION
localized human readable node one-line description.
Definition: src/pipewire/keys.h:140
filter
Definition: filter.c:126
PW_KEY_NODE_NAME
#define PW_KEY_NODE_NAME
node name
Definition: src/pipewire/keys.h:138
spa_node
Definition: build-12683127/doc/spa/node/node.h:53
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
SPA_NODE_COMMAND_Suspend
@ SPA_NODE_COMMAND_Suspend
suspend a node, this removes all configured formats and closes any devices
Definition: node/command.h:41
pw_resource_errorf
void pw_resource_errorf(struct pw_resource *resource, int res, const char *error,...) 1(3
result_node_params_data::callback
int(* callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param)
Definition: impl-node.c:1807
PW_KEY_NODE_LATENCY
#define PW_KEY_NODE_LATENCY
the requested latency of the node as a fraction.
Definition: src/pipewire/keys.h:154
PW_KEY_APP_NAME
#define PW_KEY_APP_NAME
application keys
Definition: src/pipewire/keys.h:108
PW_VERSION_RESOURCE_EVENTS
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:61
spa_result_node_params
the result of enum_params or port_enum_params.
Definition: build-12683127/doc/spa/node/node.h:137
spa_io_clock::position
uint64_t position
current position
Definition: io.h:141
PW_KEY_NODE_WANT_DRIVER
#define PW_KEY_NODE_WANT_DRIVER
the node wants to be grouped with a driver node in order to schedule the graph.
Definition: src/pipewire/keys.h:167
spa_io_video_size::size
struct spa_rectangle size
the video size
Definition: io.h:155
SPA_IO_SEGMENT_BAR_FLAG_VALID
#define SPA_IO_SEGMENT_BAR_FLAG_VALID
Definition: io.h:176
spa_node_info::n_params
uint32_t n_params
number of items in params
Definition: build-12683127/doc/spa/node/node.h:84
SPA_NODE_COMMAND_INIT
#define SPA_NODE_COMMAND_INIT(id)
Definition: node/command.h:60
pw_impl_node_get_implementation
struct spa_node * pw_impl_node_get_implementation(struct pw_impl_node *node)
Get the node implementation.
Definition: impl-node.c:1686
pw_impl_node_register
int pw_impl_node_register(struct pw_impl_node *this, struct pw_properties *properties)
Complete initialization of the node and register.
Definition: impl-node.c:650
pw_resource_add_listener
void pw_resource_add_listener(struct pw_resource *resource, struct spa_hook *listener, const struct pw_resource_events *events, void *data)
Add an event listener.
Definition: resource.c:165
spa_source::rmask
uint32_t rmask
Definition: build-12683127/doc/spa/support/loop.h:64
SPA_RESULT_TYPE_NODE_PARAMS
#define SPA_RESULT_TYPE_NODE_PARAMS
Definition: build-12683127/doc/spa/node/node.h:129
SPA_IO_Clock
@ SPA_IO_Clock
area to update clock information, struct spa_io_clock
Definition: io.h:55
pw_impl_node_events
Node events, listen to them with pw_impl_node_add_listener.
Definition: impl-node.h:51
SPA_IO_ERR
#define SPA_IO_ERR
Definition: system.h:57
pw_impl_node_events::info_changed
void(* info_changed)(void *data, const struct pw_node_info *info)
the node info changed
Definition: impl-node.h:70
spa_system_eventfd_read
#define spa_system_eventfd_read(s,...)
Definition: system.h:148
spa_io_clock::duration
uint64_t duration
duration of current cycle
Definition: io.h:142
PW_MEMBLOCK_FLAG_MAP
@ PW_MEMBLOCK_FLAG_MAP
mmap the fd
Definition: src/pipewire/mem.h:49
PW_KEY_PRIORITY_DRIVER
#define PW_KEY_PRIORITY_DRIVER
priority to be a driver
Definition: src/pipewire/keys.h:98
SPA_NODE_COMMAND_Pause
@ SPA_NODE_COMMAND_Pause
pause a node.
Definition: node/command.h:43
spa_io_segment::position
uint64_t position
The position when the running time == start.
Definition: io.h:242
SPA_FLAG_IS_SET
#define SPA_FLAG_IS_SET(field, flag)
Definition: defs.h:73
spa_node_port_reuse_buffer
#define spa_node_port_reuse_buffer(n,...)
Definition: build-12683127/doc/spa/node/node.h:662
buffer
Definition: filter.c:59
pw_node_methods
Node methods.
Definition: src/pipewire/node.h:135
pw_properties_update_ignore
int pw_properties_update_ignore(struct pw_properties *props, const struct spa_dict *dict, const char *const ignore[])
Definition: properties.c:259
spa_param_info
information about a parameter
Definition: param.h:64
spa_list_init
void spa_list_init(struct spa_list *list)
Definition: list.h:44
node::node
struct spa_node * node
Definition: alsa-monitor.c:76
spa_list_for_each_safe
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:129
impl::pending_list
struct spa_list pending_list
Definition: impl-device.c:41
spa_pod_builder_init
void spa_pod_builder_init(struct spa_pod_builder *builder, void *data, uint32_t size)
Definition: builder.h:96
PW_KEY_NODE_CACHE_PARAMS
#define PW_KEY_NODE_CACHE_PARAMS
cache the node params
Definition: src/pipewire/keys.h:170
spa_dict
Definition: utils/dict.h:48
spa_system_clock_gettime
#define spa_system_clock_gettime(s,...)
Definition: system.h:132
pw_impl_node_events::state_changed
void(* state_changed)(void *data, enum pw_node_state old, enum pw_node_state state, const char *error)
the state of the node changed
Definition: impl-node.h:80
pw_impl_node_set_param
int pw_impl_node_set_param(struct pw_impl_node *node, uint32_t id, uint32_t flags, const struct spa_pod *param)
Definition: impl-node.c:1918
spa_io_position::n_segments
uint32_t n_segments
number of segments
Definition: io.h:282
spa_io_video_size::framerate
struct spa_fraction framerate
the minimum framerate, the cycle duration is always smaller to ensure there is only one video frame p...
Definition: io.h:156
pw_impl_port_add
int pw_impl_port_add(struct pw_impl_port *port, struct pw_impl_node *node)
Add a port to a node.
Definition: impl-port.c:926
spa_port_info
Port information structure.
Definition: build-12683127/doc/spa/node/node.h:94
SPA_RESULT_IS_ASYNC
#define SPA_RESULT_IS_ASYNC(res)
Definition: result.h:46
spa_node_set_param
#define spa_node_set_param(n,...)
Definition: build-12683127/doc/spa/node/node.h:652
spa_node_set_callbacks
#define spa_node_set_callbacks(n,...)
Definition: build-12683127/doc/spa/node/node.h:649
PW_KEY_MEDIA_TYPE
#define PW_KEY_MEDIA_TYPE
Media.
Definition: src/pipewire/keys.h:277
pw_impl_node_set_active
int pw_impl_node_set_active(struct pw_impl_node *node, bool active)
Set a node active.
Definition: impl-node.c:2115
PW_NODE_STATE_SUSPENDED
@ PW_NODE_STATE_SUSPENDED
the node is suspended, the device might be closed
Definition: src/pipewire/node.h:59
PW_KEY_MEDIA_CATEGORY
#define PW_KEY_MEDIA_CATEGORY
Media Category: Playback, Capture, Duplex, Monitor, Manager.
Definition: src/pipewire/keys.h:279
PW_KEY_NODE_MAX_LATENCY
#define PW_KEY_NODE_MAX_LATENCY
the maximum supported latency of the node as a fraction.
Definition: src/pipewire/keys.h:156
SPA_RESULT_ASYNC_SEQ
#define SPA_RESULT_ASYNC_SEQ(res)
Definition: result.h:48
pw_global_update_keys
int pw_global_update_keys(struct pw_global *global, const struct spa_dict *dict, const char *const keys[])
Update the global properties, must be done when unregistered.
Definition: global.c:209
pw_impl_client_set_busy
void pw_impl_client_set_busy(struct pw_impl_client *client, bool busy)
Mark the client busy.
Definition: impl-client.c:716
SYNC_STOP
#define SYNC_STOP
Definition: impl-node.c:1431
spa_io_position::clock
struct spa_io_clock clock
clock position of driver, always valid and read only
Definition: io.h:272
impl::cache_params
unsigned int cache_params
Definition: impl-device.c:43
spa_strerror
#define spa_strerror(err)
Definition: result.h:51
impl::work
struct pw_work_queue * work
Definition: module-echo-cancel.c:136
spa_fraction::denom
uint32_t denom
Definition: defs.h:106
pw_impl_port_destroy
void pw_impl_port_destroy(struct pw_impl_port *port)
Definition: impl-port.c:1079
utils.h
SPA_IO_IN
#define SPA_IO_IN
Definition: system.h:55
resource_data::end
int end
Definition: impl-device.c:74
SPA_NODE_COMMAND_Start
@ SPA_NODE_COMMAND_Start
start a node, this makes it start emitting scheduling events
Definition: node/command.h:45
pw_resource_new
struct pw_resource * pw_resource_new(struct pw_impl_client *client, uint32_t id, uint32_t permissions, const char *type, uint32_t version, size_t user_data_size)
Make a new resource for client.
Definition: resource.c:43
system.h
SPA_IO_VIDEO_SIZE_VALID
#define SPA_IO_VIDEO_SIZE_VALID
Definition: io.h:152
param
Definition: filter.c:80
PW_IMPL_PORT_STATE_CONFIGURE
@ PW_IMPL_PORT_STATE_CONFIGURE
the port is ready for format negotiation
Definition: impl-port.h:52
result_node_params_data::cache
unsigned int cache
Definition: impl-node.c:1812
pw_work_queue_add
uint32_t pw_work_queue_add(struct pw_work_queue *queue, void *obj, int res, pw_work_func_t func, void *data)
Add an item to the work queue.
Definition: work-queue.c:162
SPA_IO_HUP
#define SPA_IO_HUP
Definition: system.h:58
pw_log_debug
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
pw_impl_node_get_info
const struct pw_node_info * pw_impl_node_get_info(struct pw_impl_node *node)
Get the node info.
Definition: impl-node.c:1231
DEFAULT_SYNC_TIMEOUT
#define DEFAULT_SYNC_TIMEOUT
Definition: impl-node.c:44
client
Definition: module-protocol-native.c:103
spa_node_sync
#define spa_node_sync(n,...)
Definition: build-12683127/doc/spa/node/node.h:650
pw_global_destroy
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:369
pw_impl_node_events::active_changed
void(* active_changed)(void *data, bool active)
the node active state changed
Definition: impl-node.h:75
pw_impl_node_get_user_data
void * pw_impl_node_get_user_data(struct pw_impl_node *node)
Get node user_data.
Definition: impl-node.c:1237
resource_data::n_subscribe_ids
uint32_t n_subscribe_ids
Definition: impl-device.c:69
SPA_MIN
#define SPA_MIN(a, b)
Definition: defs.h:123
SPA_IO_POSITION_STATE_STOPPED
@ SPA_IO_POSITION_STATE_STOPPED
Definition: io.h:251
PW_KEY_NODE_ALWAYS_PROCESS
#define PW_KEY_NODE_ALWAYS_PROCESS
process even when unlinked
Definition: src/pipewire/keys.h:166
PW_VERSION_GLOBAL_EVENTS
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:69
SPA_ID_INVALID
#define SPA_ID_INVALID
Definition: defs.h:182
pw_impl_node_events::result
void(* result)(void *data, int seq, int res, uint32_t type, const void *result)
a result was received
Definition: impl-node.h:84
spa_param_info::user
uint32_t user
private user field.
Definition: param.h:72
PW_KEY_MEDIA_CLASS
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: src/pipewire/keys.h:285
spa_list_is_empty
#define spa_list_is_empty(l)
Definition: list.h:49
SPA_NODE_CHANGE_MASK_PARAMS
#define SPA_NODE_CHANGE_MASK_PARAMS
Definition: build-12683127/doc/spa/node/node.h:65
PW_KEY_CLIENT_ID
#define PW_KEY_CLIENT_ID
Client properties.
Definition: src/pipewire/keys.h:131
resource_data::data
struct result_device_params_data data
Definition: impl-device.c:76
pw_impl_node_events::driver_changed
void(* driver_changed)(void *data, struct pw_impl_node *old, struct pw_impl_node *driver)
the driver of the node changed
Definition: impl-node.h:90
PW_ID_ANY
#define PW_ID_ANY
Definition: core.h:69
parser.h
pw_context_create_node
struct pw_impl_node * pw_context_create_node(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Create a new node.
Definition: impl-node.c:1112
spa_pod::type
uint32_t type
Definition: pod/pod.h:52
SPA_DATA_MemFd
@ SPA_DATA_MemFd
generic fd, mmap to get to memory
Definition: buffer/buffer.h:49
PW_KEY_DEVICE_ID
#define PW_KEY_DEVICE_ID
device properties
Definition: src/pipewire/keys.h:210
spa_param_info::id
uint32_t id
enum spa_param_type
Definition: param.h:65
spa_io_segment::start
uint64_t start
value of running time when this info is active.
Definition: io.h:231
spa_io_segment::bar
struct spa_io_segment_bar bar
Definition: io.h:246
SPA_NODE_EVENT_Error
@ SPA_NODE_EVENT_Error
Definition: node/event.h:41
PW_NODE_CHANGE_MASK_PROPS
#define PW_NODE_CHANGE_MASK_PROPS
Definition: src/pipewire/node.h:77
pw_resource_error
void pw_resource_error(struct pw_resource *resource, int res, const char *error)
Generate an error for a resource.
Definition: resource.c:255
pw_log_warn
#define pw_log_warn(...)
Definition: src/pipewire/log.h:87
pw_node_state
pw_node_state
The different node states.
Definition: src/pipewire/node.h:56
spa_io_clock::rate
struct spa_fraction rate
rate for position/duration/delay
Definition: io.h:140
spa_command
Definition: pod/command.h:44
spa_io_segment
A segment converts a running time to a segment (stream) position.
Definition: io.h:223
spa_io_segment::video
struct spa_io_segment_video video
Definition: io.h:247
SPA_INT_TO_PTR
#define SPA_INT_TO_PTR(u)
Definition: defs.h:175
spa_loop_add_source
#define spa_loop_add_source(l,...)
Definition: build-12683127/doc/spa/support/loop.h:115
impl-node.h
impl::this
struct pw_control this
Definition: control.c:34
pw_map
A map.
Definition: map.h:55
spa_event
Definition: pod/event.h:43
pw_impl_node_get_context
struct pw_context * pw_impl_node_get_context(struct pw_impl_node *node)
Get the context of this node.
Definition: impl-node.c:1243
pw_loop_invoke
#define pw_loop_invoke(l,...)
Definition: src/pipewire/loop.h:63
spa_node_info::max_input_ports
uint32_t max_input_ports
Definition: build-12683127/doc/spa/node/node.h:61
spa_io_clock::delay
int64_t delay
delay between position and hardware, positive for capture, negative for playback
Definition: io.h:143
PW_KEY_NODE_LOCK_RATE
#define PW_KEY_NODE_LOCK_RATE
don't change rate when this node is active
Definition: src/pipewire/keys.h:162
spa_type_param
const struct spa_type_info spa_type_param[]
Definition: param/type-info.h:46
spa_hook_remove
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
spa_system_close
#define spa_system_close(s,...)
Definition: system.h:130
pw_resource_get_user_data
void * pw_resource_get_user_data(struct pw_resource *resource)
Get the user data for the resource, the size was given in pw_resource_new.
Definition: resource.c:159
spa_node_add_listener
#define spa_node_add_listener(n,...)
Definition: build-12683127/doc/spa/node/node.h:648
pw_log_info
#define pw_log_info(...)
Definition: src/pipewire/log.h:88
spa_node_events
events from the spa_node.
Definition: build-12683127/doc/spa/node/node.h:156
NAME
#define NAME
Definition: impl-node.c:42
pw_impl_node_events::free
void(* free)(void *data)
the node is about to be freed
Definition: impl-node.h:58
pw_impl_node_destroy
void pw_impl_node_destroy(struct pw_impl_node *node)
Destroy a node.
Definition: impl-node.c:1707
result_node_params_data::seq
int seq
Definition: impl-node.c:1810
pw_work_queue_new
struct pw_work_queue * pw_work_queue_new(struct pw_loop *loop)
Create a new PipeWire Work Queue Object.
Definition: work-queue.c:98
pw_log_trace_fp
#define pw_log_trace_fp(...)
Definition: src/pipewire/log.h:93
PW_KEY_NODE_DRIVER
#define PW_KEY_NODE_DRIVER
node can drive the graph
Definition: src/pipewire/keys.h:171
pw_impl_node_for_each_port
int pw_impl_node_for_each_port(struct pw_impl_node *node, enum pw_direction direction, int(*callback)(void *data, struct pw_impl_port *port), void *data)
Iterate the ports in the given direction.
Definition: impl-node.c:1784
spa_node_info::params
struct spa_param_info * params
parameter information
Definition: build-12683127/doc/spa/node/node.h:83
pw_impl_node_events::initialized
void(* initialized)(void *data)
the node is initialized
Definition: impl-node.h:60
resource_data::resource
struct pw_resource * resource
Definition: impl-core.c:75
filter.h
spa_hook_list_init
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
pw_impl_node_add_listener
void pw_impl_node_add_listener(struct pw_impl_node *node, struct spa_hook *listener, const struct pw_impl_node_events *events, void *data)
Add an event listener.
Definition: impl-node.c:1692
spa_io_segment_bar::flags
uint32_t flags
extra flags
Definition: io.h:177
pw_impl_node_set_driver
int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driver)
Definition: impl-node.c:771
spa_system_eventfd_create
#define spa_system_eventfd_create(s,...)
Definition: system.h:146
SPA_NODE_FLAG_OUT_DYNAMIC_PORTS
#define SPA_NODE_FLAG_OUT_DYNAMIC_PORTS
output ports can be added/removed
Definition: build-12683127/doc/spa/node/node.h:70
pw_work_queue_cancel
int pw_work_queue_cancel(struct pw_work_queue *queue, void *obj, uint32_t id)
Cancel a work item.
Definition: work-queue.c:216
spa_node_info::change_mask
uint64_t change_mask
Definition: build-12683127/doc/spa/node/node.h:66
SPA_FD_CLOEXEC
#define SPA_FD_CLOEXEC
Definition: system.h:61
spa_io_position::offset
int64_t offset
an offset to subtract from the clock position to get a running time.
Definition: io.h:275
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:52
spa_fraction::num
uint32_t num
Definition: defs.h:105
pw_impl_node_events::port_removed
void(* port_removed)(void *data, struct pw_impl_port *port)
a port was removed
Definition: impl-node.h:67
resource_data::listener
struct spa_hook listener
Definition: impl-device.c:77
pw_impl_node_events::peer_removed
void(* peer_removed)(void *data, struct pw_impl_node *peer)
a peer was removed
Definition: impl-node.h:95
SPA_PTR_TO_INT
#define SPA_PTR_TO_INT(p)
Definition: defs.h:174
PW_KEY_PRIORITY_SESSION
#define PW_KEY_PRIORITY_SESSION
priority in session manager
Definition: src/pipewire/keys.h:97
pw_impl_port_update_info
void pw_impl_port_update_info(struct pw_impl_port *port, const struct spa_port_info *info)
Definition: impl-port.c:678
SPA_UNLIKELY
#define SPA_UNLIKELY(x)
Definition: defs.h:235
pw_properties_new
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
pw_resource_events
Resource events.
Definition: resource.h:60
SPA_STATUS_OK
#define SPA_STATUS_OK
Definition: io.h:94
pw_properties_setf
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...) 1(3
spa_pod_builder
Definition: builder.h:63
pw_node_info
The node information.
Definition: src/pipewire/node.h:70
pw_resource_events::version
uint32_t version
Definition: resource.h:62
spa_node_info::flags
uint64_t flags
Definition: build-12683127/doc/spa/node/node.h:81
pw_direction
#define pw_direction
The direction of a port.
Definition: port.h:56
pw_impl_node_events::event
void(* event)(void *data, const struct spa_event *event)
an event is emitted
Definition: impl-node.h:87
SPA_NODE_CHANGE_MASK_FLAGS
#define SPA_NODE_CHANGE_MASK_FLAGS
Definition: build-12683127/doc/spa/node/node.h:63
pw_properties
Definition: properties.h:49
spa_hook_list_clean
void spa_hook_list_clean(struct spa_hook_list *list)
Remove all hooks from the list.
Definition: hook.h:344
pw_impl_node_events::port_init
void(* port_init)(void *data, struct pw_impl_port *port)
a port is being initialized on the node
Definition: impl-node.h:63
pw_properties_free
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
node::id
uint32_t id
Definition: alsa-monitor.c:72
pw_log_error
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
spa_debug_type_find_name
const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition: types.h:68
spa_list_append
#define spa_list_append(list, item)
Definition: list.h:81