PipeWire: global.c File Reference

PipeWire 0.3.1

Macros | Functions
global.c File Reference
Include dependency graph for global.c:

## Macros
#define | NAME "global"

## Functions
SPA_EXPORT uint32_t | pw_global_get_permissions (struct pw_global *global, struct pw_impl_client *client)
| Get the permissions of the global for a given client. More...
SPA_EXPORT struct pw_context * | pw_global_get_context (struct pw_global *global)
| Get the context object of this global. More...
const SPA_EXPORT char * | pw_global_get_type (struct pw_global *global)
| Get the global type. More...
SPA_EXPORT bool | pw_global_is_type (struct pw_global *global, const char *type)
| Check a global type. More...
SPA_EXPORT uint32_t | pw_global_get_version (struct pw_global *global)
| Get the global version. More...
SPA_EXPORT const struct pw_properties * | pw_global_get_properties (struct pw_global *global)
| Get the global properties. More...
SPA_EXPORT void * | pw_global_get_object (struct pw_global *global)
| Get the object associated with the global. More...
SPA_EXPORT uint32_t | pw_global_get_id (struct pw_global *global)
| Get the unique id of the global. More...
SPA_EXPORT int | pw_global_add_resource (struct pw_global *global, struct pw_resource *resource)
| Add a resource to a global. More...
SPA_EXPORT int | pw_global_for_each_resource (struct pw_global *global, int(*callback)(void *data, struct pw_resource *resource), void *data)
| Iterate all resources added to the global The callback should return 0 to fetch the next item, any other value stops the iteration and returns the value. More...
SPA_EXPORT void | pw_global_add_listener (struct pw_global *global, struct spa_hook *listener, const struct pw_global_events *events, void *data)
| Add an event listener on the global. More...
SPA_EXPORT int | pw_global_update_permissions (struct pw_global *global, struct pw_impl_client *client, uint32_t old_permissions, uint32_t new_permissions)

## Macro Definition Documentation

## ◆ NAME

#define NAME "global"

## Function Documentation

## ◆ pw_global_add_listener()

SPA_EXPORT void pw_global_add_listener | ( | struct pw_global * | global,
|  | struct spa_hook * | listener,
|  | const struct pw_global_events * | events,
|  | void * | data
| ) |  |

Add an event listener on the global.

## ◆ pw_global_add_resource()

SPA_EXPORT int pw_global_add_resource | ( | struct pw_global * | global,
|  | struct pw_resource * | resource
| ) |  |

Add a resource to a global.

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

## ◆ pw_global_for_each_resource()

SPA_EXPORT int pw_global_for_each_resource | ( | struct pw_global * | global,
|  | int(*)(void *data, struct pw_resource *resource) | callback,
|  | void * | data
| ) |  |

Iterate all resources added to the global The callback should return 0 to fetch the next item, any other value stops the iteration and returns the value.

When all callbacks return 0, this function returns 0 when all items are iterated.

References res.

## ◆ pw_global_get_context()

SPA_EXPORT struct pw_context* pw_global_get_context | ( | struct pw_global * | global | ) |

Get the context object of this global.

## ◆ pw_global_get_id()

SPA_EXPORT uint32_t pw_global_get_id | ( | struct pw_global * | global | ) |

Get the unique id of the global.

## ◆ pw_global_get_object()

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

Get the object associated with the global.

This depends on the type of the global

## ◆ pw_global_get_permissions()

SPA_EXPORT uint32_t pw_global_get_permissions | ( | struct pw_global * | global,
|  | struct pw_impl_client * | client
| ) |  |

Get the permissions of the global for a given client.

References PW_PERM_RWX.

Referenced by pw_global::pw_global_register().

## ◆ pw_global_get_properties()

SPA_EXPORT const struct pw_properties* pw_global_get_properties | ( | struct pw_global * | global | ) |

Get the global properties.

## ◆ pw_global_get_type()

const SPA_EXPORT char* pw_global_get_type | ( | struct pw_global * | global | ) |

Get the global type.

## ◆ pw_global_get_version()

SPA_EXPORT uint32_t pw_global_get_version | ( | struct pw_global * | global | ) |

Get the global version.

## ◆ pw_global_is_type()

SPA_EXPORT bool pw_global_is_type | ( | struct pw_global * | global,
|  | const char * | type
| ) |  |

Check a global type.

## ◆ pw_global_update_permissions()

SPA_EXPORT int pw_global_update_permissions | ( | struct pw_global * | global,
|  | struct pw_impl_client * | client,
|  | uint32_t | old_permissions,
|  | uint32_t | new_permissions
| ) |  |

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

Referenced by pw_impl_client_update_permissions().