WpDevice

The WpDevice class allows accessing the properties and methods of a PipeWire device object (struct pw_device).

A WpDevice is constructed internally when a new device appears on the PipeWire registry and it is made available through the WpObjectManager API. Alternatively, a WpDevice can also be constructed using wp_device_new_from_factory, which creates a new device object on the remote PipeWire server by calling into a factory.

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.

WpDevice

GObject
    ╰──WpProxy
        ╰──WpDevice

Class structure

WpDeviceClass

Fields
parent_class (WpProxyClass) –
No description available

Wp.DeviceClass

Attributes
parent_class (Wp.ProxyClass) –
No description available

Wp.DeviceClass

Attributes
parent_class (Wp.ProxyClass) –
No description available

WpDevice

GObject
    ╰──WpProxy
        ╰──WpDevice

WpDevice

GObject
    ╰──WpProxy
        ╰──WpDevice

Constructors

wp_device_new_from_factory

WpDevice *
wp_device_new_from_factory (WpCore * core,
                            const gchar * factory_name,
                            WpProperties * properties)

Constructs a device 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 device is ready for use on the server. If the device cannot be created, this augment operation will fail.

Parameters:

core

the wireplumber core

factory_name

the pipewire factory name to construct the device

properties ( [nullable] [transfer: full] ) –

the properties to pass to the factory

Returns ( [nullable] [transfer: full] ) –

the new device or NULL if the core is not connected and therefore the device cannot be created


Wp.Device.new_from_factory

def Wp.Device.new_from_factory (core, factory_name, properties):
    #python wrapper for 'wp_device_new_from_factory'

Constructs a device 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.ProxyFeatures.BOUND. When this feature is ready, the device is ready for use on the server. If the device cannot be created, this augment operation will fail.

Parameters:

core ( Wp.Core ) –

the wireplumber core

factory_name ( str ) –

the pipewire factory name to construct the device

properties ( Wp.Properties ) –

the properties to pass to the factory

Returns ( Wp.Device ) –

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


Wp.Device.prototype.new_from_factory

function Wp.Device.prototype.new_from_factory(core: Wp.Core, factory_name: String, properties: Wp.Properties): {
    // javascript wrapper for 'wp_device_new_from_factory'
}

Constructs a device 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.prototype.augment, requesting at least Wp.ProxyFeatures.BOUND. When this feature is ready, the device is ready for use on the server. If the device cannot be created, this augment operation will fail.

Parameters:

core ( Wp.Core ) –

the wireplumber core

factory_name ( String ) –

the pipewire factory name to construct the device

properties ( Wp.Properties ) –

the properties to pass to the factory

Returns ( Wp.Device ) –

the new device or null if the core is not connected and therefore the device cannot be created


WpSpaDevice

GObject
    ╰──WpProxy
        ╰──WpSpaDevice

Class structure

WpSpaDeviceClass

Fields
parent_class (WpProxyClass) –
No description available

Wp.SpaDeviceClass

Attributes
parent_class (Wp.ProxyClass) –
No description available

Wp.SpaDeviceClass

Attributes
parent_class (Wp.ProxyClass) –
No description available

WpSpaDevice

GObject
    ╰──WpProxy
        ╰──WpSpaDevice

WpSpaDevice

GObject
    ╰──WpProxy
        ╰──WpSpaDevice

Constructors

wp_spa_device_new_from_spa_factory

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_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 SPA factory

properties ( [nullable] [transfer: full] ) –

properties to be passed to device constructor

Returns ( [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


Wp.SpaDevice.new_from_spa_factory

def Wp.SpaDevice.new_from_spa_factory (core, factory_name, properties):
    #python wrapper for 'wp_spa_device_new_from_spa_factory'

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.Proxy.augment requesting Wp.ProxyFeatures.BOUND and wait for the operation to complete.

Parameters:

core ( Wp.Core ) –

the wireplumber core

factory_name ( str ) –

the name of the SPA factory

properties ( Wp.Properties ) –

properties to be passed to device constructor

Returns ( Wp.SpaDevice ) –

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


Wp.SpaDevice.prototype.new_from_spa_factory

function Wp.SpaDevice.prototype.new_from_spa_factory(core: Wp.Core, factory_name: String, properties: Wp.Properties): {
    // javascript wrapper for 'wp_spa_device_new_from_spa_factory'
}

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.Proxy.prototype.augment requesting Wp.ProxyFeatures.BOUND and wait for the operation to complete.

Parameters:

core ( Wp.Core ) –

the wireplumber core

factory_name ( String ) –

the name of the SPA factory

properties ( Wp.Properties ) –

properties to be passed to device constructor

Returns ( Wp.SpaDevice ) –

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


Signals

object-info

object_info_callback (WpSpaDevice * self,
                      guint id,
                      GType type,
                      gchar * factory,
                      WpProperties * properties,
                      WpProperties * parent_props,
                      gpointer user_data)

This signal is emitted when the device is creating or destroying a managed object. The handler is expected to actually construct or destroy the object using the requested SPA factory and with the given properties.

The handler may also use parent_props to enrich the properties set that will be assigned on the object. parent_props contains all the properties that this device object has.

When the object is being created, type can either be WP_TYPE_DEVICE or WP_TYPE_NODE. The handler is free to create a substitute of those, like WP_TYPE_SPA_DEVICE instead of WP_TYPE_DEVICE, depending on the use case.

Parameters:

self

the WpSpaDevice

id

the id of the managed object

type

the WpProxy subclass type that the managed object should have, or G_TYPE_NONE if the object is being destroyed

factory ( [nullable] ) –

the name of the SPA factory to use to construct the managed object, or NULL if the object is being destroyed

properties ( [nullable] ) –

additional properties that the managed object should have, or NULL if the object is being destroyed

parent_props

the properties of the device itself

user_data
No description available

Flags: Run First


object-info

def object_info_callback (self, id, type, factory, properties, parent_props, *user_data):
    #python callback for the 'object-info' signal

This signal is emitted when the device is creating or destroying a managed object. The handler is expected to actually construct or destroy the object using the requested SPA factory and with the given properties.

The handler may also use parent_props to enrich the properties set that will be assigned on the object. parent_props contains all the properties that this device object has.

When the object is being created, type can either be WP_TYPE_DEVICE (not introspectable) or WP_TYPE_NODE (not introspectable). The handler is free to create a substitute of those, like WP_TYPE_SPA_DEVICE (not introspectable) instead of WP_TYPE_DEVICE (not introspectable), depending on the use case.

Parameters:

self ( Wp.SpaDevice ) –

the Wp.SpaDevice

id ( int ) –

the id of the managed object

type ( GObject.Type ) –

the Wp.Proxy subclass type that the managed object should have, or G_TYPE_NONE (not introspectable) if the object is being destroyed

factory ( str ) –

the name of the SPA factory to use to construct the managed object, or None if the object is being destroyed

properties ( Wp.Properties ) –

additional properties that the managed object should have, or None if the object is being destroyed

parent_props ( Wp.Properties ) –

the properties of the device itself

user_data ( variadic ) –
No description available

Flags: Run First


object-info

function object_info_callback(self: Wp.SpaDevice, id: Number, type: GObject.Type, factory: String, properties: Wp.Properties, parent_props: Wp.Properties, user_data: Object): {
    // javascript callback for the 'object-info' signal
}

This signal is emitted when the device is creating or destroying a managed object. The handler is expected to actually construct or destroy the object using the requested SPA factory and with the given properties.

The handler may also use parent_props to enrich the properties set that will be assigned on the object. parent_props contains all the properties that this device object has.

When the object is being created, type can either be WP_TYPE_DEVICE (not introspectable) or WP_TYPE_NODE (not introspectable). The handler is free to create a substitute of those, like WP_TYPE_SPA_DEVICE (not introspectable) instead of WP_TYPE_DEVICE (not introspectable), depending on the use case.

Parameters:

self ( Wp.SpaDevice ) –

the Wp.SpaDevice

id ( Number ) –

the id of the managed object

type ( GObject.Type ) –

the Wp.Proxy subclass type that the managed object should have, or G_TYPE_NONE (not introspectable) if the object is being destroyed

factory ( String ) –

the name of the SPA factory to use to construct the managed object, or null if the object is being destroyed

properties ( Wp.Properties ) –

additional properties that the managed object should have, or null if the object is being destroyed

parent_props ( Wp.Properties ) –

the properties of the device itself

user_data ( Object ) –
No description available

Flags: Run First


Enumerations

WpSpaDeviceFeatures

An extension of WpProxyFeatures

Members

WP_SPA_DEVICE_FEATURE_ACTIVE (65536) –

activates the device, making it query the hardware and emit the object-info signal


Wp.SpaDeviceFeatures

An extension of Wp.ProxyFeatures

Members

Wp.SpaDeviceFeatures.ACTIVE (65536) –

activates the device, making it query the hardware and emit the object-info signal


Wp.SpaDeviceFeatures

An extension of Wp.ProxyFeatures

Members

Wp.SpaDeviceFeatures.ACTIVE (65536) –

activates the device, making it query the hardware and emit the object-info signal


Constants

WP_TYPE_DEVICE

#define WP_TYPE_DEVICE (wp_device_get_type ())

The WpDevice GType


WP_TYPE_SPA_DEVICE

#define WP_TYPE_SPA_DEVICE (wp_spa_device_get_type ())

The WpSpaDevice GType


The results of the search are