session-item: remove ID property

Not needed anymore, the object API has a unique ID now.
This commit is contained in:
Julian Bouzas 2022-08-23 08:09:36 -04:00
parent 69c241c4b8
commit 63fbcdc82c
3 changed files with 2 additions and 43 deletions

View file

@ -34,33 +34,22 @@ enum {
typedef struct _WpSessionItemPrivate WpSessionItemPrivate;
struct _WpSessionItemPrivate
{
guint id;
WpProperties *properties;
};
enum {
PROP_0,
PROP_ID,
PROP_PROPERTIES,
};
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (WpSessionItem, wp_session_item,
WP_TYPE_OBJECT)
static guint
get_next_id ()
{
static guint next_id = 0;
g_atomic_int_inc (&next_id);
return next_id;
}
static void
wp_session_item_init (WpSessionItem * self)
{
WpSessionItemPrivate *priv = wp_session_item_get_instance_private (self);
priv->id = get_next_id ();
priv->properties = NULL;
}
@ -89,12 +78,8 @@ wp_session_item_get_gobject_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
WpSessionItem *self = WP_SESSION_ITEM (object);
WpSessionItemPrivate *priv = wp_session_item_get_instance_private (self);
switch (property_id) {
case PROP_ID:
g_value_set_uint (value, priv->id);
break;
case PROP_PROPERTIES:
g_value_take_boxed (value, wp_session_item_get_properties (self));
break;
@ -210,33 +195,12 @@ wp_session_item_class_init (WpSessionItemClass * klass)
klass->reset = wp_session_item_default_reset;
g_object_class_install_property (object_class, PROP_ID,
g_param_spec_uint ("id", "id",
"The session item unique id", 0, G_MAXUINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_PROPERTIES,
g_param_spec_boxed ("properties", "properties",
"The session item properties", WP_TYPE_PROPERTIES,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
}
/*!
* \brief Gets the unique Id of the session item
* \ingroup wpsessionitem
* \param self the session item
*/
guint
wp_session_item_get_id (WpSessionItem * self)
{
WpSessionItemPrivate *priv = NULL;
g_return_val_if_fail (WP_IS_SESSION_ITEM (self), SPA_ID_INVALID);
priv = wp_session_item_get_instance_private (self);
return priv->id;
}
/*!
* \brief Resets the session item.
*

View file

@ -59,11 +59,6 @@ struct _WpSessionItemClass
WP_PADDING(5)
};
/* Id */
WP_API
guint wp_session_item_get_id (WpSessionItem * self);
/* configuration */
WP_API

View file

@ -104,13 +104,13 @@ si_standard_link_configure (WpSessionItem * item, WpProperties * p)
if (!out_item)
return FALSE;
wp_properties_setf (si_props, "out.item.id", "%u",
wp_session_item_get_id (out_item));
wp_object_get_id (WP_OBJECT (out_item)));
in_item = get_and_validate_item (si_props, "in.item");
if (!in_item)
return FALSE;
wp_properties_setf (si_props, "in.item.id", "%u",
wp_session_item_get_id (in_item));
wp_object_get_id (WP_OBJECT (in_item)));
self->out_item_port_context = wp_properties_get (si_props,
"out.item.port.context");