| 
    PipeWire
    0.3.33
    
   | 
 
The PipeWire context object manages all locally available resources. More...
Data Structures | |
| struct | pw_context_events | 
| context events emitted by the context object added with pw_context_add_listener  More... | |
| struct | pw_export_type | 
| data for registering export functions  More... | |
Functions | |
| 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.  More... | |
| void | pw_context_destroy (struct pw_context *context) | 
| destroy a context object, all resources except the main_loop will be destroyed  More... | |
| void * | pw_context_get_user_data (struct pw_context *context) | 
| Get the context user data.  More... | |
| 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.  More... | |
| const struct pw_properties * | pw_context_get_properties (struct pw_context *context) | 
| Get the context properties.  More... | |
| int | pw_context_update_properties (struct pw_context *context, const struct spa_dict *dict) | 
| Update the context properties.  More... | |
| const char * | pw_context_get_conf_section (struct pw_context *context, const char *section) | 
| Get a config section for this context.  More... | |
| const struct spa_support * | pw_context_get_support (struct pw_context *context, uint32_t *n_support) | 
| Get the context support objects.  More... | |
| struct pw_loop * | pw_context_get_main_loop (struct pw_context *context) | 
| get the context main loop  More... | |
| struct pw_work_queue * | pw_context_get_work_queue (struct pw_context *context) | 
| Get the work queue from the context: Since 0.3.26.  More... | |
| 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.  More... | |
| struct pw_global * | pw_context_find_global (struct pw_context *context, uint32_t id) | 
| Find a context global by id.  More... | |
| 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  More... | |
| const char * | pw_context_find_spa_lib (struct pw_context *context, const char *factory_name) | 
| find the library name for a spa factory  More... | |
| 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.  More... | |
| const struct pw_export_type * | pw_context_find_export_type (struct pw_context *context, const char *type) | 
| find information about registered export type  More... | |
| int | pw_context_set_object (struct pw_context *context, const char *type, void *value) | 
| add an object to the context  More... | |
| void * | pw_context_get_object (struct pw_context *context, const char *type) | 
| get an object from the context  More... | |
| struct pw_impl_factory * | pw_context_find_factory (struct pw_context *context, const char *name) | 
| Find a factory by name.  More... | |
The PipeWire context object manages all locally available resources.
It is used by both clients and servers.
The context is used to:
| 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.
References spa_hook_list_append().
Referenced by pipewire__module_init().
| 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
| void pw_context_destroy | ( | struct pw_context * | context | ) | 
destroy a context object, all resources except the main_loop will be destroyed
destroy a context object, all resources except the main_loop will be destroyed
| context | a context to destroy | 
References impl::context, NAME, pw_array_for_each, pw_core_disconnect(), pw_data_loop_destroy(), pw_global_destroy(), pw_impl_client_destroy(), pw_impl_core_destroy(), pw_impl_device_destroy(), pw_impl_metadata_destroy(), pw_impl_module_destroy(), pw_impl_node_destroy(), pw_log_debug, pw_mempool_destroy(), pw_properties_free(), pw_resource_destroy(), pw_settings_clean(), pw_unload_spa_handle(), pw_work_queue_destroy(), SPA_CONTAINER_OF, and spa_list_consume.
| const struct pw_export_type* pw_context_find_export_type | ( | struct pw_context * | context, | 
| const char * | type | ||
| ) | 
find information about registered export type
References spa_list_for_each, spa_streq(), and pw_export_type::type.
Referenced by pw_context_register_export_type(), and pw_core_export().
| struct pw_impl_factory* pw_context_find_factory | ( | struct pw_context * | context, | 
| const char * | name | ||
| ) | 
Find a factory by name.
| context | the context object | 
| name | the name of the factory to find | 
Find in the list of factories registered in context for one with the given name.
| context | the context | 
| name | the factory name | 
References name, spa_list_for_each, and spa_streq().
| struct pw_global* pw_context_find_global | ( | struct pw_context * | context, | 
| uint32_t | id | ||
| ) | 
Find a context global by id.
| context | the context | 
| id | the global id | 
Referenced by pw_impl_client_check_permissions(), and pw_impl_client_update_permissions().
| const char* pw_context_find_spa_lib | ( | struct pw_context * | context, | 
| const char * | factory_name | ||
| ) | 
find the library name for a spa factory
References pw_array_for_each.
Referenced by pw_context_load_spa_handle().
| int pw_context_for_each_global | ( | struct pw_context * | context, | 
| int(*)(void *data, struct pw_global *global) | callback, | ||
| void * | data | ||
| ) | 
Iterate the globals of the context.
The callback should return 0 to fetch the next item, any other value stops the iteration and returns the value. When all callbacks return 0, this function returns 0 when all globals are iterated.
References spa_list_for_each_safe.
| const char* pw_context_get_conf_section | ( | struct pw_context * | context, | 
| const char * | section | ||
| ) | 
| struct pw_loop* pw_context_get_main_loop | ( | struct pw_context * | context | ) | 
get the context main loop
Referenced by pipewire__module_init(), and sm_logind_start().
| void* pw_context_get_object | ( | struct pw_context * | context, | 
| const char * | type | ||
| ) | 
get an object from the context
| const struct pw_properties* pw_context_get_properties | ( | struct pw_context * | context | ) | 
Get the context properties.
Referenced by pipewire__module_init().
| const struct spa_support* pw_context_get_support | ( | struct pw_context * | context, | 
| uint32_t * | n_support | ||
| ) | 
Get the context support objects.
Referenced by pipewire__module_init(), and pw_context_load_spa_handle().
| void* pw_context_get_user_data | ( | struct pw_context * | context | ) | 
Get the context user data.
| struct pw_work_queue* pw_context_get_work_queue | ( | struct pw_context * | context | ) | 
Get the work queue from the context: Since 0.3.26.
References pw_work_queue_new().
Referenced by pipewire__module_init().
| struct spa_handle* pw_context_load_spa_handle | ( | struct pw_context * | context, | 
| const char * | factory_name, | ||
| const struct spa_dict * | info | ||
| ) | 
References NAME, pw_context_find_spa_lib(), pw_context_get_support(), pw_load_spa_handle(), pw_log_debug, pw_log_warn, spa_dict_lookup(), and SPA_KEY_LIBRARY_NAME.
Referenced by sm_libcamera_monitor_start(), and sm_v4l2_monitor_start().
| struct pw_context* pw_context_new | ( | struct pw_loop * | main_loop, | 
| struct pw_properties * | properties, | ||
| size_t | user_data_size | ||
| ) | 
Make a new context object for a given main_loop.
Ownership of the properties is taken
Make a new context object for a given main_loop.
| main_loop | the main loop to use | 
| properties | extra properties for the context, ownership it taken | 
| main_loop | a main loop to run in | 
| properties | extra properties | 
| user_data_size | extra user data size | 
References NAME, pw_log_debug, SPA_PTROFF, and impl::this.
Referenced by pw_filter_new_simple(), and pw_stream_new_simple().
| 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.
This is usually used by extension modules
References pw_export_type::link, pw_context_find_export_type(), pw_log_debug, pw_log_warn, spa_list_append, and pw_export_type::type.
| int pw_context_set_object | ( | struct pw_context * | context, | 
| const char * | type, | ||
| void * | value | ||
| ) | 
add an object to the context
| int pw_context_update_properties | ( | struct pw_context * | context, | 
| const struct spa_dict * | dict | ||
| ) | 
Update the context properties.
Update the context properties.
| context | a context | 
| dict | properties to update | 
Update the context object with the given properties
References pw_properties::dict, NAME, pw_log_debug, and pw_properties_update().