25#ifndef PIPEWIRE_CONTEXT_H
26#define PIPEWIRE_CONTEXT_H
73#define PW_VERSION_CONTEXT_EVENTS 0
91 size_t user_data_size );
123 int (*callback) (
void *data,
const char *location,
const char *section,
124 const char *str,
size_t len),
129 int (*callback) (
void *data,
const char *location,
const char *action,
130 const char *str,
size_t len),
150 int (*callback) (
void *data,
struct pw_global *global),
164 const char *factory_name,
173 const char *
type,
const struct spa_dict *props,
void *object,
174 size_t user_data_size);
void * pw_context_get_user_data(struct pw_context *context)
Get the context user data.
Definition: context.c:482
struct spa_handle * pw_context_load_spa_handle(struct pw_context *context, const char *factory_name, const struct spa_dict *info)
Definition: context.c:1357
int pw_context_set_object(struct pw_context *context, const char *type, void *value)
add an object to the context
Definition: context.c:1425
int pw_context_register_export_type(struct pw_context *context, struct pw_export_type *type)
register a type that can be exported on a context_proxy.
Definition: context.c:1387
void pw_context_destroy(struct pw_context *context)
destroy a context object, all resources except the main_loop will be destroyed
Definition: context.c:398
void pw_context_add_listener(struct pw_context *context, struct spa_hook *listener, const struct pw_context_events *events, void *data)
Add a new event listener to a context.
Definition: context.c:488
const char * pw_context_get_conf_section(struct pw_context *context, const char *section)
Get a config section for this context.
Definition: context.c:528
int pw_context_update_properties(struct pw_context *context, const struct spa_dict *dict)
Update the context properties.
Definition: context.c:541
int pw_context_conf_section_for_each(struct pw_context *context, const char *section, int(*callback)(void *data, const char *location, const char *section, const char *str, size_t len), void *data)
emit callback for all config sections.
Definition: conf.c:865
void * pw_context_get_object(struct pw_context *context, const char *type)
get an object from the context
Definition: context.c:1453
const struct pw_export_type * pw_context_find_export_type(struct pw_context *context, const char *type)
find information about registered export type
Definition: context.c:1399
int pw_context_conf_section_match_rules(struct pw_context *context, const char *section, const struct spa_dict *props, int(*callback)(void *data, const char *location, const char *action, const char *str, size_t len), void *data)
emit callback for all matched properties.
Definition: conf.c:1164
int pw_context_conf_update_props(struct pw_context *context, const char *section, struct pw_properties *props)
update properties from a section into props.
Definition: conf.c:998
const struct pw_properties * pw_context_get_properties(struct pw_context *context)
Get the context properties.
Definition: context.c:522
const char * pw_context_find_spa_lib(struct pw_context *context, const char *factory_name)
find the library name for a spa factory
Definition: context.c:1345
int pw_context_for_each_global(struct pw_context *context, int(*callback)(void *data, struct pw_global *global), void *data)
Iterate the globals of the context.
Definition: context.c:560
struct pw_data_loop * pw_context_get_data_loop(struct pw_context *context)
get the context data loop.
Definition: context.c:510
struct pw_loop * pw_context_get_main_loop(struct pw_context *context)
get the context main loop
Definition: context.c:504
struct pw_context * pw_context_new(struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size)
Make a new context object for a given main_loop.
Definition: context.c:187
int pw_context_add_spa_lib(struct pw_context *context, const char *factory_regex, const char *lib)
add a spa library for the given factory_name regex
Definition: context.c:1320
struct pw_work_queue * pw_context_get_work_queue(struct pw_context *context)
Get the work queue from the context: Since 0.3.26.
Definition: context.c:516
const struct spa_support * pw_context_get_support(struct pw_context *context, uint32_t *n_support)
Get the context support objects.
Definition: context.c:497
struct pw_global * pw_context_find_global(struct pw_context *context, uint32_t id)
Find a context global by id.
Definition: context.c:577
int pw_context_parse_conf_section(struct pw_context *context, struct pw_properties *conf, const char *section)
Parse a standard config section for this context.
Definition: conf.c:896
context events emitted by the context object added with pw_context_add_listener
Definition: src/pipewire/context.h:79
void(* global_added)(void *data, struct pw_global *global)
a new global object was added
Definition: src/pipewire/context.h:91
void(* destroy)(void *data)
The context is being destroyed.
Definition: src/pipewire/context.h:85
void(* global_removed)(void *data, struct pw_global *global)
a global object was removed
Definition: src/pipewire/context.h:93
void(* free)(void *data)
The context is being freed.
Definition: src/pipewire/context.h:87
uint32_t version
Definition: src/pipewire/context.h:82
void(* check_access)(void *data, struct pw_impl_client *client)
a new client object is added
Definition: src/pipewire/context.h:89
data for registering export functions
Definition: src/pipewire/context.h:177
const char * type
Definition: src/pipewire/context.h:179
struct spa_list link
Definition: src/pipewire/context.h:178
Definition: src/pipewire/loop.h:51
Definition: properties.h:53
struct spa_dict dict
dictionary of key/values
Definition: properties.h:54
Definition: utils/dict.h:59
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:351
Extra supporting infrastructure passed to the init() function of a factory.
Definition: plugin.h:96