Go to the documentation of this file.
25 #ifndef PIPEWIRE_IMPL_CORE_H
26 #define PIPEWIRE_IMPL_CORE_H
47 #define PW_VERSION_IMPL_CORE_EVENTS 0
60 size_t user_data_size);
86 struct spa_hook *listener,
static uint32_t int int res
Definition: core.h:326
#define PW_VERSION_CLIENT
Definition: client.h:40
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:373
Factory events, listen to them with pw_impl_core_add_listener.
Definition: impl-core.h:46
const SPA_EXPORT char * pw_get_host_name(void)
Get the host name.
Definition: pipewire.c:554
#define pw_log_error(...)
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:624
#define PW_CORE_CHANGE_MASK_ALL
Definition: core.h:63
The core information.
Definition: core.h:55
SPA_EXPORT 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:624
SPA_EXPORT void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:377
#define NAME
Definition: impl-core.c:35
Definition: impl-core.c:37
#define PW_KEY_OBJECT_ID
a global object id
Definition: keys.h:60
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:519
struct spa_hook resource_listener
Definition: impl-core.c:39
#define PW_KEY_CORE_VERSION
The version of the core.
Definition: keys.h:71
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
uint32_t version
Definition: impl-core.h:48
Global events, use pw_global_add_listener.
Definition: global.h:65
#define PW_VERSION_CORE
Definition: core.h:40
PipeWire client object class.
const SPA_EXPORT char * pw_get_library_version(void)
Get the currently running version.
Definition: pipewire.c:608
#define PW_PERM_IS_R(p)
Definition: permission.h:53
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
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:262
static uint32_t int int const char int r
Definition: core.h:338
A global object visible to remote clients.
SPA_EXPORT int pw_impl_core_register(struct pw_impl_core *core, struct pw_properties *properties)
Definition: impl-core.c:561
SPA_EXPORT void * pw_impl_core_get_user_data(struct pw_impl_core *core)
Definition: impl-core.c:612
const struct pw_core_info * pw_impl_core_get_info(struct pw_impl_core *core)
Get the core information.
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
void(* free)(void *data)
the core is freed
Definition: impl-core.h:53
const struct pw_properties * pw_impl_core_get_properties(struct pw_impl_core *core)
Get the core properties.
Definition: impl-core.c:532
static int pw_map_for_each(struct pw_map *map, int(*func)(void *item_data, void *data), void *data)
Iterate all map items.
Definition: map.h:188
static int pw_map_insert_at(struct pw_map *map, uint32_t id, void *data)
Insert data in the map at an index.
Definition: map.h:133
SPA_EXPORT int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...)
Set a property value by format.
Definition: properties.c:433
struct spa_hook object_listener
Definition: impl-core.c:40
const SPA_EXPORT char * pw_get_user_name(void)
Get the user name.
Definition: pipewire.c:542
static uint32_t int int const char * message
Definition: core.h:326
void void pw_resource_errorf_id(struct pw_resource *resource, uint32_t id, int res, const char *error,...) SPA_PRINTF_FUNC(4
int pw_impl_core_update_properties(struct pw_impl_core *core, const struct spa_dict *dict)
Update the core properties.
Definition: impl-core.c:538
struct pw_global * pw_context_find_global(struct pw_context *context, uint32_t id)
Find a context global by id.
int pw_global_update_keys(struct pw_global *global, const struct spa_dict *dict, const char *keys[])
Update the global properties, must be done when unregistered.
Definition: global.c:215
#define pw_log_debug(...)
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:65
#define PW_PERM_IS_X(p)
Definition: permission.h:55
#define PW_TYPE_INTERFACE_Core
Definition: core.h:37
SPA_EXPORT struct pw_properties * pw_properties_new_dict(const struct spa_dict *dict)
Make a new properties object from the given dictionary.
Definition: properties.c:128
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:263
Core methods.
Definition: core.h:220
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
#define PW_PERM_ALL
Definition: permission.h:58
void pw_impl_core_destroy(struct pw_impl_core *core)
Definition: impl-core.c:431
void pw_mempool_clear(struct pw_mempool *pool)
Clear a pool.
Definition: mem.c:158
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:237
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
const SPA_EXPORT char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:456
SPA_EXPORT 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:373
#define PW_VERSION_CORE_METHODS
Definition: core.h:221
struct pw_impl_core * pw_context_get_default_core(struct pw_context *context)
Definition: impl-core.c:425
struct pw_global * pw_impl_core_get_global(struct pw_impl_core *core)
Get the global of this core.
Definition: impl-core.c:618
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
SPA_EXPORT const struct pw_properties * pw_impl_core_get_properties(struct pw_impl_core *core)
Get the core properties.
Definition: impl-core.c:532
void pw_resource_destroy(struct pw_resource *resource)
Destroy a resource.
Definition: resource.c:264
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:66
int pw_impl_core_register(struct pw_impl_core *core, struct pw_properties *properties)
Definition: impl-core.c:561
#define pw_log_trace(...)
#define PW_KEY_HOST_NAME
The host name of the machine.
Definition: keys.h:65
SPA_EXPORT 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
SPA_EXPORT void pw_impl_core_destroy(struct pw_impl_core *core)
Definition: impl-core.c:431
struct result_device_params_data data
Definition: impl-device.c:64
#define PW_CORE_CHANGE_MASK_PROPS
Definition: core.h:62
SPA_EXPORT struct pw_global * pw_impl_core_get_global(struct pw_impl_core *core)
Get the global of this core.
Definition: impl-core.c:618
#define PW_KEY_CORE_NAME
The name of the core.
Definition: keys.h:68
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
SPA_EXPORT 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.
Definition: global.c:67
#define PW_TYPE_INTERFACE_Registry
Definition: core.h:38
void * pw_impl_core_get_user_data(struct pw_impl_core *core)
Definition: impl-core.c:612
Registry methods.
Definition: core.h:448
SPA_EXPORT int pw_impl_core_update_properties(struct pw_impl_core *core, const struct spa_dict *dict)
Update the core properties.
Definition: impl-core.c:538
void(* initialized)(void *data)
the core is initialized
Definition: impl-core.h:55
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:98
SPA_EXPORT struct pw_impl_core * pw_context_get_default_core(struct pw_context *context)
Definition: impl-core.c:425
static uint32_t int seq
Definition: core.h:325
struct pw_resource * resource
Definition: impl-core.c:38
#define PW_VERSION_REGISTRY_METHODS
Definition: core.h:449
SPA_EXPORT int pw_global_register(struct pw_global *global)
register a global to the context registry
Definition: global.c:128
PipeWire factory interface.
#define PW_KEY_USER_NAME
The user name that runs pipewire.
Definition: keys.h:64
Resource events.
Definition: resource.h:64
void(* destroy)(void *data)
the core is destroyed
Definition: impl-core.h:51
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
uint32_t version
Definition: resource.h:66
SPA_EXPORT int pw_global_bind(struct pw_global *global, struct pw_impl_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Bind to a global.
Definition: global.c:284
A collection of key/value pairs.
Definition: properties.h:45
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:335