mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 06:38:01 +02:00
lib: properties: add update() and copy_from_dict() API
This commit is contained in:
parent
7608ae37b5
commit
ff59fc06db
2 changed files with 21 additions and 0 deletions
|
|
@ -143,6 +143,12 @@ wp_properties_new_copy_dict (const struct spa_dict * dict)
|
|||
return self;
|
||||
}
|
||||
|
||||
WpProperties *
|
||||
wp_properties_copy (WpProperties * other)
|
||||
{
|
||||
return wp_properties_new_copy_dict (wp_properties_peek_dict (other));
|
||||
}
|
||||
|
||||
static void
|
||||
wp_properties_free (WpProperties * self)
|
||||
{
|
||||
|
|
@ -162,6 +168,16 @@ wp_properties_unref (WpProperties * self)
|
|||
g_rc_box_release_full (self, (GDestroyNotify) wp_properties_free);
|
||||
}
|
||||
|
||||
gint
|
||||
wp_properties_update_from_dict (WpProperties * self,
|
||||
const struct spa_dict * dict)
|
||||
{
|
||||
g_return_val_if_fail (self != NULL, -EINVAL);
|
||||
g_return_val_if_fail (!(self->flags & FLAG_IS_DICT), -EINVAL);
|
||||
|
||||
return pw_properties_update (self->props, dict);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
wp_properties_get (WpProperties * self, const gchar * key)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,9 +33,14 @@ WpProperties * wp_properties_new_copy (const struct pw_properties * props);
|
|||
WpProperties * wp_properties_new_wrap_dict (const struct spa_dict * dict);
|
||||
WpProperties * wp_properties_new_copy_dict (const struct spa_dict * dict);
|
||||
|
||||
WpProperties * wp_properties_copy (WpProperties * other);
|
||||
|
||||
WpProperties * wp_properties_ref (WpProperties * self);
|
||||
void wp_properties_unref (WpProperties * self);
|
||||
|
||||
gint wp_properties_update_from_dict (WpProperties * self,
|
||||
const struct spa_dict * dict);
|
||||
|
||||
const gchar * wp_properties_get (WpProperties * self, const gchar * key);
|
||||
|
||||
gint wp_properties_set (WpProperties * self, const gchar * key,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue