/** context events emitted by the context object added with \ref pw_context_add_listener */ struct pw_context_events { #define PW_VERSION_CONTEXT_EVENTS 1
uint32_t version;
/** The context is being destroyed */ void (*destroy) (void *data); /** The context is being freed */ void (*free) (void *data); /** a new client object is added */ void (*check_access) (void *data, struct pw_impl_client *client); /** a new global object was added */ void (*global_added) (void *data, struct pw_global *global); /** a global object was removed */ void (*global_removed) (void *data, struct pw_global *global);
/** a driver was added, since 0.3.75 version:1 */ void (*driver_added) (void *data, struct pw_impl_node *node); /** a driver was removed, since 0.3.75 version:1 */ void (*driver_removed) (void *data, struct pw_impl_node *node);
};
/** Make a new context object for a given main_loop. Ownership of the properties is taken, even *ifthefunctionreturnsNULL. * *\parammain_loopAmainlooptorunin.Thismuststayaliveunilpw_context_destroy()iscalled. *\parampropsextraproperties *\paramuser_data_sizeextrauserdatasize *\returnThecontextobjectonsuccess,orNULLonfailure,inwhichcaseerrnoisset.
* */ struct pw_context * pw_context_new(struct pw_loop *main_loop, struct pw_properties *props,
size_t user_data_size);
/** destroy a context object, all resources except the main_loop will be destroyed */ void pw_context_destroy(struct pw_context *context);
/** Get the context user data */ void *pw_context_get_user_data(struct pw_context *context);
/** Add a new event listener to a context */ void pw_context_add_listener(struct pw_context *context, struct spa_hook *listener, conststruct pw_context_events *events, void *data);
/** Get the context properties */ conststruct pw_properties *pw_context_get_properties(struct pw_context *context);
/** Update the context properties */ int pw_context_update_properties(struct pw_context *context, conststruct spa_dict *dict);
/** Get a config section for this context. Since 0.3.22, deprecated,
* use pw_context_conf_section_for_each(). */ constchar *pw_context_get_conf_section(struct pw_context *context, constchar *section); /** Parse a standard config section for this context. Since 0.3.22 */ int pw_context_parse_conf_section(struct pw_context *context, struct pw_properties *conf, constchar *section);
/** update properties from a section into props. Since 0.3.45 */ int pw_context_conf_update_props(struct pw_context *context, constchar *section, struct pw_properties *props); /** emit callback for all config sections. Since 0.3.45 */ int pw_context_conf_section_for_each(struct pw_context *context, constchar *section, int (*callback) (void *data, constchar *location, constchar *section, constchar *str, size_t len), void *data); /** emit callback for all matched properties. Since 0.3.46 */ int pw_context_conf_section_match_rules(struct pw_context *context, constchar *section, conststruct spa_dict *props, int (*callback) (void *data, constchar *location, constchar *action, constchar *str, size_t len), void *data);
/** Get the context support objects */ conststruct spa_support *pw_context_get_support(struct pw_context *context, uint32_t *n_support);
/** Get the context main loop. Returns the value passed to pw_context_new(). */ struct pw_loop *pw_context_get_main_loop(struct pw_context *context);
/** Get the context data loop. This loop runs on the realtime thread. This *acquiresaloopfromthegenericdata.rtclass.Usepw_context_acquire_loop()instead.
* Since 0.3.56 */ struct pw_data_loop *pw_context_get_data_loop(struct pw_context *context);
/** Get a data-loop.
* Since 1.1.0 */ struct pw_loop *pw_context_acquire_loop(struct pw_context *context, conststruct spa_dict *props); /** Release a data-loop.
* Since 1.1.0 */ void pw_context_release_loop(struct pw_context *context, struct pw_loop *loop);
/** Get the work queue from the context: Since 0.3.26 */ struct pw_work_queue *pw_context_get_work_queue(struct pw_context *context);
/** Get the memory pool from the context: Since 0.3.74 */ struct pw_mempool *pw_context_get_mempool(struct pw_context *context);
/** Iterate the globals of the context. The callback should return *0tofetchthenextitem,anyothervaluestopstheiterationandreturns *thevalue.Whenallcallbacksreturn0,thisfunctionreturns0whenall
* globals are iterated. */ int pw_context_for_each_global(struct pw_context *context, int (*callback) (void *data, struct pw_global *global), void *data);
/** Find a context global by id. * *\returnTheglobalonsuccess,orNULLonfailure.Ifidis\refPW_ID_CORE,
* this function will always return a non-NULL value. */ struct pw_global *pw_context_find_global(struct pw_context *context, /**< the context */
uint32_t id /**< the global id */);
/** add a spa library for the given factory_name regex */ int pw_context_add_spa_lib(struct pw_context *context, constchar *factory_regex, constchar *lib);
/** find the library name for a spa factory */ constchar * pw_context_find_spa_lib(struct pw_context *context, constchar *factory_name);
/** Load a SPA handle from a context. On failure returns NULL and sets errno. */ struct spa_handle *pw_context_load_spa_handle(struct pw_context *context, constchar *factory_name, conststruct spa_dict *info);
/** register a type that can be exported on a context_proxy. This is usually used by
* extension modules */ int pw_context_register_export_type(struct pw_context *context, struct pw_export_type *type); /** find information about registered export type */ conststruct pw_export_type *pw_context_find_export_type(struct pw_context *context, constchar *type);
/** add an object to the context * *\paramcontextThecontext. *\paramtypeThetypeoftheobject,usuallya`TYPE_INTERFACE_`value. *\paramvalueTheobjectvalue.Mustlastaslongasthecontextandmust *beofthetypecorrespondingtothetype. *\returnAnegativenumberonfailure(outofmemory).
* */ int pw_context_set_object(struct pw_context *context, constchar *type, void *value); /** get an object from the context * *\paramcontextThecontext. *\paramtypeThestringcorrespondingtotheobject'sinterface. *\returnTheobject,orNULLiftheobjectdoesnotexist.
* */ void *pw_context_get_object(struct pw_context *context, constchar *type);
/** *\}
*/ #ifdef __cplusplus
} #endif
#endif/* PIPEWIRE_CONTEXT_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.