LADI
/
spa
1
Fork 0

bluez5: media-sink: include codec into media.name

This commit is contained in:
Dmitry Sharshakov 2023-05-21 10:18:06 +00:00 committed by Wim Taymans
parent 7e5c6631a5
commit 797bd4f6b3
1 changed files with 11 additions and 2 deletions

View File

@ -845,14 +845,23 @@ static void emit_node_info(struct impl *this, bool full)
{
uint64_t old = full ? this->info.change_mask : 0;
char latency[64];
char media_name[256];
spa_scnprintf(
media_name,
sizeof(media_name),
"%s (codec %s)",
((this->transport && this->transport->device->name) ?
this->transport->device->name : this->codec->bap ? "BAP" : "A2DP"),
this->codec->description
);
struct spa_dict_item node_info_items[] = {
{ SPA_KEY_DEVICE_API, "bluez5" },
{ SPA_KEY_MEDIA_CLASS, this->is_internal ? "Audio/Source/Internal" :
this->is_input ? "Audio/Source" : "Stream/Output/Audio" },
{ SPA_KEY_NODE_LATENCY, this->is_input ? "" : latency },
{ "media.name", ((this->transport && this->transport->device->name) ?
this->transport->device->name : this->codec->bap ? "BAP" : "A2DP") },
{ "media.name", media_name },
{ SPA_KEY_NODE_DRIVER, this->is_input ? "true" : "false" },
};