mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
bluez5: use function to get profile name
This commit is contained in:
parent
ebcdfe8f5d
commit
7fa1833310
2 changed files with 21 additions and 15 deletions
|
|
@ -329,14 +329,12 @@ static struct spa_pod *build_profile(struct impl *this, struct spa_pod_builder *
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (profile == SPA_BT_PROFILE_A2DP_SINK) {
|
} else if (profile == SPA_BT_PROFILE_A2DP_SINK) {
|
||||||
desc = "High Fidelity Playback (A2DP Sink)";
|
desc = "High Fidelity Playback (A2DP Sink)";
|
||||||
name = "a2dp-sink";
|
|
||||||
} else if (profile == SPA_BT_PROFILE_A2DP_SOURCE) {
|
} else if (profile == SPA_BT_PROFILE_A2DP_SOURCE) {
|
||||||
desc = "High Fidelity Capture (A2DP Source)";
|
desc = "High Fidelity Capture (A2DP Source)";
|
||||||
name = "a2dp-source";
|
|
||||||
} else {
|
} else {
|
||||||
desc = "High Fidelity Duplex (A2DP Source/Sink)";
|
desc = "High Fidelity Duplex (A2DP Source/Sink)";
|
||||||
name = "a2dp-duplex";
|
|
||||||
}
|
}
|
||||||
|
name = spa_bt_profile_name(profile);
|
||||||
if (profile & SPA_BT_PROFILE_A2DP_SOURCE)
|
if (profile & SPA_BT_PROFILE_A2DP_SOURCE)
|
||||||
n_source++;
|
n_source++;
|
||||||
if (profile & SPA_BT_PROFILE_A2DP_SINK)
|
if (profile & SPA_BT_PROFILE_A2DP_SINK)
|
||||||
|
|
@ -351,14 +349,12 @@ static struct spa_pod *build_profile(struct impl *this, struct spa_pod_builder *
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (profile == SPA_BT_PROFILE_HEADSET_HEAD_UNIT) {
|
} else if (profile == SPA_BT_PROFILE_HEADSET_HEAD_UNIT) {
|
||||||
desc = "Headset Head Unit (HSP/HFP)";
|
desc = "Headset Head Unit (HSP/HFP)";
|
||||||
name = "headset-head-unit";
|
|
||||||
} else if (profile == SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY) {
|
} else if (profile == SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY) {
|
||||||
desc = "Headset Audio Gateway (HSP/HFP)";
|
desc = "Headset Audio Gateway (HSP/HFP)";
|
||||||
name = "headset-audio-gateway";
|
|
||||||
} else {
|
} else {
|
||||||
desc = "Headset Audio (HSP/HFP)";
|
desc = "Headset Audio (HSP/HFP)";
|
||||||
name = "headset-audio";
|
|
||||||
}
|
}
|
||||||
|
name = spa_bt_profile_name(profile);
|
||||||
n_source++;
|
n_source++;
|
||||||
n_sink++;
|
n_sink++;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -149,16 +149,18 @@ extern "C" {
|
||||||
#define MSBC_ENCODED_SIZE 60 /* 2 bytes header + 57 mSBC payload + 1 byte padding */
|
#define MSBC_ENCODED_SIZE 60 /* 2 bytes header + 57 mSBC payload + 1 byte padding */
|
||||||
|
|
||||||
enum spa_bt_profile {
|
enum spa_bt_profile {
|
||||||
SPA_BT_PROFILE_NULL = 0,
|
SPA_BT_PROFILE_NULL = 0,
|
||||||
SPA_BT_PROFILE_A2DP_SINK = (1 << 0),
|
SPA_BT_PROFILE_A2DP_SINK = (1 << 0),
|
||||||
SPA_BT_PROFILE_A2DP_SOURCE = (1 << 1),
|
SPA_BT_PROFILE_A2DP_SOURCE = (1 << 1),
|
||||||
SPA_BT_PROFILE_HSP_HS = (1 << 2),
|
SPA_BT_PROFILE_HSP_HS = (1 << 2),
|
||||||
SPA_BT_PROFILE_HSP_AG = (1 << 3),
|
SPA_BT_PROFILE_HSP_AG = (1 << 3),
|
||||||
SPA_BT_PROFILE_HFP_HF = (1 << 4),
|
SPA_BT_PROFILE_HFP_HF = (1 << 4),
|
||||||
SPA_BT_PROFILE_HFP_AG = (1 << 5),
|
SPA_BT_PROFILE_HFP_AG = (1 << 5),
|
||||||
|
|
||||||
SPA_BT_PROFILE_HEADSET_HEAD_UNIT = (SPA_BT_PROFILE_HSP_HS | SPA_BT_PROFILE_HFP_HF),
|
SPA_BT_PROFILE_A2DP_DUPLEX = (SPA_BT_PROFILE_A2DP_SINK | SPA_BT_PROFILE_A2DP_SOURCE),
|
||||||
SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY = (SPA_BT_PROFILE_HSP_AG | SPA_BT_PROFILE_HFP_AG),
|
SPA_BT_PROFILE_HEADSET_HEAD_UNIT = (SPA_BT_PROFILE_HSP_HS | SPA_BT_PROFILE_HFP_HF),
|
||||||
|
SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY = (SPA_BT_PROFILE_HSP_AG | SPA_BT_PROFILE_HFP_AG),
|
||||||
|
SPA_BT_PROFILE_HEADSET_AUDIO = (SPA_BT_PROFILE_HEADSET_HEAD_UNIT | SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY),
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline enum spa_bt_profile spa_bt_profile_from_uuid(const char *uuid)
|
static inline enum spa_bt_profile spa_bt_profile_from_uuid(const char *uuid)
|
||||||
|
|
@ -215,6 +217,14 @@ static inline const char *spa_bt_profile_name (enum spa_bt_profile profile) {
|
||||||
return "a2dp-source";
|
return "a2dp-source";
|
||||||
case SPA_BT_PROFILE_A2DP_SINK:
|
case SPA_BT_PROFILE_A2DP_SINK:
|
||||||
return "a2dp-sink";
|
return "a2dp-sink";
|
||||||
|
case SPA_BT_PROFILE_A2DP_DUPLEX:
|
||||||
|
return "a2dp-duplex";
|
||||||
|
case SPA_BT_PROFILE_HEADSET_HEAD_UNIT:
|
||||||
|
return "headset-head-unit";
|
||||||
|
case SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY:
|
||||||
|
return "headset-audio-gateway";
|
||||||
|
case SPA_BT_PROFILE_HEADSET_AUDIO:
|
||||||
|
return "headset-audio";
|
||||||
case SPA_BT_PROFILE_HSP_HS:
|
case SPA_BT_PROFILE_HSP_HS:
|
||||||
return "hsp-hs";
|
return "hsp-hs";
|
||||||
case SPA_BT_PROFILE_HSP_AG:
|
case SPA_BT_PROFILE_HSP_AG:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue