2023-04-22 17:10:08

by Pauli Virtanen

[permalink] [raw]
Subject: [PATCH BlueZ 2/2] bap: add Location parameter to SelectProperties

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 --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,
--
2.40.0