WpNode
The WpNode class allows accessing the properties and methods of a
PipeWire node object (struct pw_node
).
A WpNode is constructed internally when a new node appears on the PipeWire registry and it is made available through the WpObjectManager API. Alternatively, a WpNode can also be constructed using wp_node_new_from_factory, which creates a new node object on the remote PipeWire server by calling into a factory.
A WpImplNode allows running a node implementation (struct pw_impl_node
)
locally, loading the implementation from factory or wrapping a manually
constructed pw_impl_node
. This object can then be exported to PipeWire
by requesting WP_PROXY_FEATURE_BOUND and be used as if it was a WpNode
proxy to a remote object.
Constructors
wp_impl_node_new_from_pw_factory
WpImplNode * wp_impl_node_new_from_pw_factory (WpCore * core, const gchar * factory_name, WpProperties * properties)
Constructs a new node, locally on this process, using the specified factory_name.
To export this node to the PipeWire server, you need to call wp_proxy_augment requesting WP_PROXY_FEATURE_BOUND and wait for the operation to complete.
Parameters:
core
–
the wireplumber core
factory_name
–
the name of the pipewire factory
properties
(
[nullable]
[transfer: full]
)
–
properties to be passed to node constructor
A new WpImplNode wrapping the node that was constructed by the factory, or NULL if the factory does not exist or was unable to construct the node
wp_impl_node_new_wrap
WpImplNode * wp_impl_node_new_wrap (WpCore * core, pw_impl_node* node)
Parameters:
core
–
the wireplumber core
node
–
an existing pw_impl_node to wrap
A new WpImplNode wrapping node
Properties
WpNode
GObject ╰──WpProxy ╰──WpNode ╰──WpImplNode
Members
parent_instance
(WpProxy)
–
Class structure
Constructors
wp_node_new_from_factory
WpNode * wp_node_new_from_factory (WpCore * core, const gchar * factory_name, WpProperties * properties)
Constructs a node on the PipeWire server by asking the remote factory factory_name to create it.
Because of the nature of the PipeWire protocol, this operation completes asynchronously at some point in the future. In order to find out when this is done, you should call wp_proxy_augment, requesting at least WP_PROXY_FEATURE_BOUND. When this feature is ready, the node is ready for use on the server. If the node cannot be created, this augment operation will fail.
Parameters:
core
–
the wireplumber core
factory_name
–
the pipewire factory name to construct the node
properties
(
[nullable]
[transfer: full]
)
–
the properties to pass to the factory
the new node or NULL if the core is not connected and therefore the node cannot be created
Methods
wp_node_get_n_input_ports
guint wp_node_get_n_input_ports (WpNode * self, guint * max)
Requires WP_PROXY_FEATURE_INFO
Parameters:
self
–
the node
max
(
[out]
[optional]
)
–
the maximum supported number of input ports
the number of input ports of this node, as reported by the node info
wp_node_get_n_output_ports
guint wp_node_get_n_output_ports (WpNode * self, guint * max)
Requires WP_PROXY_FEATURE_INFO
Parameters:
self
–
the node
max
(
[out]
[optional]
)
–
the maximum supported number of output ports
the number of output ports of this node, as reported by the node info
wp_node_get_n_ports
guint wp_node_get_n_ports (WpNode * self)
Requires WP_NODE_FEATURE_PORTS
Parameters:
self
–
the node
the number of ports of this node. Note that this number may not add up to wp_node_get_n_input_ports + wp_node_get_n_output_ports because it is discovered by looking at the number of available ports in the registry, however ports may appear there with a delay or may not appear at all if this client does not have permission to read them
wp_node_get_state
WpNodeState wp_node_get_state (WpNode * self, const gchar ** error)
Parameters:
self
–
error
–
wp_node_iterate_ports
WpIterator * wp_node_iterate_ports (WpNode * self)
Requires WP_NODE_FEATURE_PORTS
Parameters:
self
–
the node
a WpIterator that iterates over all the ports that belong to this node
wp_node_iterate_ports_filtered
WpIterator * wp_node_iterate_ports_filtered (WpNode * self, ... ...)
Requires WP_NODE_FEATURE_PORTS
The constraints specified in the variable arguments must follow the rules documented in wp_object_interest_new.
a WpIterator that iterates over all the ports that belong to this node and match the constraints
wp_node_iterate_ports_filtered_full
WpIterator * wp_node_iterate_ports_filtered_full (WpNode * self, WpObjectInterest * interest)
Requires WP_NODE_FEATURE_PORTS
Parameters:
self
–
the node
interest
(
[transfer: full]
)
–
the interest
a WpIterator that iterates over all the ports that belong to this node and match the interest
wp_node_lookup_port
WpPort * wp_node_lookup_port (WpNode * self, ... ...)
Requires WP_NODE_FEATURE_PORTS
The constraints specified in the variable arguments must follow the rules documented in wp_object_interest_new.
the first port that matches the constraints, or NULL if there is no such port
wp_node_lookup_port_full
WpPort * wp_node_lookup_port_full (WpNode * self, WpObjectInterest * interest)
Requires WP_NODE_FEATURE_PORTS
Parameters:
self
–
the node
interest
(
[transfer: full]
)
–
the interest
the first port that matches the interest, or NULL if there is no such port
wp_node_send_command
wp_node_send_command (WpNode * self, WpNodeCommand command)
Sends a command to a node
Parameters:
self
–
the node
command
–
the command
Signals
ports-changed
ports_changed_callback (WpNode * self, gpointer user_data)
Emitted when the node's ports change. This is only emitted when WP_NODE_FEATURE_PORTS is enabled.
Parameters:
self
–
the node
user_data
–
Flags: Run Last
state-changed
state_changed_callback (WpNode * self, WpNodeState * old_state, WpNodeState * new_state, gpointer user_data)
Emitted when the node changes state. This is only emitted when WP_PROXY_FEATURE_INFO is enabled.
Parameters:
self
–
the node
old_state
–
the old state
new_state
–
the new state
user_data
–
Flags: Run Last
Enumerations
WpNodeCommand
Members
WP_NODE_COMMAND_SUSPEND
(0)
–
suspends the node, the device might close
WP_NODE_COMMAND_PAUSE
(1)
–
pauses the node, the device will not close
WP_NODE_COMMAND_START
(2)
–
starts procesing data
WP_NODE_COMMAND_ENABLE
(3)
–
enables the node
WP_NODE_COMMAND_DISABLE
(4)
–
disables the node
WpNodeFeatures
An extension of WpProxyFeatures
Members
WP_NODE_FEATURE_PORTS
(65536)
–
caches information about ports, enabling the use of wp_node_get_n_ports, wp_node_lookup_port, wp_node_iterate_ports and related methods
WpNodeState
Members
WP_NODE_STATE_ERROR
(-1)
–
error state
WP_NODE_STATE_CREATING
(0)
–
the node is being created
WP_NODE_STATE_SUSPENDED
(1)
–
the node is suspended, the device might be closed
WP_NODE_STATE_IDLE
(2)
–
the node is running but there is no active port
WP_NODE_STATE_RUNNING
(3)
–
the node is running
Constants
WP_NODE_FEATURES_STANDARD
#define WP_NODE_FEATURES_STANDARD \ (WP_PROXY_FEATURES_STANDARD | \ WP_NODE_FEATURE_PORTS)
A constant set of features that contains the standard features that are available in the WpNode class.
The results of the search are