Go to the documentation of this file.
25 #ifndef PIPEWIRE_IMPL_CORE_H
26 #define PIPEWIRE_IMPL_CORE_H
53 #define PW_VERSION_IMPL_CORE_EVENTS 0
66 size_t user_data_size);
#define PW_KEY_USER_NAME
The user name that runs pipewire.
Definition: src/pipewire/keys.h:78
#define PW_PERM_IS_R(p)
Definition: permission.h:56
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
Definition: module-filter-chain.c:176
void pw_impl_core_add_listener(struct pw_impl_core *core, struct spa_hook *listener, const struct pw_impl_core_events *events, void *data)
Add an event listener.
Definition: impl-core.c:672
#define PW_TYPE_INTERFACE_Registry
Definition: core.h:55
void pw_resource_remove(struct pw_resource *resource)
Remove a resource, like pw_resource_destroy but without sending a remove_id message to the client.
Definition: resource.c:291
Factory events, listen to them with pw_impl_core_add_listener.
Definition: impl-core.h:52
struct pw_impl_core * pw_context_create_core(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Definition: impl-core.c:412
int pw_impl_core_update_properties(struct pw_impl_core *core, const struct spa_dict *dict)
Update the core properties.
Definition: impl-core.c:586
int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:298
#define PW_CORE_CHANGE_MASK_ALL
Definition: core.h:81
#define PW_KEY_OBJECT_ID
a global object id
Definition: src/pipewire/keys.h:66
The core information.
Definition: core.h:73
int pw_global_register(struct pw_global *global)
Register a global object to the context registry.
Definition: global.c:125
const struct pw_core_info * pw_impl_core_get_info(struct pw_impl_core *core)
Get the core information.
#define NAME
Definition: impl-core.c:72
Definition: impl-core.c:74
user data to add to an object
Definition: filter.c:75
void void pw_resource_errorf_id(struct pw_resource *resource, uint32_t id, int res, const char *error,...) 1(4
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 object.
Definition: global.c:66
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:230
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
struct spa_hook resource_listener
Definition: impl-core.c:76
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
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.
Definition: global.c:45
uint32_t version
Definition: impl-core.h:54
#define PW_VERSION_CORE
Definition: core.h:57
#define SPA_EXPORT
Definition: defs.h:208
Global events, use pw_global_add_listener.
Definition: global.h:68
#define pw_log_trace(...)
Definition: src/pipewire/log.h:90
#define PW_KEY_HOST_NAME
The host name of the machine.
Definition: src/pipewire/keys.h:79
const char * pw_get_user_name(void)
Get the user name.
Definition: pipewire.c:663
void pw_impl_core_destroy(struct pw_impl_core *core)
Definition: impl-core.c:479
struct pw_global * pw_impl_core_get_global(struct pw_impl_core *core)
Get the global of this core.
Definition: impl-core.c:666
void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data)
Append a hook.
Definition: hook.h:316
void pw_resource_destroy(struct pw_resource *resource)
Destroy a resource.
Definition: resource.c:264
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
struct pw_properties * pw_properties_new_dict(const struct spa_dict *dict)
Make a new properties object from the given dictionary.
Definition: properties.c:126
#define PW_TYPE_INTERFACE_Core
Definition: core.h:54
void * pw_impl_core_get_user_data(struct pw_impl_core *core)
Definition: impl-core.c:660
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
void(* free)(void *data)
the core is freed
Definition: impl-core.h:59
void pw_mempool_clear(struct pw_mempool *pool)
Clear a pool.
Definition: mem.c:156
#define PW_KEY_CORE_NAME
The name of the core.
Definition: src/pipewire/keys.h:82
int pw_impl_core_register(struct pw_impl_core *core, struct pw_properties *properties)
Definition: impl-core.c:609
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.
Definition: global.c:255
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
void pw_resource_add_object_listener(struct pw_resource *resource, struct spa_hook *listener, const void *funcs, void *data)
Set the resource implementation.
Definition: resource.c:174
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.
Definition: global.c:277
struct pw_global * pw_context_find_global(struct pw_context *context, uint32_t id)
Find a context global by id.
Definition: context.c:636
struct spa_hook object_listener
Definition: impl-core.c:77
#define PW_PERM_ALL
Definition: permission.h:61
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
const char * pw_get_host_name(void)
Get the host name.
Definition: pipewire.c:675
void pw_resource_errorf(struct pw_resource *resource, int res, const char *error,...) 1(3
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:61
#define PW_PERM_IS_X(p)
Definition: permission.h:58
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.
Definition: resource.c:165
struct pw_context * context
Definition: module-protocol-native.c:105
Core methods.
Definition: core.h:229
Definition: utils/dict.h:48
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.
Definition: global.c:209
#define spa_strerror(err)
Definition: result.h:51
#define PW_VERSION_CORE_METHODS
Definition: core.h:230
#define PW_ID_CORE
default ID for the core object after connect
Definition: core.h:66
struct pw_resource * pw_resource_new(struct pw_impl_client *client, uint32_t id, uint32_t permissions, const char *type, uint32_t version, size_t user_data_size)
Make a new resource for client.
Definition: resource.c:43
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
#define PW_KEY_CORE_VERSION
The version of the core.
Definition: src/pipewire/keys.h:85
Definition: module-protocol-native.c:103
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:369
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:69
struct pw_impl_factory * pw_context_find_factory(struct pw_context *context, const char *name)
Find a factory by name.
Definition: impl-factory.c:287
struct result_device_params_data data
Definition: impl-device.c:76
#define PW_CORE_CHANGE_MASK_PROPS
Definition: core.h:80
struct pw_core * core
Definition: module-protocol-simple.c:107
Registry methods.
Definition: core.h:464
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
void(* initialized)(void *data)
the core is initialized
Definition: impl-core.h:61
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.
Definition: resource.c:159
struct pw_impl_core * pw_context_get_default_core(struct pw_context *context)
Definition: impl-core.c:473
struct pw_resource * resource
Definition: impl-core.c:75
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
#define PW_VERSION_REGISTRY_METHODS
Definition: core.h:465
#define PW_VERSION_CLIENT
Definition: client.h:48
void * pw_impl_factory_create_object(struct pw_impl_factory *factory, struct pw_resource *resource, const char *type, uint32_t version, struct pw_properties *properties, uint32_t new_id)
Definition: impl-factory.c:261
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
Resource events.
Definition: resource.h:60
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...) 1(3
void(* destroy)(void *data)
the core is destroyed
Definition: impl-core.h:57
struct pw_resource * pw_impl_client_find_resource(struct pw_impl_client *client, uint32_t id)
Get a resource with the given id.
Definition: impl-client.c:540
uint32_t version
Definition: resource.h:62
const char * pw_get_library_version(void)
Get the currently running version.
Definition: pipewire.c:740
const struct pw_properties * pw_impl_core_get_properties(struct pw_impl_core *core)
Get the core properties.
Definition: impl-core.c:580
Definition: properties.h:49
void spa_hook_list_clean(struct spa_hook_list *list)
Remove all hooks from the list.
Definition: hook.h:344
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
#define ENODATA
Definition: impl-core.c:31
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
#define spa_list_append(list, item)
Definition: list.h:81