mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
bluez: improve profile description
This commit is contained in:
parent
471c1a071c
commit
8ad769b943
1 changed files with 30 additions and 6 deletions
|
|
@ -257,25 +257,49 @@ static int impl_enum_params(void *object, int seq,
|
||||||
SPA_PARAM_PROFILE_name, SPA_POD_String("Off"));
|
SPA_PARAM_PROFILE_name, SPA_POD_String("Off"));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (!(device->connected_profiles &
|
{
|
||||||
(SPA_BT_PROFILE_A2DP_SINK | SPA_BT_PROFILE_A2DP_SOURCE)))
|
uint32_t profile = device->connected_profiles &
|
||||||
|
(SPA_BT_PROFILE_A2DP_SINK | SPA_BT_PROFILE_A2DP_SOURCE);
|
||||||
|
const char *description;
|
||||||
|
|
||||||
|
if (profile == 0)
|
||||||
goto next;
|
goto next;
|
||||||
|
else if (profile == SPA_BT_PROFILE_A2DP_SINK)
|
||||||
|
description = "High Fidelity Playback (A2DP Sink)";
|
||||||
|
else if (profile == SPA_BT_PROFILE_A2DP_SOURCE)
|
||||||
|
description = "High Fidelity Capture (A2DP Source)";
|
||||||
|
else
|
||||||
|
description = "High Fidelity Duplex (A2DP Source/Sink)";
|
||||||
|
|
||||||
param = spa_pod_builder_add_object(&b,
|
param = spa_pod_builder_add_object(&b,
|
||||||
SPA_TYPE_OBJECT_ParamProfile, id,
|
SPA_TYPE_OBJECT_ParamProfile, id,
|
||||||
SPA_PARAM_PROFILE_index, SPA_POD_Int(1),
|
SPA_PARAM_PROFILE_index, SPA_POD_Int(1),
|
||||||
SPA_PARAM_PROFILE_name, SPA_POD_String("A2DP"),
|
SPA_PARAM_PROFILE_name, SPA_POD_String("A2DP"),
|
||||||
SPA_PARAM_PROFILE_description, SPA_POD_String("High Fidelity (A2DP)"));
|
SPA_PARAM_PROFILE_description, SPA_POD_String(description));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 2:
|
case 2:
|
||||||
if (!(device->connected_profiles &
|
{
|
||||||
(SPA_BT_PROFILE_HEADSET_HEAD_UNIT | SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY)))
|
uint32_t profile = device->connected_profiles &
|
||||||
|
(SPA_BT_PROFILE_HEADSET_HEAD_UNIT | SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY);
|
||||||
|
const char *description;
|
||||||
|
|
||||||
|
if (profile == 0)
|
||||||
goto next;
|
goto next;
|
||||||
|
else if (profile == SPA_BT_PROFILE_HEADSET_HEAD_UNIT)
|
||||||
|
description = "Headset Head Unit (HSP/HFP)";
|
||||||
|
else if (profile == SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY)
|
||||||
|
description = "Headset Audio Gateway (HSP/HFP)";
|
||||||
|
else
|
||||||
|
description = "Headset Audio (HSP/HFP)";
|
||||||
|
|
||||||
param = spa_pod_builder_add_object(&b,
|
param = spa_pod_builder_add_object(&b,
|
||||||
SPA_TYPE_OBJECT_ParamProfile, id,
|
SPA_TYPE_OBJECT_ParamProfile, id,
|
||||||
SPA_PARAM_PROFILE_index, SPA_POD_Int(2),
|
SPA_PARAM_PROFILE_index, SPA_POD_Int(2),
|
||||||
SPA_PARAM_PROFILE_name, SPA_POD_String("HSP/HFP"),
|
SPA_PARAM_PROFILE_name, SPA_POD_String("HSP/HFP"),
|
||||||
SPA_PARAM_PROFILE_description, SPA_POD_String("Headset Audio (HSP/HFP)"));
|
SPA_PARAM_PROFILE_description, SPA_POD_String(description));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue