bluez5: media-sink: set node.group for ISO group nodes

It's better to schedule nodes in the same ISO group together, since they
are supposed to produce synchronized output.
This commit is contained in:
Pauli Virtanen 2023-11-12 18:30:32 +02:00
parent 17c583bbe7
commit de9086481f

View file

@ -1405,6 +1405,21 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
static void emit_node_info(struct impl *this, bool full)
{
char node_group_buf[256];
char *node_group = NULL;
if (this->transport && (this->transport->profile & SPA_BT_PROFILE_BAP_SINK)) {
spa_scnprintf(node_group_buf, sizeof(node_group_buf), "bluez-iso-%s-cig-%d",
this->transport->device->adapter->address,
this->transport->bap_cig);
node_group = node_group_buf;
} else if (this->transport && (this->transport->profile & SPA_BT_PROFILE_BAP_BROADCAST_SINK)) {
spa_scnprintf(node_group_buf, sizeof(node_group_buf), "bluez-iso-%s-big-%d",
this->transport->device->adapter->address,
this->transport->bap_big);
node_group = node_group_buf;
}
struct spa_dict_item node_info_items[] = {
{ SPA_KEY_DEVICE_API, "bluez5" },
{ SPA_KEY_MEDIA_CLASS, this->is_internal ? "Audio/Sink/Internal" :
@ -1412,6 +1427,7 @@ static void emit_node_info(struct impl *this, bool full)
{ "media.name", ((this->transport && this->transport->device->name) ?
this->transport->device->name : this->codec->bap ? "BAP" : "A2DP" ) },
{ SPA_KEY_NODE_DRIVER, this->is_output ? "true" : "false" },
{ "node.group", node_group },
};
uint64_t old = full ? this->info.change_mask : 0;
if (full)