A global object visible to remote clients.
More...
|
struct pw_global * | pw_global_new (struct pw_context *context, const char *type, uint32_t version, uint32_t permission_mask, struct pw_properties *properties, pw_global_bind_func_t func, void *object) |
| Create a new global object.
|
|
int | pw_global_register (struct pw_global *global) |
| Register a global object to the context registry.
|
|
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.
|
|
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.
|
|
struct pw_context * | pw_global_get_context (struct pw_global *global) |
| Get the context object of this global.
|
|
const char * | pw_global_get_type (struct pw_global *global) |
| Get the global type.
|
|
bool | pw_global_is_type (struct pw_global *global, const char *type) |
| Check a global type.
|
|
uint32_t | pw_global_get_version (struct pw_global *global) |
| Get the global version.
|
|
const struct pw_properties * | pw_global_get_properties (struct pw_global *global) |
| Get the global properties.
|
|
int | pw_global_update_keys (struct pw_global *global, const struct spa_dict *dict, const char *const keys[]) |
| Update the global properties, must be done when unregistered.
|
|
void * | pw_global_get_object (struct pw_global *global) |
| Get the object associated with the global.
|
|
uint32_t | pw_global_get_id (struct pw_global *global) |
| Get the unique id of the global.
|
|
uint64_t | pw_global_get_serial (struct pw_global *global) |
| Get the serial number of the global.
|
|
int | pw_global_add_resource (struct pw_global *global, struct pw_resource *resource) |
| Add a resource to a global.
|
|
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.
|
|
int | pw_global_bind (struct pw_global *global, struct pw_impl_client *client, uint32_t permissions, uint32_t version, uint32_t id) |
| Let a client bind to a global.
|
|
int | pw_global_update_permissions (struct pw_global *global, struct pw_impl_client *client, uint32_t old_permissions, uint32_t new_permissions) |
|
void | pw_global_destroy (struct pw_global *global) |
| Destroy a global.
|
|
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.
Global objects represent resources that are available on the PipeWire context and are accessible to remote clients. Globals come and go when devices or other resources become available for clients.
Remote clients receives a list of globals when it binds to the registry object. See Registry.
A client can bind to a global to send methods or receive events from the global.
See Proxy
◆ pw_global_bind_func_t
typedef int(* pw_global_bind_func_t) (void *object, struct pw_impl_client *client, uint32_t permissions, uint32_t version, uint32_t id) |
- Parameters
-
object | global object, see pw_global_new |
client | client that binds |
permissions | permissions for the bind |
version | client interface version |
id | client proxy id |
◆ PW_VERSION_GLOBAL_EVENTS
#define PW_VERSION_GLOBAL_EVENTS 0 |
◆ pw_global_new()
Create a new global object.
Create a new global object.
- Parameters
-
context | a context object |
type | the type of the global |
version | the version of the type |
properties | extra properties |
func | a function to bind to this global |
object | the associated object |
- Returns
- a result global
- Parameters
-
context | the context |
type | the interface type of the global |
version | the interface version of the global |
permission_mask | mask of valid permissions |
properties | extra properties |
func | function to bind |
object | global object |
◆ pw_global_register()
int pw_global_register |
( |
struct pw_global * |
global | ) |
|
Register a global object to the context registry.
Register a global object to the context registry.
- Parameters
-
- Returns
- 0 on success < 0 errno value on failure
◆ pw_global_add_listener()
Add an event listener on the global.
◆ pw_global_get_permissions()
Get the permissions of the global for a given client.
◆ pw_global_get_context()
Get the context object of this global.
◆ pw_global_get_type()
const char * pw_global_get_type |
( |
struct pw_global * |
global | ) |
|
◆ pw_global_is_type()
bool pw_global_is_type |
( |
struct pw_global * |
global, |
|
|
const char * |
type |
|
) |
| |
◆ pw_global_get_version()
uint32_t pw_global_get_version |
( |
struct pw_global * |
global | ) |
|
◆ pw_global_get_properties()
Get the global properties.
◆ pw_global_update_keys()
int pw_global_update_keys |
( |
struct pw_global * |
global, |
|
|
const struct spa_dict * |
dict, |
|
|
const char *const |
keys[] |
|
) |
| |
Update the global properties, must be done when unregistered.
◆ pw_global_get_object()
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_id()
uint32_t pw_global_get_id |
( |
struct pw_global * |
global | ) |
|
Get the unique id of the global.
◆ pw_global_get_serial()
uint64_t pw_global_get_serial |
( |
struct pw_global * |
global | ) |
|
Get the serial number of the global.
◆ pw_global_add_resource()
Add a resource to a global.
◆ pw_global_for_each_resource()
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.
◆ pw_global_bind()
int pw_global_bind |
( |
struct pw_global * |
global, |
|
|
struct pw_impl_client * |
client, |
|
|
uint32_t |
permissions, |
|
|
uint32_t |
version, |
|
|
uint32_t |
id |
|
) |
| |
Let a client bind to a global.
Let a client bind to a global.
- Parameters
-
global | the global to bind to |
client | the client that binds |
permissions | the Permission |
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.
◆ pw_global_update_permissions()
int pw_global_update_permissions |
( |
struct pw_global * |
global, |
|
|
struct pw_impl_client * |
client, |
|
|
uint32_t |
old_permissions, |
|
|
uint32_t |
new_permissions |
|
) |
| |
◆ pw_global_destroy()
void pw_global_destroy |
( |
struct pw_global * |
global | ) |
|
Destroy a global.
- Parameters
-
global | a global to destroy |