Core

digraph inheritance { rankdir=LR; GObject -> WpObject; WpObject -> WpCore; }

struct WpCore

The core is the central object around which everything operates. It is essential to create a WpCore before using any other WirePlumber API.

The core object has the following responsibilities:

  • it owns the connection to the PipeWire server, and through it the WpMainContext that wraps the pw_context and glues the PipeWire library's event loop system with GMainLoop

  • it owns the WpRegistry, which keeps track of registered objects and of the objects that appear on the PipeWire registry

The core is also responsible for loading components, which are defined in the main configuration file. WP_CORE_FEATURE_COMPONENTS loads the components of the profile in the "wireplumber.profile" property, if that property is set.

Configuration

The main configuration file needs to be created and opened before the core is created, using the WpConf API. It is then passed to the core as an argument in the constructor.

If a configuration file is not provided, the core lets the pw_context of the main context load its own configuration, based on the rules that apply to all pipewire clients (e.g. it respects the PIPEWIRE_CONFIG_NAME environment variable and loads "client.conf" as a last resort).

If a configuration file is provided, the pw_context does not load any configuration, and the "context.properties", "context.spa-libs" and "context.modules" sections of the provided WpConf are used instead.

GObject Properties

conf

The main configuration file

WpConf *

G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY

g-main-context

The GMainContext to use for events

GMainContext *

G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY

properties

Additional properties of the main context

WpProperties *

G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY

enum WpCoreFeatures

Flags to be used as WpObjectFeatures on WpCore.

Values:

enumerator WP_CORE_FEATURE_CONNECTED = (1 << 0)

connects to pipewire

enumerator WP_CORE_FEATURE_COMPONENTS = (1 << 1)

loads components defined in the configuration

WpCore *wp_core_new(GMainContext *context, WpConf *conf, WpProperties *properties)

Creates a new core object.

Parameters:
  • context -- (transfer none) (nullable): the GMainContext to use for events

  • conf -- (transfer full) (nullable): the main configuration file

  • properties -- (transfer full) (nullable): additional properties, which are also passed to pw_context_new() and pw_context_connect()

Returns:

(transfer full): a new WpCore

WpConf *wp_core_get_conf(WpCore *self)

Gets the main configuration file that the core was constructed with.

Parameters:
  • self -- the core

Returns:

(transfer full) (nullable): the main configuration file of self

WpMainContext *wp_core_get_main_context(WpCore *self)

Gets the main context of the core.

Since

0.6.0

Parameters:
  • self -- the core

Returns:

(transfer none): the main context of self

WpConnection *wp_core_get_connection(WpCore *self)

Gets the connection of the main context of the core.

This is the same as calling wp_main_context_get_connection() on the context returned by wp_core_get_main_context().

Since

0.6.0

Parameters:
  • self -- the core

Returns:

(transfer none): the connection of the main context of self

WpRegistry *wp_core_get_registry(WpCore *self)

Gets the registry of the core.

Since

0.6.0

Parameters:
  • self -- the core

Returns:

(transfer none): the registry of self

WP_TYPE_CORE (wp_core_get_type ())

The WpCore GType.