mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-09 05:08:04 +02:00
properties: Add API to clear all properties
This is useful if we want to clear all properties without destroying the instance.
This commit is contained in:
parent
7fa44ef8d0
commit
9d8d0e2ae0
2 changed files with 19 additions and 0 deletions
|
|
@ -440,6 +440,22 @@ wp_properties_update_from_json (WpProperties * self, const WpSpaJson * json)
|
|||
wp_spa_json_get_size (json));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Clears all properties from \a self.
|
||||
*
|
||||
* \ingroup wpproperties
|
||||
* \param self a properties object
|
||||
*/
|
||||
void
|
||||
wp_properties_clear (WpProperties *self)
|
||||
{
|
||||
g_return_if_fail (self != NULL);
|
||||
g_return_if_fail (!(self->flags & FLAG_IS_DICT));
|
||||
g_return_if_fail (!(self->flags & FLAG_NO_OWNERSHIP));
|
||||
|
||||
pw_properties_clear (self->props);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds new properties in \a self, using the given \a props as a source.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ gint wp_properties_update_from_dict (WpProperties * self,
|
|||
WP_API
|
||||
gint wp_properties_update_from_json (WpProperties * self, const WpSpaJson * json);
|
||||
|
||||
WP_API
|
||||
void wp_properties_clear (WpProperties *self);
|
||||
|
||||
/* add */
|
||||
|
||||
WP_API
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue