spa-pod: add _fixate() method

This commit is contained in:
George Kiagiadakis 2021-10-08 18:20:52 +03:00
parent f7a6aaab61
commit 9e5aaccab0
2 changed files with 21 additions and 0 deletions

View file

@ -1793,6 +1793,24 @@ wp_spa_pod_get_array_child (WpSpaPod *self)
return wp_spa_pod_new_wrap (SPA_POD_ARRAY_CHILD (self->pod));
}
/*!
* \brief Fixates choices in an object pod so that they only have one value
*
* \ingroup wpspapod
* \param self a spa pod
* \returns TRUE if the pod was an object and it went through the fixation
* procedure, FALSE otherwise
*/
gboolean
wp_spa_pod_fixate (WpSpaPod *self)
{
g_return_val_if_fail (self, FALSE);
if (wp_spa_pod_is_object (self))
return spa_pod_object_fixate ((struct spa_pod_object *) self->pod) == 0;
return FALSE;
}
/*!
* \brief Increases the reference count of a spa pod builder
*

View file

@ -286,6 +286,9 @@ WpSpaPod *wp_spa_pod_get_array_child (WpSpaPod *self);
WP_API
WpIterator *wp_spa_pod_new_iterator (WpSpaPod *pod);
WP_API
gboolean wp_spa_pod_fixate (WpSpaPod *self);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WpSpaPod, wp_spa_pod_unref)