PipeWire: pw_global Class Reference

PipeWire 0.3.12

Public Member Functions
pw_global Class Reference

A global object visible to remote clients. More...

## Public Member Functions
SPA_EXPORT struct pw_global * | pw_global_new (struct pw_context *context, const char *type, uint32_t version, struct pw_properties *properties, pw_global_bind_func_t func, void *object)
| Create a new global. More...
SPA_EXPORT int | pw_global_register (struct pw_global *global)
| register a global to the context registry More...
SPA_EXPORT int | pw_global_bind (struct pw_global *global, struct pw_impl_client *client, uint32_t permissions, uint32_t version, uint32_t id)
| Bind to a global. More...
SPA_EXPORT void | pw_global_destroy (struct pw_global *global)
| Destroy a global. More...

## Detailed Description

A global object visible to remote clients.

A global object is visible to remote clients and represents a resource that can be used or inspected.

See page_remote_api

## Member Function Documentation

## ◆ pw_global_bind()

SPA_EXPORT int pw_global_bind | ( | struct pw_global * | global,
|  | struct pw_impl_client * | client,
|  | uint32_t | permissions,
|  | uint32_t | version,
|  | uint32_t | id
| ) |  |

Bind to a global.

Parameters

  global | the global to bind to
  client | the client that binds
  version | the version
  id | the id of the resource

Let client bind to global with the given version and id. After binding, the client and the global object will be able to exchange messages on the proxy/resource with id.

References NAME, pw_log::pw_log_error, pw_map::pw_map_insert_at(), and res.

## ◆ pw_global_destroy()

SPA_EXPORT void pw_global_destroy | ( | struct pw_global * | global | ) |

Destroy a global.

Parameters

  global | a global to destroy

References NAME, pw_log::pw_log_debug, and pw_resource_destroy().

Referenced by pw_impl_core_destroy(), pw_impl_factory_destroy(), and pw_impl_module::pw_impl_module_destroy().

## ◆ pw_global_new()

SPA_EXPORT struct pw_global * pw_global_new | ( | struct pw_context * | context,
|  | const char * | type,
|  | uint32_t | version,
|  | struct pw_properties * | properties,
|  | pw_global_bind_func_t | func,
|  | void * | object
| ) |  |

Create a new global.

Parameters

  context | a context object
  type | the type of the global
  version | the version of the type
  properties | extra properties
  bind | a function to bind to this global
  object | the associated object

Returns
  a result global

References NAME, pw_log::pw_log_debug, pw_log::pw_log_error, pw_map::pw_map_insert_new(), pw_properties::pw_properties_free(), pw_properties::pw_properties_new(), res, and impl::this.

Referenced by pw_impl_client_register(), pw_impl_core_register(), pw_impl_device_register(), pw_impl_factory_register(), pw_impl_link_register(), pw_impl_node_register(), and pw_impl_port_register().

## ◆ pw_global_register()

SPA_EXPORT int pw_global_register | ( | struct pw_global * | global | ) |

register a global to the context registry

Parameters

  global | a global to add

Returns
  0 on success < 0 errno value on failure

References NAME, pw_global_get_permissions(), pw_log::pw_log_debug, and PW_PERM_IS_R.

The documentation for this class was generated from the following files:

- global.h
- global.c