mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-05 04:06:37 -05:00
bluez5: bap: add support for per adapter broadcast config
By setting the hci handle (e.g. hci0) of the desired adapter, the BIG config will only applied on that adapter. In case no "adapter" entry in the config is given, it will be applied on all adapters. Signed-off-by: Alexander Sarmanow <a.sarmanow@televic.com>
This commit is contained in:
parent
1a478c7147
commit
f34a87fe38
2 changed files with 23 additions and 0 deletions
|
|
@ -1211,6 +1211,7 @@ PipeWire Opus Pro audio profile duplex max bitrate.
|
|||
PipeWire Opus Pro audio profile duplex frame duration (1/10 ms).
|
||||
|
||||
@PAR@ monitor-prop bluez5.bcast_source.config = [] # JSON
|
||||
For a per-adapter configuration of multiple BIGs use an "adapter" entry in the BIG with the HCI device name (e.g. hci0).
|
||||
\parblock
|
||||
Example:
|
||||
```
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ struct spa_bt_bis {
|
|||
};
|
||||
|
||||
#define BROADCAST_CODE_LEN 16
|
||||
#define HCI_DEV_NAME_LEN 8
|
||||
|
||||
struct spa_bt_big {
|
||||
struct spa_list link;
|
||||
|
|
@ -202,6 +203,7 @@ struct spa_bt_big {
|
|||
struct spa_list bis_list;
|
||||
int big_id;
|
||||
int sync_factor;
|
||||
char adapter[HCI_DEV_NAME_LEN];
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -6244,8 +6246,20 @@ static void configure_bcast_source(struct spa_bt_monitor *monitor,
|
|||
{
|
||||
struct spa_bt_big *big;
|
||||
struct spa_bt_bis *bis;
|
||||
char *pos;
|
||||
/* Configure each BIS from a BIG */
|
||||
spa_list_for_each(big, &monitor->bcast_source_config_list, link) {
|
||||
/* Apply per adapter configuration if BIG has an adapter value stated,
|
||||
* otherwise apply the BIG config angnostically to each adapter
|
||||
*/
|
||||
if (strlen(big->adapter) > 0) {
|
||||
pos = strstr(object_path, big->adapter);
|
||||
if (pos == NULL)
|
||||
continue;
|
||||
|
||||
spa_log_debug(monitor->log, "configuring BIG for adapter=%s", big->adapter);
|
||||
}
|
||||
|
||||
spa_list_for_each(bis, &big->bis_list, link) {
|
||||
configure_bis(monitor, codec, conn, object_path, interface_name,
|
||||
big, bis, local_endpoint);
|
||||
|
|
@ -6989,6 +7003,7 @@ static void parse_broadcast_source_config(struct spa_bt_monitor *monitor, const
|
|||
char bis_key[256];
|
||||
char qos_key[256];
|
||||
char bcode[BROADCAST_CODE_LEN + 3];
|
||||
char adapter[HCI_DEV_NAME_LEN + 3];
|
||||
int cursor;
|
||||
int big_id = 0;
|
||||
struct spa_json it[3], it_array[4];
|
||||
|
|
@ -7024,6 +7039,13 @@ static void parse_broadcast_source_config(struct spa_bt_monitor *monitor, const
|
|||
goto parse_failed;
|
||||
memcpy(big_entry->broadcast_code, bcode, strlen(bcode));
|
||||
spa_log_debug(monitor->log, "big_entry->broadcast_code %s", big_entry->broadcast_code);
|
||||
} else if (spa_streq(key, "adapter")) {
|
||||
if (spa_json_get_string(&it[1], adapter, sizeof(adapter)) <= 0)
|
||||
goto parse_failed;
|
||||
if (strlen(adapter) > HCI_DEV_NAME_LEN)
|
||||
goto parse_failed;
|
||||
memcpy(big_entry->adapter, adapter, sizeof(adapter));
|
||||
spa_log_debug(monitor->log, "big_entry->adapter %s", big_entry->adapter);
|
||||
} else if (spa_streq(key, "encryption")) {
|
||||
if (spa_json_get_bool(&it[0], &big_entry->encryption) <= 0)
|
||||
goto parse_failed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue