25 #ifndef PIPEWIRE_CONTEXT_H 26 #define PIPEWIRE_CONTEXT_H 32 #include <spa/utils/defs.h> 33 #include <spa/utils/hook.h> 97 #define PW_VERSION_CONTEXT_EVENTS 0 115 size_t user_data_size );
125 struct spa_hook *listener,
160 const char *factory_name,
161 const struct spa_dict *info);
169 const char *
type,
const struct spa_dict *props,
void *object,
170 size_t user_data_size);
const struct spa_support * pw_context_get_support(struct pw_context *context, uint32_t *n_support)
Get the context support objects.
A collection of key/value pairs.
Definition: properties.h:45
int pw_context_set_object(struct pw_context *context, const char *type, void *value)
add an object to the context
struct pw_loop * pw_context_get_main_loop(struct pw_context *context)
get the context main loop
void(* free)(void *data)
The context is being freed.
Definition: context.h:103
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:41
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
void pw_context_destroy(struct pw_context *context)
destroy a context object, all resources except the main_loop will be destroyed
const struct pw_properties * pw_context_get_properties(struct pw_context *context)
Get the context properties.
void(* check_access)(void *data, struct pw_impl_client *client)
a new client object is added
Definition: context.h:105
void * pw_context_get_user_data(struct pw_context *context)
Get the context user data.
Represents an object on the client side.
const struct pw_export_type * pw_context_find_export_type(struct pw_context *context, const char *type)
find information about registered export type
data for registering export functions
Definition: context.h:165
struct spa_list link
Definition: context.h:166
context events emitted by the context object added with pw_context_add_listener
Definition: context.h:96
void(* global_added)(void *data, struct pw_global *global)
a new global object was added
Definition: context.h:107
void(* destroy)(void *data)
The context is being destroyed.
Definition: context.h:101
struct spa_handle * pw_context_load_spa_handle(struct pw_context *context, const char *factory_name, const struct spa_dict *info)
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.
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.
uint32_t version
Definition: context.h:98
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
struct pw_global * pw_context_find_global(struct pw_context *context, uint32_t id)
Find a context global by id.
PipeWire client object class.
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.
A global object visible to remote clients.
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.
void(* global_removed)(void *data, struct pw_global *global)
a global object was removed
Definition: context.h:109
const char * type
Definition: context.h:167
void * pw_context_get_object(struct pw_context *context, const char *type)
get an object from the context
int pw_context_update_properties(struct pw_context *context, const struct spa_dict *dict)
Update the context properties.
const char * pw_context_find_spa_lib(struct pw_context *context, const char *factory_name)
find the library name for a spa factory