PipeWire
0.2.9
|
A collection of key/value pairs. More...
Public Member Functions | |
SPA_EXPORT struct pw_properties * | pw_properties_new (const char *key,...) |
Make a new properties object. More... | |
SPA_EXPORT struct pw_properties * | pw_properties_new_dict (const struct spa_dict *dict) |
Make a new properties object from the given dictionary. More... | |
SPA_EXPORT struct pw_properties * | pw_properties_new_string (const char *str) |
Make a new properties object from the given str. More... | |
SPA_EXPORT struct pw_properties * | pw_properties_copy (const struct pw_properties *properties) |
Copy a properties object. More... | |
SPA_EXPORT void | pw_properties_clear (struct pw_properties *properties) |
Clear a properties object. More... | |
SPA_EXPORT int | pw_properties_update (struct pw_properties *props, const struct spa_dict *dict) |
Update properties. More... | |
SPA_EXPORT void | pw_properties_free (struct pw_properties *properties) |
Free a properties object. More... | |
SPA_EXPORT int | pw_properties_set (struct pw_properties *properties, const char *key, const char *value) |
Set a property value. More... | |
SPA_EXPORT int | pw_properties_setf (struct pw_properties *properties, const char *key, const char *format,...) |
Set a property value by format. More... | |
SPA_EXPORT const char * | pw_properties_get (const struct pw_properties *properties, const char *key) |
Get a property. More... | |
SPA_EXPORT const char * | pw_properties_iterate (const struct pw_properties *properties, void **state) |
Iterate property values. More... | |
Data Fields | |
struct spa_dict | dict |
dictionary of key/values More... | |
uint32_t | flags |
extra flags More... | |
A collection of key/value pairs.
Properties are used to pass around arbitrary key/value pairs. Both keys and values are strings which keeps things simple. Encoding of arbitrary values should be done by using a string serialization such as base64 for binary blobs.
SPA_EXPORT void pw_properties_clear | ( | struct pw_properties * | properties | ) |
Clear a properties object.
properties | properties to clear |
References pw_array_for_each.
Referenced by pw_properties_free().
SPA_EXPORT struct pw_properties * pw_properties_copy | ( | const struct pw_properties * | properties | ) |
Copy a properties object.
properties | properties to copy |
References dict, and pw_properties_new_dict().
Referenced by pw_core::pw_core_new().
SPA_EXPORT void pw_properties_free | ( | struct pw_properties * | properties | ) |
Free a properties object.
properties | the properties to free |
References pw_properties_clear().
Referenced by pw_core::pw_core_destroy(), pw_device_destroy(), pw_device_new(), pw_factory_destroy(), pw_global::pw_global_new(), pw_loop::pw_loop_destroy(), pw_loop::pw_loop_new(), pw_mempool_destroy(), pw_module::pw_module_destroy(), pw_remote_destroy(), and pw_remote_new().
SPA_EXPORT const char * pw_properties_get | ( | const struct pw_properties * | properties, |
const char * | key | ||
) |
Get a property.
properties | a pw_properties |
key | a key |
Get the property in properties with key.
Referenced by pw_core::pw_core_new(), pw_device_register(), pw_pipewire::pw_fill_remote_properties(), pw_loop::pw_loop_new(), pw_node_register(), pw_remote_new(), and pw_stream_new().
SPA_EXPORT const char * pw_properties_iterate | ( | const struct pw_properties * | properties, |
void ** | state | ||
) |
Iterate property values.
properties | a pw_properties |
state | state |
Iterate over properties, returning each key in turn. state should point to a pointer holding NULL to get the first element and will be updated after each iteration. When NULL is returned, all elements have been iterated.
References pw_array::pw_array_check_index, and pw_array::pw_array_get_unchecked.
SPA_EXPORT struct pw_properties * pw_properties_new | ( | const char * | key, |
... | |||
) |
Make a new properties object.
key | a first key |
... | value and more keys NULL terminated |
Referenced by pw_client::pw_client_new(), pw_core::pw_core_new(), pw_device_new(), pw_device_register(), pw_factory_register(), pw_link_register(), pw_node_new(), pw_node_register(), pw_port_new(), pw_remote_new(), and pw_stream_new().
SPA_EXPORT struct pw_properties * pw_properties_new_dict | ( | const struct spa_dict * | dict | ) |
Make a new properties object from the given dictionary.
dict | a dictionary. keys and values are copied |
Referenced by pw_port_new(), and pw_properties_copy().
SPA_EXPORT struct pw_properties * pw_properties_new_string | ( | const char * | str | ) |
Make a new properties object from the given str.
str should be a whitespace separated list of key=value strings.
args | a property description |
SPA_EXPORT int pw_properties_set | ( | struct pw_properties * | properties, |
const char * | key, | ||
const char * | value | ||
) |
Set a property value.
properties | the properties to change |
key | a key |
value | a value or NULL to remove the key |
Set the property in properties with key to value. Any previous value of key will be overwritten. When value is NULL, the key will be removed.
Referenced by pw_core::pw_core_new(), pw_device_register(), pw_factory_register(), pw_pipewire::pw_fill_remote_properties(), pw_node_register(), pw_port_new(), pw_properties_update(), and pw_stream_new().
SPA_EXPORT int pw_properties_setf | ( | struct pw_properties * | properties, |
const char * | key, | ||
const char * | format, | ||
... | |||
) |
Set a property value by format.
properties | a pw_properties |
key | a key |
format | a value |
... | extra arguments |
Set the property in properties with key to the value in printf style format Any previous value of key will be overwritten.
References pw_properties_setva().
Referenced by pw_core::pw_core_new(), pw_factory_register(), pw_pipewire::pw_fill_remote_properties(), and pw_link_register().
SPA_EXPORT int pw_properties_update | ( | struct pw_properties * | props, |
const struct spa_dict * | dict | ||
) |
Update properties.
props | properties to update |
dict | new properties |
The properties in props are updated with dict. Keys in dict with NULL values are removed from props.
References pw_properties_set().
Referenced by pw_client::pw_client_update_properties(), pw_core::pw_core_update_properties(), pw_module_update_properties(), pw_remote_update_properties(), and pw_stream_update_properties().
struct spa_dict pw_properties::dict |
dictionary of key/values
Referenced by pw_core::pw_core_new(), pw_device_new(), pw_factory_new(), pw_loop::pw_loop_new(), pw_port_new(), pw_properties_copy(), and pw_remote_update_properties().
uint32_t pw_properties::flags |
extra flags