Wp.SpaDevice

g GObject.Object GObject.Object Wp.Object Wp.Object GObject.Object->Wp.Object Wp.Proxy Wp.Proxy Wp.Object->Wp.Proxy Wp.SpaDevice Wp.SpaDevice Wp.Proxy->Wp.SpaDevice

Subclasses:

None

Methods

Inherited:

Wp.Proxy (4), Wp.Object (12), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new_from_spa_factory (core, factory_name, properties)

class

new_wrap (core, spa_device_handle, properties)

get_managed_object (id)

get_properties ()

new_managed_object_iterator ()

store_managed_object (id, object)

Virtual Methods

Inherited:

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

Properties

Inherited:

Wp.Proxy (2), Wp.Object (4)

Name

Type

Flags

Short Description

properties

Wp.Properties

r/w/co

Properties of the device

spa-device-handle

int

r/w/co

The spa device handle

Signals

Inherited:

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

Name

Short Description

create-object

object-removed

Fields

Inherited:

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

Class Details

class Wp.SpaDevice(**kwargs)
Bases:

Wp.Proxy

Abstract:

No

Structure:

Wp.SpaDeviceClass

A Wp.SpaDevice allows running a spa_device object locally, loading the implementation from a SPA factory. This is useful to run device monitors inside the session manager and have control over creating the actual nodes that the spa_device requests to create. To enable the spa device, call Wp.Object.activate() requesting Wp.SpaDeviceFeatures.ENABLED. For actual devices (not device monitors) it also possible and desirable to export the device to PipeWire, which can be done by requesting Wp.ProxyFeatures.PROXY_FEATURE_BOUND from Wp.Object.activate(). When exporting, the export should be done before enabling the device, by requesting both features at the same time.

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

  • factory_name (str) – the name of the SPA factory

  • properties (Wp.Properties or None) – properties to be passed to device constructor

Returns:

A new Wp.SpaDevice wrapping the device that was constructed by the factory, or None if the factory does not exist or was unable to construct the device

Return type:

Wp.SpaDevice or None

Constructs a SPA_TYPE_INTERFACE_Device by loading the given SPA factory_name.

To export this device to the PipeWire server, you need to call Wp.Object.activate() requesting Wp.ProxyFeatures.PROXY_FEATURE_BOUND and wait for the operation to complete.

classmethod new_wrap(core, spa_device_handle, properties)
Parameters:
  • core (Wp.Core) – the wireplumber core

  • spa_device_handle (object or None) – the spa device handle

  • properties (Wp.Properties or None) – additional properties of the device

Returns:

A new Wp.SpaDevice

Return type:

Wp.SpaDevice

Constructs an SPA Device object from an existing device handle.

get_managed_object(id)
Parameters:

id (int) – the (device-internal) id of the object to get

Returns:

the managed object associated with id

Return type:

GObject.Object

Gets one of the objects managed by this device.

get_properties()
Returns:

the device properties

Return type:

Wp.Properties

Gets the properties of this device.

new_managed_object_iterator()
Returns:

a Wp.Iterator that iterates over all the objects managed by this device

Return type:

Wp.Iterator

Iterates through all the objects managed by this device.

New in version 0.4.11.

store_managed_object(id, object)
Parameters:
  • id (int) – the (device-internal) id of the object

  • object (GObject.Object or None) – the object to store or None to remove the managed object associated with id

Stores or removes a managed object into/from a device.

Signal Details

Wp.SpaDevice.signals.create_object(spa_device, object, p0, p1, p2)
Signal Name:

create-object

Flags:

RUN_FIRST

Parameters:
Wp.SpaDevice.signals.object_removed(spa_device, object)
Signal Name:

object-removed

Flags:

RUN_FIRST

Parameters:
  • spa_device (Wp.SpaDevice) – The object which received the signal

  • object (int) –

Property Details

Wp.SpaDevice.props.properties
Name:

properties

Type:

Wp.Properties

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Properties of the device

Wp.SpaDevice.props.spa_device_handle
Name:

spa-device-handle

Type:

int

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The spa device handle