mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-03 13:48:00 +02:00
spa-pod: rename wp_spa_pod_iterator_new to wp_spa_pod_iterate
This commit is contained in:
parent
288f1f091b
commit
17ee195902
5 changed files with 19 additions and 19 deletions
|
|
@ -3003,7 +3003,7 @@ wp_spa_pod_iterator_finalize (WpIterator *iterator)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_spa_pod_iterator_new:
|
||||
* wp_spa_pod_iterate:
|
||||
* @pod: a spa pod object
|
||||
*
|
||||
* Creates a new iterator for a spa pod object. The @pod object must be valid
|
||||
|
|
@ -3012,7 +3012,7 @@ wp_spa_pod_iterator_finalize (WpIterator *iterator)
|
|||
* Returns: (transfer full): the new spa pod iterator
|
||||
*/
|
||||
WpIterator *
|
||||
wp_spa_pod_iterator_new (const WpSpaPod *pod)
|
||||
wp_spa_pod_iterate (const WpSpaPod *pod)
|
||||
{
|
||||
static const WpIteratorMethods methods = {
|
||||
.reset = wp_spa_pod_iterator_reset,
|
||||
|
|
|
|||
|
|
@ -278,6 +278,9 @@ WpSpaPod *wp_spa_pod_get_choice_child (WpSpaPod *self);
|
|||
WP_API
|
||||
WpSpaPod *wp_spa_pod_get_array_child (WpSpaPod *self);
|
||||
|
||||
WP_API
|
||||
WpIterator *wp_spa_pod_iterate (const WpSpaPod *pod);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WpSpaPod, wp_spa_pod_unref)
|
||||
|
||||
|
||||
|
|
@ -460,9 +463,6 @@ void wp_spa_pod_parser_end (WpSpaPodParser *self);
|
|||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WpSpaPodParser, wp_spa_pod_parser_unref)
|
||||
|
||||
|
||||
WP_API
|
||||
WpIterator *wp_spa_pod_iterator_new (const WpSpaPod *pod);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ wp_spa_props_store_from_props (WpSpaProps * self, const WpSpaPod * props,
|
|||
if (g_strcmp0 (wp_spa_pod_get_object_type_name (props), "Props") != 0)
|
||||
return FALSE;
|
||||
|
||||
it = wp_spa_pod_iterator_new (props);
|
||||
it = wp_spa_pod_iterate (props);
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
WpSpaPod *p = g_value_get_boxed (&next);
|
||||
const char *key_name = NULL;
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ select_format (WpSpaPod *value)
|
|||
|
||||
/* Enum */
|
||||
else if (g_strcmp0 ("Enum", choice_type_name) == 0) {
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
enum spa_audio_format *format_id = (enum spa_audio_format *)
|
||||
|
|
@ -250,7 +250,7 @@ select_rate (WpSpaPod *value)
|
|||
/* Enum */
|
||||
else if (g_strcmp0 ("Enum", choice_type_name) == 0) {
|
||||
/* pick the one closest to 48Khz */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
gint *rate = (gint *) g_value_get_pointer (&next);
|
||||
|
|
@ -266,7 +266,7 @@ select_rate (WpSpaPod *value)
|
|||
however, sometimes ALSA drivers give bad min & max values
|
||||
and pipewire picks a bad default... try to fix that here;
|
||||
the default should be the one closest to 48K */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
gint vals[3];
|
||||
gint i = 0, min, max;
|
||||
|
|
@ -305,7 +305,7 @@ select_channels (WpSpaPod *value, gint preference)
|
|||
/* Enum */
|
||||
else if (g_strcmp0 ("Enum", choice_type_name) == 0) {
|
||||
/* choose the most channels */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
gint diff = SPA_AUDIO_MAX_CHANNELS;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
|
|
@ -323,7 +323,7 @@ select_channels (WpSpaPod *value, gint preference)
|
|||
/* a range is typically 3 items: default, min, max;
|
||||
we want the most channels, but let's not trust max
|
||||
to really be the max... ALSA drivers can be broken */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
gint vals[3];
|
||||
gint i = 0;
|
||||
|
|
@ -375,7 +375,7 @@ choose_sensible_raw_audio_format (GPtrArray *formats,
|
|||
continue;
|
||||
|
||||
/* go through the fields and populate raw[i] */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
GValue next = G_VALUE_INIT;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
WpSpaPod *p = g_value_get_boxed (&next);
|
||||
|
|
@ -403,7 +403,7 @@ choose_sensible_raw_audio_format (GPtrArray *formats,
|
|||
/* just copy the array, there is no choice here */
|
||||
g_return_val_if_fail (wp_spa_pod_is_array (value), FALSE);
|
||||
SPA_FLAG_CLEAR (raw[i].flags, SPA_AUDIO_FLAG_UNPOSITIONED);
|
||||
g_autoptr (WpIterator) array_it = wp_spa_pod_iterator_new (value);
|
||||
g_autoptr (WpIterator) array_it = wp_spa_pod_iterate (value);
|
||||
GValue array_next = G_VALUE_INIT;
|
||||
guint j = 0;
|
||||
while (wp_iterator_next (array_it, &array_next)) {
|
||||
|
|
|
|||
|
|
@ -703,7 +703,7 @@ test_spa_pod_iterator (void)
|
|||
g_autoptr (WpSpaPod) pod = wp_spa_pod_builder_end (b);
|
||||
g_assert_nonnull (pod);
|
||||
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -752,7 +752,7 @@ test_spa_pod_iterator (void)
|
|||
g_autoptr (WpSpaPod) pod = wp_spa_pod_builder_end (b);
|
||||
g_assert_nonnull (pod);
|
||||
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -802,7 +802,7 @@ test_spa_pod_iterator (void)
|
|||
g_autoptr (WpSpaPod) pod = wp_spa_pod_builder_end (b);
|
||||
g_assert_nonnull (pod);
|
||||
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -855,7 +855,7 @@ test_spa_pod_iterator (void)
|
|||
g_autoptr (WpSpaPod) pod = wp_spa_pod_builder_end (b);
|
||||
g_assert_nonnull (pod);
|
||||
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -910,7 +910,7 @@ test_spa_pod_iterator (void)
|
|||
g_autoptr (WpSpaPod) pod = wp_spa_pod_builder_end (b);
|
||||
g_assert_nonnull (pod);
|
||||
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -979,7 +979,7 @@ test_spa_pod_unique_owner (void)
|
|||
GValue next = G_VALUE_INIT;
|
||||
g_autoptr (WpSpaPod) property = NULL;
|
||||
{
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterator_new (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_assert_nonnull (it);
|
||||
g_assert_true (wp_iterator_next (it, &next));
|
||||
property = g_value_dup_boxed (&next);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue