From 797bd4f6b38c3769184953f68279d29aa993b5aa Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Sun, 21 May 2023 10:18:06 +0000 Subject: [PATCH] bluez5: media-sink: include codec into media.name --- spa/plugins/bluez5/media-source.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/media-source.c b/spa/plugins/bluez5/media-source.c index 768b39d04..1f82d2d41 100644 --- a/spa/plugins/bluez5/media-source.c +++ b/spa/plugins/bluez5/media-source.c @@ -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" }, };