Wp.Node

g GObject.GInterface GObject.GInterface Wp.PipewireObject Wp.PipewireObject GObject.GInterface->Wp.PipewireObject GObject.Object GObject.Object Wp.Object Wp.Object GObject.Object->Wp.Object Wp.GlobalProxy Wp.GlobalProxy Wp.Node Wp.Node Wp.GlobalProxy->Wp.Node Wp.Proxy Wp.Proxy Wp.Object->Wp.Proxy Wp.PipewireObject->Wp.Node Wp.Proxy->Wp.GlobalProxy

Subclasses:

None

Methods

Inherited:

Wp.GlobalProxy (4), Wp.Proxy (4), Wp.Object (12), GObject.Object (37), Wp.PipewireObject (9)

Structs:

GObject.ObjectClass (5)

class

new_from_factory (core, factory_name, properties)

get_n_input_ports ()

get_n_output_ports ()

get_n_ports ()

get_state ()

lookup_port_full (interest)

new_ports_filtered_iterator_full (interest)

new_ports_iterator ()

send_command (command)

Virtual Methods

Inherited:

Wp.Proxy (4), Wp.Object (4), GObject.Object (7), Wp.PipewireObject (7)

Properties

Inherited:

Wp.GlobalProxy (3), Wp.Proxy (2), Wp.Object (4), Wp.PipewireObject (3)

Name

Type

Flags

Short Description

max-input-ports

int

r

max-input-ports

max-output-ports

int

r

max-output-ports

n-input-ports

int

r

n-input-ports

n-output-ports

int

r

n-output-ports

state

Wp.NodeState

r

state

Signals

Inherited:

Wp.Proxy (4), GObject.Object (1), Wp.PipewireObject (1)

Name

Short Description

ports-changed

state-changed

Fields

Inherited:

Wp.Proxy (4), GObject.Object (1), Wp.PipewireObject (1)

Class Details

class Wp.Node(**kwargs)
Bases:

Wp.GlobalProxy, Wp.PipewireObject

Abstract:

No

Structure:

Wp.NodeClass

The Wp.Node class allows accessing the properties and methods of a PipeWire node object (struct pw_node). A Wp.Node is constructed internally when a new node appears on the PipeWire registry and it is made available through the Wp.ObjectManager API. Alternatively, a Wp.Node 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.

classmethod new_from_factory(core, factory_name, properties)
Parameters:
  • core (Wp.Core) – the wireplumber core

  • factory_name (str) – the pipewire factory name to construct the node

  • properties (Wp.Properties or None) – the properties to pass to the factory

Returns:

the new node or None if the core is not connected and therefore the node cannot be created

Return type:

Wp.Node or None

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.Object.activate(), requesting at least Wp.ProxyFeatures.PROXY_FEATURE_BOUND. When this feature is ready, the node is ready for use on the server. If the node cannot be created, this activation operation will fail.

get_n_input_ports()
Returns:

the number of input ports of this node, as reported by the node info

max:

the maximum supported number of input ports

Return type:

(int, max: int)

Gets the number of input ports of this node.

Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

get_n_output_ports()
Returns:

the number of output ports of this node, as reported by the node info

max:

the maximum supported number of output ports

Return type:

(int, max: int)

Gets the number of output ports of this node.

Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

get_n_ports()
Returns:

the number of ports of this node.

Return type:

int

Gets 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 Requires Wp.NodeFeatures.PORTS

get_state()
Returns:

the current state of the node

error:

the error

Return type:

(Wp.NodeState, error: str)

Gets the current state of the node.

lookup_port_full(interest)
Parameters:

interest (Wp.ObjectInterest) – the interest

Returns:

the first port that matches the interest, or None if there is no such port

Return type:

Wp.Port or None

Retrieves the first port that matches the interest.

Requires Wp.NodeFeatures.PORTS

new_ports_filtered_iterator_full(interest)
Parameters:

interest (Wp.ObjectInterest) – the interest

Returns:

a Wp.Iterator that iterates over Wp.Port objects

Return type:

Wp.Iterator

Gets a new iterator that iterates over all the ports that belong to this node and match the interest.

Requires Wp.NodeFeatures.PORTS

new_ports_iterator()
Returns:

a Wp.Iterator that iterates over Wp.Port objects

Return type:

Wp.Iterator

Gets a new iterator that iterates over all the ports that belong to this node.

Requires Wp.NodeFeatures.PORTS

send_command(command)
Parameters:

command (str) – the command

Sends a command to a node.

Valid commands are the short string reprepsentations of enum spa_node_command. For example, “Suspend” or “Flush” are valid commands

Signal Details

Wp.Node.signals.ports_changed(node)
Signal Name:

ports-changed

Flags:

RUN_LAST

Parameters:

node (Wp.Node) – The object which received the signal

Wp.Node.signals.state_changed(node, object, p0)
Signal Name:

state-changed

Flags:

RUN_LAST

Parameters:

Property Details

Wp.Node.props.max_input_ports
Name:

max-input-ports

Type:

int

Default Value:

0

Flags:

READABLE

max-input-ports

Wp.Node.props.max_output_ports
Name:

max-output-ports

Type:

int

Default Value:

0

Flags:

READABLE

max-output-ports

Wp.Node.props.n_input_ports
Name:

n-input-ports

Type:

int

Default Value:

0

Flags:

READABLE

n-input-ports

Wp.Node.props.n_output_ports
Name:

n-output-ports

Type:

int

Default Value:

0

Flags:

READABLE

n-output-ports

Wp.Node.props.state
Name:

state

Type:

Wp.NodeState

Default Value:

Wp.NodeState.CREATING

Flags:

READABLE

state