From f1e56b2317ce096bb8506dbf89fb5ff237992773 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 6 Feb 2021 20:11:37 +0200 Subject: [PATCH] bluez5: provide media.name for a2dp source streams A2DP source acts as Stream/Output/Audio, so provide media.name for it indicating the device it comes from (e.g. shown in pulseaudio apps). --- spa/plugins/bluez5/a2dp-source.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spa/plugins/bluez5/a2dp-source.c b/spa/plugins/bluez5/a2dp-source.c index c55328104..ee2667adf 100644 --- a/spa/plugins/bluez5/a2dp-source.c +++ b/spa/plugins/bluez5/a2dp-source.c @@ -636,16 +636,18 @@ static int impl_node_send_command(void *object, const struct spa_command *comman return 0; } -static const struct spa_dict_item node_info_items[] = { - { SPA_KEY_DEVICE_API, "bluez5" }, - { SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" }, - { SPA_KEY_NODE_DRIVER, "true" }, - { SPA_KEY_NODE_LATENCY, "512/48000" }, - { SPA_KEY_NODE_PAUSE_ON_IDLE, "false" }, -}; - static void emit_node_info(struct impl *this, bool full) { + struct spa_dict_item node_info_items[] = { + { SPA_KEY_DEVICE_API, "bluez5" }, + { SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" }, + { SPA_KEY_NODE_DRIVER, "true" }, + { SPA_KEY_NODE_LATENCY, "512/48000" }, + { SPA_KEY_NODE_PAUSE_ON_IDLE, "false" }, + { "media.name", ((this->transport && this->transport->device->name) ? + this->transport->device->name : "A2DP") }, + }; + if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) {