PipeWire 0.2.6

Functions
resource.c File Reference
Include dependency graph for resource.c:

## Functions
SPA_EXPORT struct pw_resource * | pw_resource_new (struct pw_client *client, uint32_t id, uint32_t permissions, uint32_t type, uint32_t version, size_t user_data_size)
| Make a new resource for client. More...
SPA_EXPORT struct pw_client * | pw_resource_get_client (struct pw_resource *resource)
| Get the client owning this resource. More...
SPA_EXPORT uint32_t | pw_resource_get_id (struct pw_resource *resource)
| Get the unique id of this resource. More...
SPA_EXPORT uint32_t | pw_resource_get_permissions (struct pw_resource *resource)
| Get the permissions of this resource. More...
SPA_EXPORT uint32_t | pw_resource_get_type (struct pw_resource *resource)
| Get the type of this resource. More...
SPA_EXPORT struct pw_protocol * | pw_resource_get_protocol (struct pw_resource *resource)
| Get the protocol used for this resource. More...
SPA_EXPORT void * | pw_resource_get_user_data (struct pw_resource *resource)
| Get the user data for the resource, the size was given in pw_resource_new. More...
SPA_EXPORT void | pw_resource_add_listener (struct pw_resource *resource, struct spa_hook *listener, const struct pw_resource_events *events, void *data)
| Add an event listener. More...
SPA_EXPORT void | pw_resource_set_implementation (struct pw_resource *resource, const void *implementation, void *data)
| Set the resource implementation. More...
SPA_EXPORT void | pw_resource_add_override (struct pw_resource *resource, struct spa_hook *listener, const void *implementation, void *data)
| Override the implementation of a resource. More...
SPA_EXPORT struct spa_hook_list * | pw_resource_get_implementation (struct pw_resource *resource)
| Get the implementation list of a resource. More...
SPA_EXPORT const struct pw_protocol_marshal * | pw_resource_get_marshal (struct pw_resource *resource)
| Get the marshal functions for the resource. More...
SPA_EXPORT void | pw_resource_error (struct pw_resource *resource, int result, const char *error)
| Generate an error for a resource. More...
SPA_EXPORT void | pw_resource_destroy (struct pw_resource *resource)
| Destroy a resource. More...

## Function Documentation

## ◆ pw_resource_add_listener()

SPA_EXPORT void pw_resource_add_listener | ( | struct pw_resource * | resource,
|  | struct spa_hook * | listener,
|  | const struct pw_resource_events * | events,
|  | void * | data
| ) |  |

Add an event listener.

## ◆ pw_resource_add_override()

SPA_EXPORT void pw_resource_add_override | ( | struct pw_resource * | resource,
|  | struct spa_hook * | listener,
|  | const void * | implementation,
|  | void * | data
| ) |  |

Override the implementation of a resource.

## ◆ pw_resource_destroy()

SPA_EXPORT void pw_resource_destroy | ( | struct pw_resource * | resource | ) |

Destroy a resource.

References pw_core_resource_remove_id, pw_log::pw_log_debug(), and pw_map::pw_map_insert_at().

Referenced by pw_core::pw_core_destroy(), pw_factory_destroy(), and pw_module::pw_module_destroy().

Here is the caller graph for this function:

## ◆ pw_resource_error()

SPA_EXPORT void pw_resource_error | ( | struct pw_resource * | resource,
|  | int | result,
|  | const char * | error
| ) |  |

Generate an error for a resource.

References pw_core_resource_error.

## ◆ pw_resource_get_client()

SPA_EXPORT struct pw_client* pw_resource_get_client | ( | struct pw_resource * | resource | ) |

Get the client owning this resource.

## ◆ pw_resource_get_id()

SPA_EXPORT uint32_t pw_resource_get_id | ( | struct pw_resource * | resource | ) |

Get the unique id of this resource.

## ◆ pw_resource_get_implementation()

SPA_EXPORT struct spa_hook_list* pw_resource_get_implementation | ( | struct pw_resource * | resource | ) |

Get the implementation list of a resource.

## ◆ pw_resource_get_marshal()

SPA_EXPORT const struct pw_protocol_marshal* pw_resource_get_marshal | ( | struct pw_resource * | resource | ) |

Get the marshal functions for the resource.

## ◆ pw_resource_get_permissions()

SPA_EXPORT uint32_t pw_resource_get_permissions | ( | struct pw_resource * | resource | ) |

Get the permissions of this resource.

## ◆ pw_resource_get_protocol()

SPA_EXPORT struct pw_protocol* pw_resource_get_protocol | ( | struct pw_resource * | resource | ) |

Get the protocol used for this resource.

## ◆ pw_resource_get_type()

SPA_EXPORT uint32_t pw_resource_get_type | ( | struct pw_resource * | resource | ) |

Get the type of this resource.

## ◆ pw_resource_get_user_data()

SPA_EXPORT void* pw_resource_get_user_data | ( | struct pw_resource * | resource | ) |

Get the user data for the resource, the size was given in pw_resource_new.

## ◆ pw_resource_new()

SPA_EXPORT struct pw_resource* pw_resource_new | ( | struct pw_client * | client,
|  | uint32_t | id,
|  | uint32_t | permissions,
|  | uint32_t | type,
|  | uint32_t | version,
|  | size_t | user_data_size
| ) |  |

Make a new resource for client.

Parameters

  client | the client owning the resource
  id | the remote per client id
  permissions | permissions on this resource
  type | interface of the resource
  version | requested interface version
  user_data_size | extra user data size

References pw_log::pw_log_debug(), pw_map::pw_map_insert_at(), pw_map::pw_map_insert_new(), pw_protocol_get_marshal(), and impl::this.

## ◆ pw_resource_set_implementation()

SPA_EXPORT void pw_resource_set_implementation | ( | struct pw_resource * | resource,
|  | const void * | implementation,
|  | void * | data
| ) |  |

Set the resource implementation.