PipeWire 1.4.10

Loading...
Searching...
No Matches
Registry
Core API

The registry object is a singleton object that keeps track of global objects on the PipeWire instance. More...

## Files
file | core.h
| pipewire/core.h

## Data Structures
struct | pw_registry_events
| Registry events. More...
struct | pw_registry_methods
| Registry methods. More...

## Macros
#define | PW_REGISTRY_EVENT_GLOBAL 0
#define | PW_REGISTRY_EVENT_GLOBAL_REMOVE 1
#define | PW_REGISTRY_EVENT_NUM 2
#define | PW_VERSION_REGISTRY_EVENTS 0
#define | PW_REGISTRY_METHOD_ADD_LISTENER 0
#define | PW_REGISTRY_METHOD_BIND 1
#define | PW_REGISTRY_METHOD_DESTROY 2
#define | PW_REGISTRY_METHOD_NUM 3
#define | PW_VERSION_REGISTRY_METHODS 0

## Functions
PW_API_REGISTRY_IMPL int | pw_registry_add_listener (struct pw_registry *registry, struct spa_hook *listener, const struct pw_registry_events *events, void *data)
| Registry.
PW_API_REGISTRY_IMPL void * | pw_registry_bind (struct pw_registry *registry, uint32_t id, const char *type, uint32_t version, size_t user_data_size)
| Bind to a global object.
PW_API_REGISTRY_IMPL int | pw_registry_destroy (struct pw_registry *registry, uint32_t id)
| Attempt to destroy a global object.

## Detailed Description

The registry object is a singleton object that keeps track of global objects on the PipeWire instance.

See also Global.

Global objects typically represent an actual object in PipeWire (for example, a module or node) or they are singleton objects such as the core.

When a client creates a registry object, the registry object will emit a global event for each global currently in the registry. Globals come and go as a result of device hotplugs or reconfiguration or other events, and the registry will send out global and global_remove events to keep the client up to date with the changes. To mark the end of the initial burst of events, the client can use the pw_core.sync methosd immediately after calling pw_core.get_registry.

A client can bind to a global object by using the bind request. This creates a client-side proxy that lets the object emit events to the client and lets the client invoke methods on the object. See Proxy

Clients can also change the permissions of the global objects that it can see. This is interesting when you want to configure a pipewire session before handing it to another application. You can, for example, hide certain existing or new objects or limit the access permissions on an object.

## Macro Definition Documentation

## ◆ PW_REGISTRY_EVENT_GLOBAL

#define PW_REGISTRY_EVENT_GLOBAL 0

## ◆ PW_REGISTRY_EVENT_GLOBAL_REMOVE

#define PW_REGISTRY_EVENT_GLOBAL_REMOVE 1

## ◆ PW_REGISTRY_EVENT_NUM

#define PW_REGISTRY_EVENT_NUM 2

## ◆ PW_VERSION_REGISTRY_EVENTS

#define PW_VERSION_REGISTRY_EVENTS 0

Examples
  gmain.c, tutorial2.c, tutorial3.c, and tutorial6.c.

## ◆ PW_REGISTRY_METHOD_ADD_LISTENER

#define PW_REGISTRY_METHOD_ADD_LISTENER 0

## ◆ PW_REGISTRY_METHOD_BIND

#define PW_REGISTRY_METHOD_BIND 1

## ◆ PW_REGISTRY_METHOD_DESTROY

#define PW_REGISTRY_METHOD_DESTROY 2

## ◆ PW_REGISTRY_METHOD_NUM

#define PW_REGISTRY_METHOD_NUM 3

## ◆ PW_VERSION_REGISTRY_METHODS

#define PW_VERSION_REGISTRY_METHODS 0

## Function Documentation

## ◆ pw_registry_add_listener()

PW_API_REGISTRY_IMPL int pw_registry_add_listener | ( | struct pw_registry * | registry,
|  | struct spa_hook * | listener,
|  | const struct pw_registry_events * | events,
|  | void * | data )

Registry.

See also
  pw_registry_methods.add_listener

Examples
  gmain.c, tutorial2.c, tutorial3.c, and tutorial6.c.

## ◆ pw_registry_bind()

PW_API_REGISTRY_IMPL void * pw_registry_bind | ( | struct pw_registry * | registry,
|  | uint32_t | id,
|  | const char * | type,
|  | uint32_t | version,
|  | size_t | user_data_size )

Bind to a global object.

Bind to the global object with id and use the client proxy with new_id as the proxy. After this call, methods can be send to the remote global object and events can be received

Parameters

  id | the global id to bind to
  type | the interface type to bind to
  version | the interface version to use

Returns
  the new object

See also
  pw_registry_methods.bind

Examples
  tutorial6.c.

## ◆ pw_registry_destroy()

PW_API_REGISTRY_IMPL int pw_registry_destroy | ( | struct pw_registry * | registry,
|  | uint32_t | id )

Attempt to destroy a global object.

Try to destroy the global object.

Parameters

  id | the global id to destroy. The client needs X permissions on the global.

See also
  pw_registry_methods.destroy