Spa Device

digraph inheritance { rankdir=LR; GObject -> WpObject; WpObject -> WpProxy; WpProxy -> WpSpaDevice; }
struct WpSpaDevice

A WpSpaDevice 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_SPA_DEVICE_FEATURE_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_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.

GObject Properties

GObject Signals

create-object

object-removed

wpspadevice::WpSpaDeviceFeatures

Flags to be used as WpObjectFeatures for WpSpaDevice.

Values:

enables a spa device

WpSpaDevice * wp_spa_device_new_wrap(WpCore * core, gpointer spa_device_handle, WpProperties * properties)

Constructs an SPA Device object from an existing device handle.

Return
(transfer full): A new WpSpaDevice
Parameters
  • core: the wireplumber core
  • spa_device_handle: the spa device handle
  • properties: (nullable) (transfer full): additional properties of the device

WpSpaDevice * wp_spa_device_new_from_spa_factory(WpCore * core, const gchar * factory_name, WpProperties * properties)

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_PROXY_FEATURE_BOUND and wait for the operation to complete.

Return
(nullable) (transfer full): A new WpSpaDevice wrapping the device that was constructed by the factory, or NULL if the factory does not exist or was unable to construct the device
Parameters
  • core: the wireplumber core
  • factory_name: the name of the SPA factory
  • properties: (nullable) (transfer full): properties to be passed to device constructor

WpProperties * wp_spa_device_get_properties(WpSpaDevice * self)

Gets the properties of this device.

Return
(transfer full): the device properties
Parameters
  • self: the spa device

WpIterator * wp_spa_device_new_managed_object_iterator(WpSpaDevice * self)

Iterates through all the objects managed by this device.

Return
(transfer full): a WpIterator that iterates over all the objects managed by this device
Since
0.4.11
Parameters
  • self: the spa device

GObject * wp_spa_device_get_managed_object(WpSpaDevice * self, guint id)

Gets one of the objects managed by this device.

Return
(transfer full): the managed object associated with id
Parameters
  • self: the spa device
  • id: the (device-internal) id of the object to get

void wp_spa_device_store_managed_object(WpSpaDevice * self, guint id, GObject * object)

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

Parameters
  • self: the spa device
  • id: the (device-internal) id of the object
  • object: (transfer full) (nullable): the object to store or NULL to remove the managed object associated with id

WP_TYPE_SPA_DEVICE (wp_spa_device_get_type ())

The WpSpaDevice GType.