Registry

digraph inheritance { rankdir=LR; GObject -> WpRegistry; }

struct WpRegistry

The registry keeps track of the objects of a WpCore. It is owned by the core and can be retrieved with wp_core_get_registry().

The registry has the following responsibilities:

  • it maintains a list of registered objects, which other classes use to keep objects loaded permanently into memory

  • it watches the PipeWire registry and keeps track of remote and local objects that appear in it, making them accessible through the WpObjectManager API

  • it keeps track of the features that are provided by the loaded components

GObject Properties

core

The core of the registry

WpCore *

G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY

WpCore *wp_registry_get_core(WpRegistry *self)

Gets the core of the registry.

Parameters:
  • self -- the registry

Returns:

(transfer full) (nullable): the core of self, or NULL if that core is gone

gpointer wp_registry_find_object(WpRegistry *self, GEqualFunc func, gconstpointer data)

Finds a registered object.

Parameters:
  • self -- the registry

  • func -- (scope call): a function that takes the object being searched as the first argument and data as the second. it should return TRUE if the object is found or FALSE otherwise

  • data -- the second argument to func

Returns:

(transfer full) (type GObject*) (nullable): the registered object or NULL if not found

void wp_registry_register_object(WpRegistry *self, gpointer obj)

Registers obj with the registry, making it appear on WpObjectManager instances as well.

The registry will also maintain a ref to that object until it is removed.

Parameters:
  • self -- the registry

  • obj -- (transfer full) (type GObject*): the object to register

void wp_registry_remove_object(WpRegistry *self, gpointer obj)

Detaches and unrefs the specified object from this registry.

Parameters:
  • self -- the registry

  • obj -- (transfer none) (type GObject*): a pointer to the object to remove

gboolean wp_registry_test_feature(WpRegistry *self, const gchar *feature)

Test if a global feature is provided.

Parameters:
  • self -- the registry

  • feature -- the feature name

Returns:

TRUE if the feature is provided, FALSE otherwise

WP_TYPE_REGISTRY (wp_registry_get_type ())

The WpRegistry GType.