Wp.PipewireObject

g GObject.GInterface GObject.GInterface Wp.PipewireObject Wp.PipewireObject GObject.GInterface->Wp.PipewireObject

Implementations:

Wp.Client, Wp.Device, Wp.Factory, Wp.ImplNode, Wp.Link, Wp.Node, Wp.Port

Methods

enum_params (id, filter, cancellable, callback, *user_data)

enum_params_finish (res)

enum_params_sync (id, filter)

get_native_info ()

get_param_info ()

get_properties ()

get_property (key)

new_properties_iterator ()

set_param (id, flags, param)

Virtual Methods

do_enum_params (id, filter, cancellable, callback, *user_data)

do_enum_params_finish (res)

do_enum_params_sync (id, filter)

do_get_native_info ()

do_get_param_info ()

do_get_properties ()

do_set_param (id, flags, param)

Properties

Name

Type

Flags

Short Description

native-info

int

r

The native info structure

param-info

GLib.Variant

r

The param info of the object

properties

Wp.Properties

r

The properties of the pipewire object

Signals

Name

Short Description

params-changed

Fields

None

Class Details

class Wp.PipewireObject
Bases:

GObject.GInterface

Structure:

Wp.PipewireObjectInterface

An interface for standard PipeWire objects. The common characteristic of all objects that implement this interface is the presence of an “info” structure that contains additional properties for this object (in the form of a spa_dict / pw_properties) and optionally also some parameters that can be enumerated and set on the object.

enum_params(id, filter, cancellable, callback, *user_data)
Parameters:

Enumerate object parameters.

This will asynchronously return the result, or an error, by calling the given callback. The result is going to be a Wp.Iterator containing Wp.SpaPod objects, which can be retrieved with Wp.PipewireObject.enum_params_finish().

enum_params_finish(res)
Parameters:

res (Gio.AsyncResult) – the async result

Raises:

GLib.Error

Returns:

an iterator to iterate over the collected params, or None if the operation resulted in error; the items in the iterator are Wp.SpaPod

Return type:

Wp.Iterator or None

Finishes an asynchronous parameter enumeration operation.

enum_params_sync(id, filter)
Parameters:
Returns:

an iterator to iterate over cached parameters, or None if parameters for this id are not cached; the items in the iterator are Wp.SpaPod

Return type:

Wp.Iterator or None

This method can be used to retrieve object parameters in a synchronous way (in contrast with Wp.PipewireObject.enum_params(), which is async).

The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_<something> feature that corresponds to the specified id must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method. Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn’t been able to update them yet, so if you really need up-to-date information you should only rely on Wp.PipewireObject.enum_params() instead.

get_native_info()
Returns:

the native pipewire info structure of this object

Return type:

object or None

Retrieves the native infor structure of this object (pw_node_info, pw_port_info, etc…)

Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

get_param_info()
Returns:

a variant of type a{ss} or None if the object does not support params at all

Return type:

GLib.Variant or None

Returns the available parameters of this pipewire object.

The return value is a GLib.Variant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in Wp.PipewireObject.enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:

  • r: the param is readable (SPA_PARAM_INFO_READ)

  • w: the param is writable (SPA_PARAM_INFO_WRITE)

For params that are readable, you can query them with Wp.PipewireObject.enum_params() Params that are writable can be set with Wp.PipewireObject.set_param() Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

get_properties()
Returns:

the pipewire properties of this object; normally these are the properties that are part of the info structure

Return type:

Wp.Properties

Retrieves the PipeWire properties of this object.

Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

get_property(key)
Parameters:

key (str) – the property name

Returns:

the value of the pipewire property key or None if the property doesn’t exist

Return type:

str or None

Returns the value of a single pipewire property.

This is the same as getting the whole properties structure with Wp.PipewireObject.get_properties() and accessing a single property with Wp.Properties.get(), but saves one call and having to clean up the Wp.Properties reference count afterwards. The value is owned by the proxy, but it is guaranteed to stay alive until execution returns back to the event loop. Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

new_properties_iterator()
Returns:

an iterator that iterates over the pipewire properties of this object. Use wp_properties_iterator_item_get_key() and wp_properties_iterator_item_get_value() to parse the items returned by this iterator.

Return type:

Wp.Iterator

Iterates over the object’s PipeWire properties.

Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

set_param(id, flags, param)
Parameters:
  • id (str) – the parameter id to set

  • flags (int) – optional flags or 0

  • param (Wp.SpaPod) – the parameter to set

Returns:

True on success, False if setting the param failed

Return type:

bool

Sets a parameter on the object.

do_enum_params(id, filter, cancellable, callback, *user_data) virtual
Parameters:

Enumerate object parameters.

This will asynchronously return the result, or an error, by calling the given callback. The result is going to be a Wp.Iterator containing Wp.SpaPod objects, which can be retrieved with Wp.PipewireObject.enum_params_finish().

do_enum_params_finish(res) virtual
Parameters:

res (Gio.AsyncResult) – the async result

Returns:

an iterator to iterate over the collected params, or None if the operation resulted in error; the items in the iterator are Wp.SpaPod

Return type:

Wp.Iterator or None

Finishes an asynchronous parameter enumeration operation.

do_enum_params_sync(id, filter) virtual
Parameters:
Returns:

an iterator to iterate over cached parameters, or None if parameters for this id are not cached; the items in the iterator are Wp.SpaPod

Return type:

Wp.Iterator or None

This method can be used to retrieve object parameters in a synchronous way (in contrast with Wp.PipewireObject.enum_params(), which is async).

The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_<something> feature that corresponds to the specified id must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method. Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn’t been able to update them yet, so if you really need up-to-date information you should only rely on Wp.PipewireObject.enum_params() instead.

do_get_native_info() virtual
Returns:

the native pipewire info structure of this object

Return type:

object or None

Retrieves the native infor structure of this object (pw_node_info, pw_port_info, etc…)

Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

do_get_param_info() virtual
Returns:

a variant of type a{ss} or None if the object does not support params at all

Return type:

GLib.Variant or None

Returns the available parameters of this pipewire object.

The return value is a GLib.Variant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in Wp.PipewireObject.enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:

  • r: the param is readable (SPA_PARAM_INFO_READ)

  • w: the param is writable (SPA_PARAM_INFO_WRITE)

For params that are readable, you can query them with Wp.PipewireObject.enum_params() Params that are writable can be set with Wp.PipewireObject.set_param() Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

do_get_properties() virtual
Returns:

the pipewire properties of this object; normally these are the properties that are part of the info structure

Return type:

Wp.Properties

Retrieves the PipeWire properties of this object.

Requires Wp.ProxyFeatures.PIPEWIRE_OBJECT_FEATURE_INFO

do_set_param(id, flags, param) virtual
Parameters:
  • id (str) – the parameter id to set

  • flags (int) – optional flags or 0

  • param (Wp.SpaPod) – the parameter to set

Returns:

True on success, False if setting the param failed

Return type:

bool

Sets a parameter on the object.

Signal Details

Wp.PipewireObject.signals.params_changed(pipewire_object, object)
Signal Name:

params-changed

Flags:

RUN_FIRST

Parameters:

Property Details

Wp.PipewireObject.props.native_info
Name:

native-info

Type:

int

Default Value:

None

Flags:

READABLE

The native info structure

Wp.PipewireObject.props.param_info
Name:

param-info

Type:

GLib.Variant

Default Value:

None

Flags:

READABLE

The param info of the object

Wp.PipewireObject.props.properties
Name:

properties

Type:

Wp.Properties

Default Value:

None

Flags:

READABLE

The properties of the pipewire object