diff mbox series

[BlueZ,2/2] bap: add Location parameter to SelectProperties

Message ID a744467fc6dcaa243c0bb31bbea8a2d8ca9a7172.1682182441.git.pav@iki.fi
State New
Headers show
Series [BlueZ,1/2] shared/bap: add function to get location from PAC | expand

Commit Message

Pauli Virtanen April 22, 2023, 5:05 p.m. UTC
Add relevant PACS Location field as a parameter to SelectProperties.

SelectProperties may set Audio_Channel_Allocation, which shall be chosen
from the bits set in Sink/Source Audio Locations (BAP v1.0.1 Sec. 4.4.1,
Sec 4.4.2). Hence, audio server needs to know the supported values,
which it previously could not.
---
 profiles/audio/media.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 540e91bc6..52c4bd80a 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -901,6 +901,7 @@  static int pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 	DBusMessage *msg;
 	DBusMessageIter iter, dict;
 	const char *key = "Capabilities";
+	uint32_t loc;
 
 	bt_bap_pac_get_codec(rpac, NULL, &caps, &metadata);
 	if (!caps)
@@ -932,6 +933,11 @@  static int pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 					DBUS_TYPE_BYTE, &caps->iov_base,
 					caps->iov_len);
 
+	loc = bt_bap_pac_get_locations(rpac);
+	if (loc)
+		g_dbus_dict_append_entry(&dict, "Location", DBUS_TYPE_UINT32,
+									&loc);
+
 	if (metadata) {
 		key = "Metadata";
 		g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &key,