Skip to content
Snippets Groups Projects
Commit 135b1c2c authored by Julian Bouzas's avatar Julian Bouzas
Browse files

object-manager: only get proxy properties when needed

parent beb0056d
No related branches found
No related tags found
No related merge requests found
...@@ -425,14 +425,8 @@ check_constraints (GVariant *constraints, ...@@ -425,14 +425,8 @@ check_constraints (GVariant *constraints,
GVariantIter iter; GVariantIter iter;
GVariant *c; GVariant *c;
WpObjectManagerConstraintType ctype; WpObjectManagerConstraintType ctype;
g_autoptr (WpProperties) props = NULL;
const gchar *prop_name, *prop_value; const gchar *prop_name, *prop_value;
/* pipewire properties are contained in a GObj property called "properties" */
if (object &&
g_object_class_find_property (G_OBJECT_GET_CLASS (object), "properties"))
g_object_get (object, "properties", &props, NULL);
g_variant_iter_init (&iter, constraints); g_variant_iter_init (&iter, constraints);
while (g_variant_iter_next (&iter, "@a{sv}", &c)) { while (g_variant_iter_next (&iter, "@a{sv}", &c)) {
GVariantDict dict = G_VARIANT_DICT_INIT (c); GVariantDict dict = G_VARIANT_DICT_INIT (c);
...@@ -460,6 +454,12 @@ check_constraints (GVariant *constraints, ...@@ -460,6 +454,12 @@ check_constraints (GVariant *constraints,
break; break;
case WP_OBJECT_MANAGER_CONSTRAINT_PW_PROPERTY: case WP_OBJECT_MANAGER_CONSTRAINT_PW_PROPERTY:
{
/* pipewire properties are contained in a GObj property called "properties" */
g_autoptr (WpProperties) props = NULL;
if (object &&
g_object_class_find_property (G_OBJECT_GET_CLASS (object), "properties"))
g_object_get (object, "properties", &props, NULL);
if (!props) if (!props)
goto next; goto next;
...@@ -475,6 +475,7 @@ check_constraints (GVariant *constraints, ...@@ -475,6 +475,7 @@ check_constraints (GVariant *constraints,
goto match; goto match;
break; break;
}
case WP_OBJECT_MANAGER_CONSTRAINT_G_PROPERTY: case WP_OBJECT_MANAGER_CONSTRAINT_G_PROPERTY:
if (!object) if (!object)
goto next; goto next;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment