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).
This commit is contained in:
Pauli Virtanen 2021-02-06 20:11:37 +02:00
parent 3e9bf908ac
commit f1e56b2317

View file

@ -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) {