mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
parent
dfb3bff15b
commit
2908e11a72
1 changed files with 14 additions and 2 deletions
|
|
@ -118,6 +118,19 @@ static void init_node(struct impl *this, struct node *node, uint32_t id)
|
||||||
node->volumes[i] = 1.0;
|
node->volumes[i] = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *get_codec_name(struct spa_bt_transport *t)
|
||||||
|
{
|
||||||
|
if (t->a2dp_codec != NULL)
|
||||||
|
return t->a2dp_codec->name;
|
||||||
|
switch (t->codec) {
|
||||||
|
case HFP_AUDIO_CODEC_MSBC:
|
||||||
|
return "mSBC";
|
||||||
|
case HFP_AUDIO_CODEC_CVSD:
|
||||||
|
return "CVSD";
|
||||||
|
}
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
static void emit_node(struct impl *this, struct spa_bt_transport *t,
|
static void emit_node(struct impl *this, struct spa_bt_transport *t,
|
||||||
uint32_t id, const char *factory_name)
|
uint32_t id, const char *factory_name)
|
||||||
{
|
{
|
||||||
|
|
@ -129,8 +142,7 @@ static void emit_node(struct impl *this, struct spa_bt_transport *t,
|
||||||
snprintf(transport, sizeof(transport), "pointer:%p", t);
|
snprintf(transport, sizeof(transport), "pointer:%p", t);
|
||||||
items[0] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_TRANSPORT, transport);
|
items[0] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_TRANSPORT, transport);
|
||||||
items[1] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_PROFILE, spa_bt_profile_name(t->profile));
|
items[1] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_PROFILE, spa_bt_profile_name(t->profile));
|
||||||
items[2] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_CODEC,
|
items[2] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_CODEC, get_codec_name(t));
|
||||||
t->a2dp_codec ? t->a2dp_codec->name : "unknown");
|
|
||||||
snprintf(str_id, sizeof(str_id), "%d", id);
|
snprintf(str_id, sizeof(str_id), "%d", id);
|
||||||
items[3] = SPA_DICT_ITEM_INIT("card.profile.device", str_id);
|
items[3] = SPA_DICT_ITEM_INIT("card.profile.device", str_id);
|
||||||
items[4] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_ADDRESS, device->address);
|
items[4] = SPA_DICT_ITEM_INIT(SPA_KEY_API_BLUEZ5_ADDRESS, device->address);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue