diff mbox series

[v1,1/5] media: Populate location to qos structure

Message ID 20231020142554.486629-1-kiran.k@intel.com
State New
Headers show
Series [v1,1/5] media: Populate location to qos structure | expand

Commit Message

K, Kiran Oct. 20, 2023, 2:25 p.m. UTC
Allow clients to register Location for endpoint.
---
 profiles/audio/media.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 1d98ac5a1a70..d0520d3216c9 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -1609,6 +1609,10 @@  static int parse_properties(DBusMessageIter *props, const char **uuid,
 			if (var != DBUS_TYPE_UINT16)
 				return -EINVAL;
 			dbus_message_iter_get_basic(&value, &qos->ppd_max);
+		} else if (strcasecmp(key, "Location") == 0) {
+			if (var != DBUS_TYPE_UINT32)
+				return -EINVAL;
+			dbus_message_iter_get_basic(&value, &qos->location);
 		}
 
 		dbus_message_iter_next(props);
@@ -2799,6 +2803,13 @@  static void app_register_endpoint(void *data, void *user_data)
 		dbus_message_iter_get_basic(&iter, &qos.ppd_min);
 	}
 
+	if (g_dbus_proxy_get_property(proxy, "Location", &iter)) {
+		if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
+			goto fail;
+
+		dbus_message_iter_get_basic(&iter, &qos.location);
+	}
+
 	endpoint = media_endpoint_create(app->adapter, app->sender, path, uuid,
 						delay_reporting, codec,
 						vendor.cid, vendor.vid, &qos,