bap: add Location parameter to SelectProperties
authorPauli Virtanen <pav@iki.fi>
Sat, 22 Apr 2023 17:05:57 +0000 (17:05 +0000)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:41:34 +0000 (16:11 +0530)
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

index b1bd0ae..aa6cebe 100644 (file)
@@ -1112,6 +1112,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)
@@ -1143,6 +1144,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,