mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 18:18:15 +02:00
rename all foo_iterate APIs to foo_new_iterator
Avoids confusion with LUA iterate API
This commit is contained in:
parent
d0113e54cb
commit
dc2ad1f25d
36 changed files with 163 additions and 149 deletions
|
|
@ -401,7 +401,7 @@ wp_endpoint_get_n_streams (WpEndpoint * self)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_endpoint_iterate_streams:
|
||||
* wp_endpoint_new_streams_iterator:
|
||||
* @self: the endpoint
|
||||
*
|
||||
* Requires %WP_ENDPOINT_FEATURE_STREAMS
|
||||
|
|
@ -410,18 +410,18 @@ wp_endpoint_get_n_streams (WpEndpoint * self)
|
|||
* the endpoint streams that belong to this endpoint
|
||||
*/
|
||||
WpIterator *
|
||||
wp_endpoint_iterate_streams (WpEndpoint * self)
|
||||
wp_endpoint_new_streams_iterator (WpEndpoint * self)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_ENDPOINT (self), NULL);
|
||||
g_return_val_if_fail (wp_object_get_active_features (WP_OBJECT (self)) &
|
||||
WP_ENDPOINT_FEATURE_STREAMS, NULL);
|
||||
|
||||
WpEndpointPrivate *priv = wp_endpoint_get_instance_private (self);
|
||||
return wp_object_manager_iterate (priv->streams_om);
|
||||
return wp_object_manager_new_iterator (priv->streams_om);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_endpoint_iterate_streams_filtered:
|
||||
* wp_endpoint_new_streams_filtered_iterator:
|
||||
* @self: the endpoint
|
||||
* @...: a list of constraints, terminated by %NULL
|
||||
*
|
||||
|
|
@ -434,18 +434,18 @@ wp_endpoint_iterate_streams (WpEndpoint * self)
|
|||
* the streams that belong to this endpoint and match the constraints
|
||||
*/
|
||||
WpIterator *
|
||||
wp_endpoint_iterate_streams_filtered (WpEndpoint * self, ...)
|
||||
wp_endpoint_new_streams_filtered_iterator (WpEndpoint * self, ...)
|
||||
{
|
||||
WpObjectInterest *interest;
|
||||
va_list args;
|
||||
va_start (args, self);
|
||||
interest = wp_object_interest_new_valist (WP_TYPE_ENDPOINT_STREAM, &args);
|
||||
va_end (args);
|
||||
return wp_endpoint_iterate_streams_filtered_full (self, interest);
|
||||
return wp_endpoint_new_streams_filtered_iterator_full (self, interest);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_endpoint_iterate_streams_filtered_full: (rename-to wp_endpoint_iterate_streams_filtered)
|
||||
* wp_endpoint_new_streams_filtered_iterator_full: (rename-to wp_endpoint_new_streams_filtered_iterator)
|
||||
* @self: the endpoint
|
||||
* @interest: (transfer full): the interest
|
||||
*
|
||||
|
|
@ -455,7 +455,7 @@ wp_endpoint_iterate_streams_filtered (WpEndpoint * self, ...)
|
|||
* the streams that belong to this endpoint and match the @interest
|
||||
*/
|
||||
WpIterator *
|
||||
wp_endpoint_iterate_streams_filtered_full (WpEndpoint * self,
|
||||
wp_endpoint_new_streams_filtered_iterator_full (WpEndpoint * self,
|
||||
WpObjectInterest * interest)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_ENDPOINT (self), NULL);
|
||||
|
|
@ -463,7 +463,8 @@ wp_endpoint_iterate_streams_filtered_full (WpEndpoint * self,
|
|||
WP_ENDPOINT_FEATURE_STREAMS, NULL);
|
||||
|
||||
WpEndpointPrivate *priv = wp_endpoint_get_instance_private (self);
|
||||
return wp_object_manager_iterate_filtered_full (priv->streams_om, interest);
|
||||
return wp_object_manager_new_filtered_iterator_full (priv->streams_om,
|
||||
interest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ G_BEGIN_DECLS
|
|||
* WpEndpointFeatures:
|
||||
* @WP_ENDPOINT_FEATURE_STREAMS: caches information about streams, enabling
|
||||
* the use of wp_endpoint_get_n_streams(), wp_endpoint_lookup_stream(),
|
||||
* wp_endpoint_iterate_streams() and related methods
|
||||
* wp_endpoint_new_streams_iterator() and related methods
|
||||
*
|
||||
* An extension of #WpProxyFeatures
|
||||
*/
|
||||
|
|
@ -56,14 +56,14 @@ WP_API
|
|||
guint wp_endpoint_get_n_streams (WpEndpoint * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_endpoint_iterate_streams (WpEndpoint * self);
|
||||
WpIterator * wp_endpoint_new_streams_iterator (WpEndpoint * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_endpoint_iterate_streams_filtered (WpEndpoint * self, ...)
|
||||
WpIterator * wp_endpoint_new_streams_filtered_iterator (WpEndpoint * self, ...)
|
||||
G_GNUC_NULL_TERMINATED;
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_endpoint_iterate_streams_filtered_full (WpEndpoint * self,
|
||||
WpIterator * wp_endpoint_new_streams_filtered_iterator_full (WpEndpoint * self,
|
||||
WpObjectInterest * interest);
|
||||
|
||||
WP_API
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ static const WpIteratorMethods metadata_iterator_methods = {
|
|||
};
|
||||
|
||||
/**
|
||||
* wp_metadata_iterate:
|
||||
* wp_metadata_new_iterator:
|
||||
* @self: a metadata object
|
||||
* @subject: the metadata subject id, or %PW_ID_ANY
|
||||
*
|
||||
|
|
@ -380,7 +380,7 @@ static const WpIteratorMethods metadata_iterator_methods = {
|
|||
* this iterator.
|
||||
*/
|
||||
WpIterator *
|
||||
wp_metadata_iterate (WpMetadata * self, guint32 subject)
|
||||
wp_metadata_new_iterator (WpMetadata * self, guint32 subject)
|
||||
{
|
||||
WpMetadataPrivate *priv;
|
||||
g_autoptr (WpIterator) it = NULL;
|
||||
|
|
@ -442,7 +442,7 @@ wp_metadata_find (WpMetadata * self, guint32 subject, const gchar * key,
|
|||
{
|
||||
g_autoptr (WpIterator) it = NULL;
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
it = wp_metadata_iterate (self, subject);
|
||||
it = wp_metadata_new_iterator (self, subject);
|
||||
for (; wp_iterator_next (it, &val); g_value_unset (&val)) {
|
||||
const gchar *k = NULL, *t = NULL, *v = NULL;
|
||||
wp_metadata_iterator_item_extract (&val, NULL, &k, &t, &v);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ struct _WpMetadataClass
|
|||
};
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_metadata_iterate (WpMetadata * self, guint32 subject);
|
||||
WpIterator * wp_metadata_new_iterator (WpMetadata * self, guint32 subject);
|
||||
|
||||
WP_API
|
||||
void wp_metadata_iterator_item_extract (const GValue * item, guint32 * subject,
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ wp_node_get_n_ports (WpNode * self)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_node_iterate_ports:
|
||||
* wp_node_new_ports_iterator:
|
||||
* @self: the node
|
||||
*
|
||||
* Requires %WP_NODE_FEATURE_PORTS
|
||||
|
|
@ -397,17 +397,17 @@ wp_node_get_n_ports (WpNode * self)
|
|||
* the ports that belong to this node
|
||||
*/
|
||||
WpIterator *
|
||||
wp_node_iterate_ports (WpNode * self)
|
||||
wp_node_new_ports_iterator (WpNode * self)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_NODE (self), NULL);
|
||||
g_return_val_if_fail (wp_object_get_active_features (WP_OBJECT (self)) &
|
||||
WP_NODE_FEATURE_PORTS, NULL);
|
||||
|
||||
return wp_object_manager_iterate (self->ports_om);
|
||||
return wp_object_manager_new_iterator (self->ports_om);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_node_iterate_ports_filtered:
|
||||
* wp_node_new_ports_filtered_iterator:
|
||||
* @self: the node
|
||||
* @...: a list of constraints, terminated by %NULL
|
||||
*
|
||||
|
|
@ -420,18 +420,18 @@ wp_node_iterate_ports (WpNode * self)
|
|||
* the ports that belong to this node and match the constraints
|
||||
*/
|
||||
WpIterator *
|
||||
wp_node_iterate_ports_filtered (WpNode * self, ...)
|
||||
wp_node_new_ports_filtered_iterator (WpNode * self, ...)
|
||||
{
|
||||
WpObjectInterest *interest;
|
||||
va_list args;
|
||||
va_start (args, self);
|
||||
interest = wp_object_interest_new_valist (WP_TYPE_PORT, &args);
|
||||
va_end (args);
|
||||
return wp_node_iterate_ports_filtered_full (self, interest);
|
||||
return wp_node_new_ports_filtered_iterator_full (self, interest);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_node_iterate_ports_filtered_full: (rename-to wp_node_iterate_ports_filtered)
|
||||
* wp_node_new_ports_filtered_iterator_full: (rename-to wp_node_new_ports_filtered_iterator)
|
||||
* @self: the node
|
||||
* @interest: (transfer full): the interest
|
||||
*
|
||||
|
|
@ -441,13 +441,15 @@ wp_node_iterate_ports_filtered (WpNode * self, ...)
|
|||
* the ports that belong to this node and match the @interest
|
||||
*/
|
||||
WpIterator *
|
||||
wp_node_iterate_ports_filtered_full (WpNode * self, WpObjectInterest * interest)
|
||||
wp_node_new_ports_filtered_iterator_full (WpNode * self,
|
||||
WpObjectInterest * interest)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_NODE (self), NULL);
|
||||
g_return_val_if_fail (wp_object_get_active_features (WP_OBJECT (self)) &
|
||||
WP_NODE_FEATURE_PORTS, NULL);
|
||||
|
||||
return wp_object_manager_iterate_filtered_full (self->ports_om, interest);
|
||||
return wp_object_manager_new_filtered_iterator_full (self->ports_om,
|
||||
interest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ typedef enum {
|
|||
* WpNodeFeatures:
|
||||
* @WP_NODE_FEATURE_PORTS: caches information about ports, enabling
|
||||
* the use of wp_node_get_n_ports(), wp_node_lookup_port(),
|
||||
* wp_node_iterate_ports() and related methods
|
||||
* wp_node_new_ports_iterator() and related methods
|
||||
*
|
||||
* An extension of #WpProxyFeatures
|
||||
*/
|
||||
|
|
@ -72,14 +72,14 @@ WP_API
|
|||
guint wp_node_get_n_ports (WpNode * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_node_iterate_ports (WpNode * self);
|
||||
WpIterator * wp_node_new_ports_iterator (WpNode * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_node_iterate_ports_filtered (WpNode * self, ...)
|
||||
WpIterator * wp_node_new_ports_filtered_iterator (WpNode * self, ...)
|
||||
G_GNUC_NULL_TERMINATED;
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_node_iterate_ports_filtered_full (WpNode * self,
|
||||
WpIterator * wp_node_new_ports_filtered_iterator_full (WpNode * self,
|
||||
WpObjectInterest * interest);
|
||||
|
||||
WP_API
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* Upon installing a #WpObjectManager on a #WpCore, any pre-existing objects
|
||||
* that match the interests of this #WpObjectManager will immediately become
|
||||
* available to get through wp_object_manager_iterate() and the
|
||||
* available to get through wp_object_manager_new_iterator() and the
|
||||
* #WpObjectManager::object-added signal will be emitted for all of them.
|
||||
*/
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ wp_object_manager_class_init (WpObjectManagerClass * klass)
|
|||
* from this object manager. This signal is useful to get notified only once
|
||||
* when multiple changes happen in a short timespan. The receiving callback
|
||||
* may retrieve the updated list of objects by calling
|
||||
* wp_object_manager_iterate()
|
||||
* wp_object_manager_new_iterator()
|
||||
*/
|
||||
signals[SIGNAL_OBJECTS_CHANGED] = g_signal_new (
|
||||
"objects-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
|
||||
|
|
@ -406,14 +406,14 @@ static const WpIteratorMethods om_iterator_methods = {
|
|||
};
|
||||
|
||||
/**
|
||||
* wp_object_manager_iterate:
|
||||
* wp_object_manager_new_iterator:
|
||||
* @self: the object manager
|
||||
*
|
||||
* Returns: (transfer full): a #WpIterator that iterates over all the managed
|
||||
* objects of this object manager
|
||||
*/
|
||||
WpIterator *
|
||||
wp_object_manager_iterate (WpObjectManager * self)
|
||||
wp_object_manager_new_iterator (WpObjectManager * self)
|
||||
{
|
||||
WpIterator *it;
|
||||
struct om_iterator_data *it_data;
|
||||
|
|
@ -428,7 +428,7 @@ wp_object_manager_iterate (WpObjectManager * self)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_object_manager_iterate_filtered:
|
||||
* wp_object_manager_new_filtered_iterator:
|
||||
* @self: the object manager
|
||||
* @gtype: the #GType of the objects to iterate through
|
||||
* @...: a list of constraints, terminated by %NULL
|
||||
|
|
@ -436,7 +436,7 @@ wp_object_manager_iterate (WpObjectManager * self)
|
|||
* Equivalent to:
|
||||
* |[
|
||||
* WpObjectInterest *i = wp_object_interest_new (gtype, ...);
|
||||
* return wp_object_manager_iterate_filtered_full (self, i);
|
||||
* return wp_object_manager_new_filtered_iterator_full (self, i);
|
||||
* ]|
|
||||
*
|
||||
* The constraints specified in the variable arguments must follow the rules
|
||||
|
|
@ -446,7 +446,8 @@ wp_object_manager_iterate (WpObjectManager * self)
|
|||
* objects of this object manager
|
||||
*/
|
||||
WpIterator *
|
||||
wp_object_manager_iterate_filtered (WpObjectManager * self, GType gtype, ...)
|
||||
wp_object_manager_new_filtered_iterator (WpObjectManager * self, GType gtype,
|
||||
...)
|
||||
{
|
||||
WpObjectInterest *interest;
|
||||
va_list args;
|
||||
|
|
@ -457,11 +458,11 @@ wp_object_manager_iterate_filtered (WpObjectManager * self, GType gtype, ...)
|
|||
interest = wp_object_interest_new_valist (gtype, &args);
|
||||
va_end (args);
|
||||
|
||||
return wp_object_manager_iterate_filtered_full (self, interest);
|
||||
return wp_object_manager_new_filtered_iterator_full (self, interest);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_object_manager_iterate_filtered_full: (rename-to wp_object_manager_iterate_filtered)
|
||||
* wp_object_manager_new_filtered_iterator_full: (rename-to wp_object_manager_new_filtered_iterator)
|
||||
* @self: the object manager
|
||||
* @interest: (transfer full): the interest
|
||||
*
|
||||
|
|
@ -472,7 +473,7 @@ wp_object_manager_iterate_filtered (WpObjectManager * self, GType gtype, ...)
|
|||
* objects of this object manager
|
||||
*/
|
||||
WpIterator *
|
||||
wp_object_manager_iterate_filtered_full (WpObjectManager * self,
|
||||
wp_object_manager_new_filtered_iterator_full (WpObjectManager * self,
|
||||
WpObjectInterest * interest)
|
||||
{
|
||||
WpIterator *it;
|
||||
|
|
@ -537,7 +538,7 @@ wp_object_manager_lookup (WpObjectManager * self, GType gtype, ...)
|
|||
* Searches for an object that matches the specified @interest and returns
|
||||
* it, if found. If more than one objects match, only the first one is returned.
|
||||
* To find multiple objects that match certain criteria,
|
||||
* wp_object_manager_iterate_filtered() is more suitable.
|
||||
* wp_object_manager_new_filtered_iterator() is more suitable.
|
||||
*
|
||||
* Returns: (type GObject)(transfer full)(nullable): the first managed object
|
||||
* that matches the lookup interest, or %NULL if no object matches
|
||||
|
|
@ -548,7 +549,7 @@ wp_object_manager_lookup_full (WpObjectManager * self,
|
|||
{
|
||||
g_auto (GValue) ret = G_VALUE_INIT;
|
||||
g_autoptr (WpIterator) it =
|
||||
wp_object_manager_iterate_filtered_full (self, interest);
|
||||
wp_object_manager_new_filtered_iterator_full (self, interest);
|
||||
|
||||
if (wp_iterator_next (it, &ret))
|
||||
return g_value_dup_object (&ret);
|
||||
|
|
|
|||
|
|
@ -55,15 +55,15 @@ WP_API
|
|||
guint wp_object_manager_get_n_objects (WpObjectManager * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_object_manager_iterate (WpObjectManager * self);
|
||||
WpIterator * wp_object_manager_new_iterator (WpObjectManager * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_object_manager_iterate_filtered (WpObjectManager * self,
|
||||
WpIterator * wp_object_manager_new_filtered_iterator (WpObjectManager * self,
|
||||
GType gtype, ...);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_object_manager_iterate_filtered_full (WpObjectManager * self,
|
||||
WpObjectInterest * interest);
|
||||
WpIterator * wp_object_manager_new_filtered_iterator_full (
|
||||
WpObjectManager * self, WpObjectInterest * interest);
|
||||
|
||||
WP_API
|
||||
gpointer wp_object_manager_lookup (WpObjectManager * self,
|
||||
|
|
|
|||
|
|
@ -793,7 +793,7 @@ static const WpIteratorMethods dict_iterator_methods = {
|
|||
};
|
||||
|
||||
/**
|
||||
* wp_properties_iterate:
|
||||
* wp_properties_new_iterator:
|
||||
* @self: a properties object
|
||||
*
|
||||
* Returns: (transfer full): an iterator that iterates over the properties.
|
||||
|
|
@ -802,7 +802,7 @@ static const WpIteratorMethods dict_iterator_methods = {
|
|||
* this iterator.
|
||||
*/
|
||||
WpIterator *
|
||||
wp_properties_iterate (WpProperties * self)
|
||||
wp_properties_new_iterator (WpProperties * self)
|
||||
{
|
||||
g_autoptr (WpIterator) it = NULL;
|
||||
struct dict_iterator_data *it_data;
|
||||
|
|
@ -820,7 +820,7 @@ wp_properties_iterate (WpProperties * self)
|
|||
/**
|
||||
* wp_properties_iterator_item_get_key:
|
||||
* @item: a #GValue that was returned from the #WpIterator of
|
||||
* wp_properties_iterate()
|
||||
* wp_properties_new_iterator()
|
||||
*
|
||||
* Returns: (transfer none): the property key of the @item
|
||||
*/
|
||||
|
|
@ -835,7 +835,7 @@ wp_properties_iterator_item_get_key (const GValue * item)
|
|||
/**
|
||||
* wp_properties_iterator_item_get_value:
|
||||
* @item: a #GValue that was returned from the #WpIterator of
|
||||
* wp_properties_iterate()
|
||||
* wp_properties_new_iterator()
|
||||
*
|
||||
* Returns: (transfer none): the property value of the @item
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ gint wp_properties_setf_valist (WpProperties * self, const gchar * key,
|
|||
/* iterate */
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_properties_iterate (WpProperties * self);
|
||||
WpIterator * wp_properties_new_iterator (WpProperties * self);
|
||||
|
||||
WP_API
|
||||
const gchar * wp_properties_iterator_item_get_key (const GValue * item);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ wp_pipewire_object_get_properties (WpPipewireObject * self)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_pipewire_object_iterate_properties:
|
||||
* wp_pipewire_object_new_properties_iterator:
|
||||
* @self: the pipewire object
|
||||
*
|
||||
* Requires %WP_PIPEWIRE_OBJECT_FEATURE_INFO
|
||||
|
|
@ -111,11 +111,11 @@ wp_pipewire_object_get_properties (WpPipewireObject * self)
|
|||
* this iterator.
|
||||
*/
|
||||
WpIterator *
|
||||
wp_pipewire_object_iterate_properties (WpPipewireObject * self)
|
||||
wp_pipewire_object_new_properties_iterator (WpPipewireObject * self)
|
||||
{
|
||||
g_autoptr (WpProperties) properties =
|
||||
wp_pipewire_object_get_properties (self);
|
||||
return properties ? wp_properties_iterate (properties) : NULL;
|
||||
return properties ? wp_properties_new_iterator (properties) : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ WP_API
|
|||
WpProperties * wp_pipewire_object_get_properties (WpPipewireObject * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_pipewire_object_iterate_properties (WpPipewireObject * self);
|
||||
WpIterator * wp_pipewire_object_new_properties_iterator (
|
||||
WpPipewireObject * self);
|
||||
|
||||
WP_API
|
||||
const gchar * wp_pipewire_object_get_property (WpPipewireObject * self,
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ wp_session_bin_iterator_finalize (WpIterator *iterator)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_session_bin_iterate:
|
||||
* wp_session_bin_new_iterator:
|
||||
* @self: the session bin
|
||||
* @item (transfer none): the session item to be removed
|
||||
*
|
||||
|
|
@ -179,7 +179,7 @@ wp_session_bin_iterator_finalize (WpIterator *iterator)
|
|||
* Returns (transfer full): The session bin iterator.
|
||||
*/
|
||||
WpIterator *
|
||||
wp_session_bin_iterate (WpSessionBin *self)
|
||||
wp_session_bin_new_iterator (WpSessionBin *self)
|
||||
{
|
||||
static const WpIteratorMethods methods = {
|
||||
.version = WP_ITERATOR_METHODS_VERSION,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ WP_API
|
|||
guint wp_session_bin_get_n_children (WpSessionBin *self);
|
||||
|
||||
WP_API
|
||||
WpIterator *wp_session_bin_iterate (WpSessionBin *self);
|
||||
WpIterator *wp_session_bin_new_iterator (WpSessionBin *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ wp_session_get_n_endpoints (WpSession * self)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_session_iterate_endpoints:
|
||||
* wp_session_new_endpoints_iterator:
|
||||
* @self: the session
|
||||
*
|
||||
* Requires %WP_SESSION_FEATURE_ENDPOINTS
|
||||
|
|
@ -360,18 +360,18 @@ wp_session_get_n_endpoints (WpSession * self)
|
|||
* the endpoints that belong to this session
|
||||
*/
|
||||
WpIterator *
|
||||
wp_session_iterate_endpoints (WpSession * self)
|
||||
wp_session_new_endpoints_iterator (WpSession * self)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_SESSION (self), NULL);
|
||||
g_return_val_if_fail (wp_object_get_active_features (WP_OBJECT (self)) &
|
||||
WP_SESSION_FEATURE_ENDPOINTS, NULL);
|
||||
|
||||
WpSessionPrivate *priv = wp_session_get_instance_private (self);
|
||||
return wp_object_manager_iterate (priv->endpoints_om);
|
||||
return wp_object_manager_new_iterator (priv->endpoints_om);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_session_iterate_endpoints_filtered:
|
||||
* wp_session_new_endpoints_filtered_iterator:
|
||||
* @self: the session
|
||||
* @...: a list of constraints, terminated by %NULL
|
||||
*
|
||||
|
|
@ -384,18 +384,18 @@ wp_session_iterate_endpoints (WpSession * self)
|
|||
* the endpoints that belong to this session and match the constraints
|
||||
*/
|
||||
WpIterator *
|
||||
wp_session_iterate_endpoints_filtered (WpSession * self, ...)
|
||||
wp_session_new_endpoints_filtered_iterator (WpSession * self, ...)
|
||||
{
|
||||
WpObjectInterest *interest;
|
||||
va_list args;
|
||||
va_start (args, self);
|
||||
interest = wp_object_interest_new_valist (WP_TYPE_ENDPOINT, &args);
|
||||
va_end (args);
|
||||
return wp_session_iterate_endpoints_filtered_full (self, interest);
|
||||
return wp_session_new_endpoints_filtered_iterator_full (self, interest);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_session_iterate_endpoints_filtered_full: (rename-to wp_session_iterate_endpoints_filtered)
|
||||
* wp_session_new_endpoints_filtered_iterator_full: (rename-to wp_session_new_endpoints_filtered_iterator)
|
||||
* @self: the session
|
||||
* @interest: (transfer full): the interest
|
||||
*
|
||||
|
|
@ -405,7 +405,7 @@ wp_session_iterate_endpoints_filtered (WpSession * self, ...)
|
|||
* the endpoints that belong to this session and match the @interest
|
||||
*/
|
||||
WpIterator *
|
||||
wp_session_iterate_endpoints_filtered_full (WpSession * self,
|
||||
wp_session_new_endpoints_filtered_iterator_full (WpSession * self,
|
||||
WpObjectInterest * interest)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_SESSION (self), NULL);
|
||||
|
|
@ -413,7 +413,8 @@ wp_session_iterate_endpoints_filtered_full (WpSession * self,
|
|||
WP_SESSION_FEATURE_ENDPOINTS, NULL);
|
||||
|
||||
WpSessionPrivate *priv = wp_session_get_instance_private (self);
|
||||
return wp_object_manager_iterate_filtered_full (priv->endpoints_om, interest);
|
||||
return wp_object_manager_new_filtered_iterator_full (priv->endpoints_om,
|
||||
interest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -482,7 +483,7 @@ wp_session_get_n_links (WpSession * self)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_session_iterate_links:
|
||||
* wp_session_new_links_iterator:
|
||||
* @self: the session
|
||||
*
|
||||
* Requires %WP_SESSION_FEATURE_LINKS
|
||||
|
|
@ -491,18 +492,18 @@ wp_session_get_n_links (WpSession * self)
|
|||
* the endpoint links that belong to this session
|
||||
*/
|
||||
WpIterator *
|
||||
wp_session_iterate_links (WpSession * self)
|
||||
wp_session_new_links_iterator (WpSession * self)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_SESSION (self), NULL);
|
||||
g_return_val_if_fail (wp_object_get_active_features (WP_OBJECT (self)) &
|
||||
WP_SESSION_FEATURE_LINKS, NULL);
|
||||
|
||||
WpSessionPrivate *priv = wp_session_get_instance_private (self);
|
||||
return wp_object_manager_iterate (priv->links_om);
|
||||
return wp_object_manager_new_iterator (priv->links_om);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_session_iterate_links_filtered:
|
||||
* wp_session_new_links_filtered_iterator:
|
||||
* @self: the session
|
||||
* @...: a list of constraints, terminated by %NULL
|
||||
*
|
||||
|
|
@ -515,18 +516,18 @@ wp_session_iterate_links (WpSession * self)
|
|||
* the links that belong to this session and match the constraints
|
||||
*/
|
||||
WpIterator *
|
||||
wp_session_iterate_links_filtered (WpSession * self, ...)
|
||||
wp_session_new_links_filtered_iterator (WpSession * self, ...)
|
||||
{
|
||||
WpObjectInterest *interest;
|
||||
va_list args;
|
||||
va_start (args, self);
|
||||
interest = wp_object_interest_new_valist (WP_TYPE_ENDPOINT_LINK, &args);
|
||||
va_end (args);
|
||||
return wp_session_iterate_links_filtered_full (self, interest);
|
||||
return wp_session_new_links_filtered_iterator_full (self, interest);
|
||||
}
|
||||
|
||||
/**
|
||||
* wp_session_iterate_links_filtered_full: (rename-to wp_session_iterate_links_filtered)
|
||||
* wp_session_new_links_filtered_iterator_full: (rename-to wp_session_new_links_filtered_iterator)
|
||||
* @self: the session
|
||||
* @interest: (transfer full): the interest
|
||||
*
|
||||
|
|
@ -536,7 +537,7 @@ wp_session_iterate_links_filtered (WpSession * self, ...)
|
|||
* the links that belong to this session and match the @interest
|
||||
*/
|
||||
WpIterator *
|
||||
wp_session_iterate_links_filtered_full (WpSession * self,
|
||||
wp_session_new_links_filtered_iterator_full (WpSession * self,
|
||||
WpObjectInterest * interest)
|
||||
{
|
||||
g_return_val_if_fail (WP_IS_SESSION (self), NULL);
|
||||
|
|
@ -544,7 +545,8 @@ wp_session_iterate_links_filtered_full (WpSession * self,
|
|||
WP_SESSION_FEATURE_LINKS, NULL);
|
||||
|
||||
WpSessionPrivate *priv = wp_session_get_instance_private (self);
|
||||
return wp_object_manager_iterate_filtered_full (priv->links_om, interest);
|
||||
return wp_object_manager_new_filtered_iterator_full (priv->links_om,
|
||||
interest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ G_BEGIN_DECLS
|
|||
* WpSessionFeatures:
|
||||
* @WP_SESSION_FEATURE_ENDPOINTS: caches information about endpoints, enabling
|
||||
* the use of wp_session_get_n_endpoints(), wp_session_lookup_endpoint(),
|
||||
* wp_session_iterate_endpoints() and related methods
|
||||
* wp_session_new_endpoints_iterator() and related methods
|
||||
* @WP_SESSION_FEATURE_LINKS: caches information about endpoint links, enabling
|
||||
* the use of wp_session_get_n_links(), wp_session_lookup_link(),
|
||||
* wp_session_iterate_links() and related methods
|
||||
* wp_session_new_links_iterator() and related methods
|
||||
*
|
||||
* An extension of #WpProxyFeatures
|
||||
*/
|
||||
|
|
@ -54,14 +54,14 @@ WP_API
|
|||
guint wp_session_get_n_endpoints (WpSession * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_session_iterate_endpoints (WpSession * self);
|
||||
WpIterator * wp_session_new_endpoints_iterator (WpSession * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_session_iterate_endpoints_filtered (WpSession * self, ...)
|
||||
WpIterator * wp_session_new_endpoints_filtered_iterator (WpSession * self, ...)
|
||||
G_GNUC_NULL_TERMINATED;
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_session_iterate_endpoints_filtered_full (WpSession * self,
|
||||
WpIterator * wp_session_new_endpoints_filtered_iterator_full (WpSession * self,
|
||||
WpObjectInterest * interest);
|
||||
|
||||
WP_API
|
||||
|
|
@ -78,14 +78,14 @@ WP_API
|
|||
guint wp_session_get_n_links (WpSession * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_session_iterate_links (WpSession * self);
|
||||
WpIterator * wp_session_new_links_iterator (WpSession * self);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_session_iterate_links_filtered (WpSession * self, ...)
|
||||
WpIterator * wp_session_new_links_filtered_iterator (WpSession * self, ...)
|
||||
G_GNUC_NULL_TERMINATED;
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_session_iterate_links_filtered_full (WpSession * self,
|
||||
WpIterator * wp_session_new_links_filtered_iterator_full (WpSession * self,
|
||||
WpObjectInterest * interest);
|
||||
|
||||
WP_API
|
||||
|
|
|
|||
|
|
@ -3063,7 +3063,7 @@ wp_spa_pod_iterator_finalize (WpIterator *iterator)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_spa_pod_iterate:
|
||||
* wp_spa_pod_new_iterator:
|
||||
* @pod: a spa pod object
|
||||
*
|
||||
* Creates a new iterator for a spa pod object.
|
||||
|
|
@ -3071,7 +3071,7 @@ wp_spa_pod_iterator_finalize (WpIterator *iterator)
|
|||
* Returns: (transfer full): the new spa pod iterator
|
||||
*/
|
||||
WpIterator *
|
||||
wp_spa_pod_iterate (WpSpaPod *pod)
|
||||
wp_spa_pod_new_iterator (WpSpaPod *pod)
|
||||
{
|
||||
static const WpIteratorMethods methods = {
|
||||
.version = WP_ITERATOR_METHODS_VERSION,
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ WP_API
|
|||
WpSpaPod *wp_spa_pod_get_array_child (WpSpaPod *self);
|
||||
|
||||
WP_API
|
||||
WpIterator *wp_spa_pod_iterate (WpSpaPod *pod);
|
||||
WpIterator *wp_spa_pod_new_iterator (WpSpaPod *pod);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WpSpaPod, wp_spa_pod_unref)
|
||||
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ wp_spa_id_table_from_name (const gchar *name)
|
|||
}
|
||||
|
||||
/**
|
||||
* wp_spa_id_table_iterate:
|
||||
* wp_spa_id_table_new_iterator:
|
||||
* @type: the id table
|
||||
*
|
||||
* This function returns an iterator that allows you to iterate through the
|
||||
|
|
@ -371,7 +371,7 @@ wp_spa_id_table_from_name (const gchar *name)
|
|||
* Returns: a #WpIterator that iterates over #WpSpaIdValue items
|
||||
*/
|
||||
WpIterator *
|
||||
wp_spa_id_table_iterate (WpSpaIdTable table)
|
||||
wp_spa_id_table_new_iterator (WpSpaIdTable table)
|
||||
{
|
||||
g_return_val_if_fail (table != NULL, NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ WP_API
|
|||
WpSpaIdTable wp_spa_id_table_from_name (const gchar *name);
|
||||
|
||||
WP_API
|
||||
WpIterator * wp_spa_id_table_iterate (WpSpaIdTable table);
|
||||
WpIterator * wp_spa_id_table_new_iterator (WpSpaIdTable table);
|
||||
|
||||
WP_API
|
||||
WpSpaIdValue wp_spa_id_table_find_value (WpSpaIdTable table, guint value);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ wp_state_save (WpState *self, const gchar *group, WpProperties *props)
|
|||
g_key_file_remove_group (self->keyfile, group, NULL);
|
||||
|
||||
/* Set the properties */
|
||||
for (it = wp_properties_iterate (props);
|
||||
for (it = wp_properties_new_iterator (props);
|
||||
wp_iterator_next (it, &item);
|
||||
g_value_unset (&item)) {
|
||||
const gchar *key = wp_properties_iterator_item_get_key (&item);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ wplua_properties_to_table (lua_State *L, WpProperties *p)
|
|||
{
|
||||
lua_newtable (L);
|
||||
if (p) {
|
||||
g_autoptr (WpIterator) it = wp_properties_iterate (p);
|
||||
g_autoptr (WpIterator) it = wp_properties_new_iterator (p);
|
||||
GValue v = G_VALUE_INIT;
|
||||
const gchar *key, *value;
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ find_endpoint_with_node_id (WpDefaultMetadata * self, guint node_id,
|
|||
g_autoptr (WpIterator) it = NULL;
|
||||
g_auto (GValue) value = G_VALUE_INIT;
|
||||
|
||||
it = wp_object_manager_iterate (self->sessions_om);
|
||||
it = wp_object_manager_new_iterator (self->sessions_om);
|
||||
for (; wp_iterator_next (it, &value); g_value_unset (&value)) {
|
||||
WpSession *s = g_value_get_object (&value);
|
||||
g_autoptr (WpEndpoint) ep = NULL;
|
||||
|
|
@ -192,7 +192,7 @@ find_highest_priority_endpoint (WpSession * session, WpDirection dir)
|
|||
gint highest_prio = 0;
|
||||
WpEndpoint *res = NULL;
|
||||
|
||||
it = wp_session_iterate_endpoints_filtered (session,
|
||||
it = wp_session_new_endpoints_filtered_iterator (session,
|
||||
WP_CONSTRAINT_TYPE_PW_PROPERTY, "media.class", "#s",
|
||||
(dir == WP_DIRECTION_INPUT) ? "*/Sink" : "*/Source",
|
||||
NULL);
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ static int
|
|||
object_manager_iterate (lua_State *L)
|
||||
{
|
||||
WpObjectManager *om = wplua_checkobject (L, 1, WP_TYPE_OBJECT_MANAGER);
|
||||
WpIterator *it = wp_object_manager_iterate (om);
|
||||
WpIterator *it = wp_object_manager_new_iterator (om);
|
||||
return push_wpiterator (L, it);
|
||||
}
|
||||
|
||||
|
|
@ -552,8 +552,8 @@ object_manager_iterate_filtered (lua_State *L)
|
|||
{
|
||||
WpObjectManager *om = wplua_checkobject (L, 1, WP_TYPE_OBJECT_MANAGER);
|
||||
WpObjectInterest *oi = wplua_checkboxed (L, 2, WP_TYPE_OBJECT_INTEREST);
|
||||
WpIterator *it =
|
||||
wp_object_manager_iterate_filtered_full (om, wp_object_interest_ref (oi));
|
||||
WpIterator *it = wp_object_manager_new_filtered_iterator_full (om,
|
||||
wp_object_interest_ref (oi));
|
||||
return push_wpiterator (L, it);
|
||||
}
|
||||
|
||||
|
|
@ -590,7 +590,7 @@ metadata_iterate (lua_State *L)
|
|||
{
|
||||
WpMetadata *metadata = wplua_checkobject (L, 1, WP_TYPE_METADATA);
|
||||
lua_Integer subject = luaL_checkinteger (L, 2);
|
||||
g_autoptr (WpIterator) it = wp_metadata_iterate (metadata, subject);
|
||||
g_autoptr (WpIterator) it = wp_metadata_new_iterator (metadata, subject);
|
||||
return push_metadata_wpiterator (L, it);
|
||||
}
|
||||
|
||||
|
|
@ -618,7 +618,7 @@ static int
|
|||
session_iterate_endpoints (lua_State *L)
|
||||
{
|
||||
WpSession *session = wplua_checkobject (L, 1, WP_TYPE_SESSION);
|
||||
WpIterator *it = wp_session_iterate_endpoints (session);
|
||||
WpIterator *it = wp_session_new_endpoints_iterator (session);
|
||||
return push_wpiterator (L, it);
|
||||
}
|
||||
|
||||
|
|
@ -626,7 +626,7 @@ static int
|
|||
session_iterate_links (lua_State *L)
|
||||
{
|
||||
WpSession *session = wplua_checkobject (L, 1, WP_TYPE_SESSION);
|
||||
WpIterator *it = wp_session_iterate_links (session);
|
||||
WpIterator *it = wp_session_new_links_iterator (session);
|
||||
return push_wpiterator (L, it);
|
||||
}
|
||||
|
||||
|
|
@ -667,7 +667,7 @@ static int
|
|||
endpoint_iterate_streams (lua_State *L)
|
||||
{
|
||||
WpEndpoint *ep = wplua_checkobject (L, 1, WP_TYPE_ENDPOINT);
|
||||
WpIterator *it = wp_endpoint_iterate_streams (ep);
|
||||
WpIterator *it = wp_endpoint_new_streams_iterator (ep);
|
||||
return push_wpiterator (L, it);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -783,7 +783,7 @@ push_primitive_values (lua_State *L, WpSpaPod *pod, const gchar* type_name,
|
|||
guint start_index)
|
||||
{
|
||||
g_auto (GValue) item = G_VALUE_INIT;
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
for (; wp_iterator_next (it, &item); g_value_unset (&item)) {
|
||||
gpointer p = g_value_get_pointer (&item);
|
||||
if (!p || !type_name)
|
||||
|
|
@ -928,7 +928,7 @@ push_luapod (lua_State *L, WpSpaPod *pod)
|
|||
lua_rawseti (L, -2, 0);
|
||||
lua_pushstring (L, id_name);
|
||||
lua_rawseti (L, -2, 1);
|
||||
it = wp_spa_pod_iterate (pod);
|
||||
it = wp_spa_pod_new_iterator (pod);
|
||||
for (; wp_iterator_next (it, &item); g_value_unset (&item)) {
|
||||
WpSpaPod *prop = g_value_get_boxed (&item);
|
||||
const gchar *key = NULL;
|
||||
|
|
@ -942,7 +942,7 @@ push_luapod (lua_State *L, WpSpaPod *pod)
|
|||
/* Struct */
|
||||
else if (wp_spa_pod_is_struct (pod)) {
|
||||
g_auto (GValue) item = G_VALUE_INIT;
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
guint i = 0;
|
||||
lua_newtable (L);
|
||||
for (; wp_iterator_next (it, &item); g_value_unset (&item)) {
|
||||
|
|
@ -955,7 +955,7 @@ push_luapod (lua_State *L, WpSpaPod *pod)
|
|||
/* Sequence */
|
||||
else if (wp_spa_pod_is_sequence (pod)) {
|
||||
g_auto (GValue) item = G_VALUE_INIT;
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
guint i = 0;
|
||||
lua_newtable (L);
|
||||
for (; wp_iterator_next (it, &item); g_value_unset (&item)) {
|
||||
|
|
|
|||
|
|
@ -517,7 +517,7 @@ si_adapter_get_ports (WpSiPortInfo * item, const gchar * context)
|
|||
g_variant_builder_init (&b, G_VARIANT_TYPE ("a(uuu)"));
|
||||
node_id = wp_proxy_get_bound_id (WP_PROXY (self->node));
|
||||
|
||||
for (it = wp_node_iterate_ports (self->node);
|
||||
for (it = wp_node_new_ports_iterator (self->node);
|
||||
wp_iterator_next (it, &val);
|
||||
g_value_unset (&val))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ select_format (WpSpaPod *value)
|
|||
|
||||
/* Enum */
|
||||
else if (choice_type == SPA_CHOICE_Enum) {
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
enum spa_audio_format *format_id = (enum spa_audio_format *)
|
||||
|
|
@ -138,7 +138,7 @@ select_rate (WpSpaPod *value)
|
|||
/* Enum */
|
||||
else if (choice_type == SPA_CHOICE_Enum) {
|
||||
/* pick the one closest to 48Khz */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
gint *rate = (gint *) g_value_get_pointer (&next);
|
||||
|
|
@ -154,7 +154,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_iterate (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
gint vals[3];
|
||||
gint i = 0, min, max;
|
||||
|
|
@ -194,7 +194,7 @@ select_channels (WpSpaPod *value, gint preference)
|
|||
/* Enum */
|
||||
else if (choice_type == SPA_CHOICE_Enum) {
|
||||
/* choose the most channels */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
gint diff = SPA_AUDIO_MAX_CHANNELS;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
|
|
@ -212,7 +212,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_iterate (value);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (value);
|
||||
GValue next = G_VALUE_INIT;
|
||||
gint vals[3];
|
||||
gint i = 0;
|
||||
|
|
@ -262,7 +262,7 @@ choose_sensible_raw_audio_format (WpIterator *formats,
|
|||
continue;
|
||||
|
||||
/* go through the fields and populate raw */
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
GValue next = G_VALUE_INIT;
|
||||
while (wp_iterator_next (it, &next)) {
|
||||
WpSpaPod *p = g_value_get_boxed (&next);
|
||||
|
|
@ -290,7 +290,7 @@ choose_sensible_raw_audio_format (WpIterator *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.flags, SPA_AUDIO_FLAG_UNPOSITIONED);
|
||||
g_autoptr (WpIterator) array_it = wp_spa_pod_iterate (value);
|
||||
g_autoptr (WpIterator) array_it = wp_spa_pod_new_iterator (value);
|
||||
GValue array_next = G_VALUE_INIT;
|
||||
guint j = 0;
|
||||
while (wp_iterator_next (array_it, &array_next)) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ static WpSiStream *
|
|||
si_audio_softdsp_endpoint_get_stream (WpSiEndpoint * item, guint index)
|
||||
{
|
||||
WpSiAudioSoftdspEndpoint *self = WP_SI_AUDIO_SOFTDSP_ENDPOINT (item);
|
||||
g_autoptr (WpIterator) it = wp_session_bin_iterate (WP_SESSION_BIN (self));
|
||||
g_autoptr (WpIterator) it =
|
||||
wp_session_bin_new_iterator (WP_SESSION_BIN (self));
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
|
||||
if (wp_session_bin_get_n_children (WP_SESSION_BIN (item)) == 1)
|
||||
|
|
@ -243,7 +244,8 @@ si_audio_softdsp_endpoint_activate_execute_step (WpSessionItem * item,
|
|||
|
||||
case STEP_ACTIVATE_STREAMS:
|
||||
{
|
||||
g_autoptr (WpIterator) it = wp_session_bin_iterate (WP_SESSION_BIN (self));
|
||||
g_autoptr (WpIterator) it =
|
||||
wp_session_bin_new_iterator (WP_SESSION_BIN (self));
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
for (; wp_iterator_next (it, &val); g_value_unset (&val)) {
|
||||
WpSessionItem *item = g_value_get_object (&val);
|
||||
|
|
@ -264,7 +266,8 @@ static void
|
|||
si_audio_softdsp_endpoint_activate_rollback (WpSessionItem * item)
|
||||
{
|
||||
WpSiAudioSoftdspEndpoint *self = WP_SI_AUDIO_SOFTDSP_ENDPOINT (item);
|
||||
g_autoptr (WpIterator) it = wp_session_bin_iterate (WP_SESSION_BIN (self));
|
||||
g_autoptr (WpIterator) it =
|
||||
wp_session_bin_new_iterator (WP_SESSION_BIN (self));
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
|
||||
/* deactivate all items */
|
||||
|
|
|
|||
|
|
@ -349,7 +349,8 @@ static void
|
|||
si_bluez5_endpoint_activate_rollback (WpSessionItem * item)
|
||||
{
|
||||
WpSiBluez5Endpoint *self = WP_SI_BLUEZ5_ENDPOINT (item);
|
||||
g_autoptr (WpIterator) it = wp_session_bin_iterate (WP_SESSION_BIN (self));
|
||||
g_autoptr (WpIterator) it =
|
||||
wp_session_bin_new_iterator (WP_SESSION_BIN (self));
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
|
||||
/* deactivate all items */
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ si_convert_activate_execute_step (WpSessionItem * item,
|
|||
core = wp_object_get_core (WP_OBJECT (self->node));
|
||||
|
||||
/* get a list of our ports */
|
||||
for (it = wp_node_iterate_ports (self->node);
|
||||
for (it = wp_node_new_ports_iterator (self->node);
|
||||
wp_iterator_next (it, &val);
|
||||
g_value_unset (&val))
|
||||
{
|
||||
|
|
@ -444,7 +444,7 @@ si_convert_get_ports (WpSiPortInfo * item, const gchar * context)
|
|||
g_variant_builder_init (&b, G_VARIANT_TYPE ("a(uuu)"));
|
||||
node_id = wp_proxy_get_bound_id (WP_PROXY (self->node));
|
||||
|
||||
for (it = wp_node_iterate_ports (self->node);
|
||||
for (it = wp_node_new_ports_iterator (self->node);
|
||||
wp_iterator_next (it, &val);
|
||||
g_value_unset (&val))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ si_simple_node_endpoint_get_ports (WpSiPortInfo * item, const gchar * context)
|
|||
g_variant_builder_init (&b, G_VARIANT_TYPE ("a(uuu)"));
|
||||
node_id = wp_proxy_get_bound_id (WP_PROXY (self->node));
|
||||
|
||||
for (it = wp_node_iterate_ports (self->node);
|
||||
for (it = wp_node_new_ports_iterator (self->node);
|
||||
wp_iterator_next (it, &val);
|
||||
g_value_unset (&val))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ test_si_simple_node_endpoint_configure_activate (TestFixture * f,
|
|||
g_assert_cmpuint (channel, ==, 0);
|
||||
|
||||
{
|
||||
g_autoptr (WpIterator) it = wp_node_iterate_ports (node);
|
||||
g_autoptr (WpIterator) it = wp_node_new_ports_iterator (node);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
WpProxy *port;
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ test_metadata_basic (TestFixture *fixture, gconstpointer data)
|
|||
|
||||
/* verify properties are set before export */
|
||||
{
|
||||
g_autoptr (WpIterator) iter = wp_metadata_iterate (metadata, PW_ID_ANY);
|
||||
g_autoptr (WpIterator) iter = wp_metadata_new_iterator (metadata, PW_ID_ANY);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
guint subject = -1;
|
||||
const gchar *key = NULL, *type = NULL, *value = NULL;
|
||||
|
|
@ -200,7 +200,7 @@ test_metadata_basic (TestFixture *fixture, gconstpointer data)
|
|||
/* test round 1: verify the values on the proxy */
|
||||
{
|
||||
g_autoptr (WpIterator) iter =
|
||||
wp_metadata_iterate (fixture->proxy_metadata, PW_ID_ANY);
|
||||
wp_metadata_new_iterator (fixture->proxy_metadata, PW_ID_ANY);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
guint subject = -1;
|
||||
const gchar *key = NULL, *type = NULL, *value = NULL;
|
||||
|
|
@ -242,7 +242,7 @@ test_metadata_basic (TestFixture *fixture, gconstpointer data)
|
|||
/* test round 2: verify the value change on both sides */
|
||||
{
|
||||
g_autoptr (WpIterator) iter =
|
||||
wp_metadata_iterate (fixture->proxy_metadata, PW_ID_ANY);
|
||||
wp_metadata_new_iterator (fixture->proxy_metadata, PW_ID_ANY);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
guint subject = -1;
|
||||
const gchar *key = NULL, *type = NULL, *value = NULL;
|
||||
|
|
@ -274,7 +274,8 @@ test_metadata_basic (TestFixture *fixture, gconstpointer data)
|
|||
g_assert_false (wp_iterator_next (iter, &val));
|
||||
}
|
||||
{
|
||||
g_autoptr (WpIterator) iter = wp_metadata_iterate (metadata, PW_ID_ANY);
|
||||
g_autoptr (WpIterator) iter =
|
||||
wp_metadata_new_iterator (metadata, PW_ID_ANY);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
guint subject = -1;
|
||||
const gchar *key = NULL, *type = NULL, *value = NULL;
|
||||
|
|
@ -318,7 +319,7 @@ test_metadata_basic (TestFixture *fixture, gconstpointer data)
|
|||
/* test round 3: verify the value change on both sides */
|
||||
{
|
||||
g_autoptr (WpIterator) iter =
|
||||
wp_metadata_iterate (fixture->proxy_metadata, PW_ID_ANY);
|
||||
wp_metadata_new_iterator (fixture->proxy_metadata, PW_ID_ANY);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
guint subject = -1;
|
||||
const gchar *key = NULL, *type = NULL, *value = NULL;
|
||||
|
|
@ -358,7 +359,8 @@ test_metadata_basic (TestFixture *fixture, gconstpointer data)
|
|||
g_assert_false (wp_iterator_next (iter, &val));
|
||||
}
|
||||
{
|
||||
g_autoptr (WpIterator) iter = wp_metadata_iterate (metadata, PW_ID_ANY);
|
||||
g_autoptr (WpIterator) iter =
|
||||
wp_metadata_new_iterator (metadata, PW_ID_ANY);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
guint subject = -1;
|
||||
const gchar *key = NULL, *type = NULL, *value = NULL;
|
||||
|
|
@ -400,7 +402,7 @@ test_metadata_basic (TestFixture *fixture, gconstpointer data)
|
|||
|
||||
/* find with constraints */
|
||||
{
|
||||
g_autoptr (WpIterator) iter = wp_metadata_iterate (metadata, 0);
|
||||
g_autoptr (WpIterator) iter = wp_metadata_new_iterator (metadata, 0);
|
||||
g_auto (GValue) val = G_VALUE_INIT;
|
||||
guint subject = -1;
|
||||
const gchar *key = NULL, *type = NULL, *value = NULL;
|
||||
|
|
|
|||
|
|
@ -690,7 +690,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_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -739,7 +739,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_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -789,7 +789,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_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -842,7 +842,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_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -897,7 +897,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_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
g_assert_nonnull (it);
|
||||
|
||||
{
|
||||
|
|
@ -962,7 +962,7 @@ test_spa_pod_unique_owner (void)
|
|||
GValue next = G_VALUE_INIT;
|
||||
g_autoptr (WpSpaPod) property = NULL;
|
||||
{
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_iterate (pod);
|
||||
g_autoptr (WpIterator) it = wp_spa_pod_new_iterator (pod);
|
||||
g_assert_nonnull (it);
|
||||
g_assert_true (wp_iterator_next (it, &next));
|
||||
property = g_value_dup_boxed (&next);
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ test_spa_type_iterate (void)
|
|||
g_assert_true (wp_spa_type_is_object (type));
|
||||
|
||||
WpSpaIdTable table = wp_spa_type_get_values_table (type);
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_iterate (table);
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_new_iterator (table);
|
||||
g_auto (GValue) value = G_VALUE_INIT;
|
||||
WpSpaIdValue id = NULL;
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ test_spa_type_iterate (void)
|
|||
WpSpaIdTable table = wp_spa_id_table_from_name ("Spa:Enum:Choice");
|
||||
g_assert_nonnull (table);
|
||||
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_iterate (table);
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_new_iterator (table);
|
||||
g_auto (GValue) value = G_VALUE_INIT;
|
||||
WpSpaIdValue id = NULL;
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ test_spa_type_register (void)
|
|||
wp_spa_id_table_from_name ("Spa:Enum:CustomEnum"));
|
||||
|
||||
{
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_iterate (enum_table);
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_new_iterator (enum_table);
|
||||
g_auto (GValue) value = G_VALUE_INIT;
|
||||
WpSpaIdValue id = NULL;
|
||||
|
||||
|
|
@ -325,7 +325,7 @@ test_spa_type_register (void)
|
|||
|
||||
{
|
||||
WpSpaIdTable table = wp_spa_type_get_values_table (obj_type);
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_iterate (table);
|
||||
g_autoptr (WpIterator) it = wp_spa_id_table_new_iterator (table);
|
||||
g_auto (GValue) value = G_VALUE_INIT;
|
||||
WpSpaIdValue id = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ print_endpoint (const GValue *item, gpointer data)
|
|||
print_controls (WP_PIPEWIRE_OBJECT (ep));
|
||||
|
||||
if (cmdline.status.show_streams) {
|
||||
g_autoptr (WpIterator) it = wp_endpoint_iterate_streams (ep);
|
||||
g_autoptr (WpIterator) it = wp_endpoint_new_streams_iterator (ep);
|
||||
guint n_streams = wp_endpoint_get_n_streams (ep);
|
||||
wp_iterator_foreach (it, print_stream, &n_streams);
|
||||
printf (TREE_INDENT_LINE "\n");
|
||||
|
|
@ -211,7 +211,7 @@ status_run (WpCtl * self)
|
|||
wp_core_get_remote_cookie (self->core));
|
||||
|
||||
printf (TREE_INDENT_END "Clients:\n");
|
||||
it = wp_object_manager_iterate_filtered (self->om, WP_TYPE_CLIENT, NULL);
|
||||
it = wp_object_manager_new_filtered_iterator (self->om, WP_TYPE_CLIENT, NULL);
|
||||
for (; wp_iterator_next (it, &val); g_value_unset (&val)) {
|
||||
WpProxy *client = g_value_get_object (&val);
|
||||
g_autoptr (WpProperties) properties =
|
||||
|
|
@ -229,7 +229,8 @@ status_run (WpCtl * self)
|
|||
printf ("\n");
|
||||
|
||||
/* sessions */
|
||||
it = wp_object_manager_iterate_filtered (self->om, WP_TYPE_SESSION, NULL);
|
||||
it = wp_object_manager_new_filtered_iterator (self->om, WP_TYPE_SESSION,
|
||||
NULL);
|
||||
for (; wp_iterator_next (it, &val); g_value_unset (&val)) {
|
||||
WpSession *session = g_value_get_object (&val);
|
||||
guint session_id = wp_proxy_get_bound_id (WP_PROXY (session));
|
||||
|
|
@ -241,7 +242,7 @@ status_run (WpCtl * self)
|
|||
if (metadata) {
|
||||
g_autoptr (WpIterator) m_it = NULL;
|
||||
g_auto (GValue) m_val = G_VALUE_INIT;
|
||||
m_it = wp_metadata_iterate (metadata, session_id);
|
||||
m_it = wp_metadata_new_iterator (metadata, session_id);
|
||||
for (; wp_iterator_next (m_it, &m_val); g_value_unset (&m_val)) {
|
||||
const gchar *k = NULL, *v = NULL;
|
||||
wp_metadata_iterator_item_extract (&m_val, NULL, &k, NULL, &v);
|
||||
|
|
@ -255,7 +256,7 @@ status_run (WpCtl * self)
|
|||
printf ("Session %u (%s)\n", session_id, wp_session_get_name (session));
|
||||
|
||||
printf (TREE_INDENT_NODE "Sink endpoints:\n");
|
||||
child_it = wp_session_iterate_endpoints_filtered (session,
|
||||
child_it = wp_session_new_endpoints_filtered_iterator (session,
|
||||
WP_CONSTRAINT_TYPE_PW_PROPERTY, "media.class", "#s", "*/Sink",
|
||||
NULL);
|
||||
wp_iterator_foreach (child_it, print_endpoint,
|
||||
|
|
@ -265,7 +266,7 @@ status_run (WpCtl * self)
|
|||
printf (TREE_INDENT_LINE "\n");
|
||||
|
||||
printf (TREE_INDENT_NODE "Source endpoints:\n");
|
||||
child_it = wp_session_iterate_endpoints_filtered (session,
|
||||
child_it = wp_session_new_endpoints_filtered_iterator (session,
|
||||
WP_CONSTRAINT_TYPE_PW_PROPERTY, "media.class", "#s", "*/Source",
|
||||
NULL);
|
||||
wp_iterator_foreach (child_it, print_endpoint,
|
||||
|
|
@ -275,7 +276,7 @@ status_run (WpCtl * self)
|
|||
printf (TREE_INDENT_LINE "\n");
|
||||
|
||||
printf (TREE_INDENT_NODE "Playback client endpoints:\n");
|
||||
child_it = wp_session_iterate_endpoints_filtered (session,
|
||||
child_it = wp_session_new_endpoints_filtered_iterator (session,
|
||||
WP_CONSTRAINT_TYPE_PW_PROPERTY, "media.class", "#s", "Stream/Output/*",
|
||||
NULL);
|
||||
wp_iterator_foreach (child_it, print_endpoint, NULL);
|
||||
|
|
@ -284,7 +285,7 @@ status_run (WpCtl * self)
|
|||
printf (TREE_INDENT_LINE "\n");
|
||||
|
||||
printf (TREE_INDENT_NODE "Capture client endpoints:\n");
|
||||
child_it = wp_session_iterate_endpoints_filtered (session,
|
||||
child_it = wp_session_new_endpoints_filtered_iterator (session,
|
||||
WP_CONSTRAINT_TYPE_PW_PROPERTY, "media.class", "#s", "Stream/Input/*",
|
||||
NULL);
|
||||
wp_iterator_foreach (child_it, print_endpoint, NULL);
|
||||
|
|
@ -293,7 +294,7 @@ status_run (WpCtl * self)
|
|||
printf (TREE_INDENT_LINE "\n");
|
||||
|
||||
printf (TREE_INDENT_END "Endpoint links:\n");
|
||||
child_it = wp_session_iterate_links (session);
|
||||
child_it = wp_session_new_links_iterator (session);
|
||||
wp_iterator_foreach (child_it, print_endpoint_link, session);
|
||||
g_clear_pointer (&child_it, wp_iterator_unref);
|
||||
|
||||
|
|
@ -426,7 +427,7 @@ inspect_print_object (WpCtl * self, WpProxy * proxy, guint nest_level)
|
|||
g_autoptr (WpIterator) it = NULL;
|
||||
g_auto (GValue) item = G_VALUE_INIT;
|
||||
|
||||
for (it = wp_properties_iterate (properties);
|
||||
for (it = wp_properties_new_iterator (properties);
|
||||
wp_iterator_next (it, &item);
|
||||
g_value_unset (&item)) {
|
||||
struct property_item prop_item = {
|
||||
|
|
@ -470,7 +471,7 @@ inspect_print_object (WpCtl * self, WpProxy * proxy, guint nest_level)
|
|||
const gchar *lookup_key = get_association_key (proxy);
|
||||
if (lookup_key) {
|
||||
g_autoptr (WpIterator) it =
|
||||
wp_object_manager_iterate_filtered (self->om,
|
||||
wp_object_manager_new_filtered_iterator (self->om,
|
||||
WP_TYPE_PIPEWIRE_OBJECT, WP_CONSTRAINT_TYPE_PW_PROPERTY,
|
||||
lookup_key, "=u", wp_proxy_get_bound_id (proxy), NULL);
|
||||
g_auto (GValue) item = G_VALUE_INIT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue