resource.h File Reference
Include dependency graph for resource.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | pw_resource_events
| Resource events. More...

## Macros

#define | PW_TYPE__Resource "PipeWire:Object:Resource"
#define | PW_TYPE_RESOURCE_BASE PW_TYPE__Resource ":"
#define | PW_VERSION_RESOURCE_EVENTS 0
#define | pw_resource_do(r, type, method, v, ...) spa_hook_list_call_once(pw_resource_get_implementation(r),type,method,v,## __VA_ARGS__)
#define | pw_resource_do_parent(r, l, type, method, ...) spa_hook_list_call_once_start(pw_resource_get_implementation(r),l,type,method,v,## __VA_ARGS__)
#define | pw_resource_notify(r, type, event, ...) ((type*) pw_resource_get_marshal(r)->event_marshal)->event(r, ## __VA_ARGS__)

## Functions

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...
void | pw_resource_destroy (struct pw_resource *resource)
| Destroy a resource. More...
struct pw_client * | pw_resource_get_client (struct pw_resource *resource)
| Get the client owning this resource. More...
uint32_t | pw_resource_get_id (struct pw_resource *resource)
| Get the unique id of this resource. More...
uint32_t | pw_resource_get_permissions (struct pw_resource *resource)
| Get the permissions of this resource. More...
uint32_t | pw_resource_get_type (struct pw_resource *resource)
| Get the type of this resource. More...
struct pw_protocol * | pw_resource_get_protocol (struct pw_resource *resource)
| Get the protocol used for this resource. More...
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...
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...
void | pw_resource_set_implementation (struct pw_resource *resource, const void *implementation, void *data)
| Set the resource implementation. More...
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...
void | pw_resource_error (struct pw_resource *resource, int result, const char *error)
| Generate an error for a resource. More...
struct spa_hook_list * | pw_resource_get_implementation (struct pw_resource *resource)
| Get the implementation list of a resource. More...
const struct pw_protocol_marshal * | pw_resource_get_marshal (struct pw_resource *resource)
| Get the marshal functions for the resource. More...

## Macro Definition Documentation

## pw_resource_do

#define pw_resource_do | ( |  | r,
|  |  | type,
|  |  | method,
|  |  | v,
|  |  | ...
| ) |  | spa_hook_list_call_once(pw_resource_get_implementation(r),type,method,v,## __VA_ARGS__)

## pw_resource_do_parent

#define pw_resource_do_parent | ( |  | r,
|  |  | l,
|  |  | type,
|  |  | method,
|  |  | ...
| ) |  | spa_hook_list_call_once_start(pw_resource_get_implementation(r),l,type,method,v,## __VA_ARGS__)

## pw_resource_notify

#define pw_resource_notify | ( |  | r,
|  |  | type,
|  |  | event,
|  |  | ...
| ) |  | ((type*) pw_resource_get_marshal(r)->event_marshal)->event(r, ## __VA_ARGS__)

## PW_TYPE__Resource

#define PW_TYPE__Resource "PipeWire:Object:Resource"

## PW_TYPE_RESOURCE_BASE

#define PW_TYPE_RESOURCE_BASE PW_TYPE__Resource ":"

## PW_VERSION_RESOURCE_EVENTS

#define PW_VERSION_RESOURCE_EVENTS 0

## Function Documentation

## pw_resource_add_listener()

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()

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()

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

Destroy a resource.

References pw_core_resource_remove_id.

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

## pw_resource_error()

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()

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

Get the client owning this resource.

## pw_resource_get_id()

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

Get the unique id of this resource.

## pw_resource_get_implementation()

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

Get the implementation list of a resource.

## pw_resource_get_marshal()

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

Get the marshal functions for the resource.

## pw_resource_get_permissions()

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

Get the permissions of this resource.

## pw_resource_get_protocol()

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

Get the protocol used for this resource.

## pw_resource_get_type()

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

Get the type of this resource.

## pw_resource_get_user_data()

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()

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_protocol_get_marshal(), and impl::this.

## pw_resource_set_implementation()

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

Set the resource implementation.