mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-08 10:06:56 -05:00
bluetooth: Set "computer" form-factor based on CoD
The Class of Device field has a value for "computer" in its major portion. If the remote device behind a card is a computer, the form-factor should be set accordingly.
This commit is contained in:
parent
ca9b723afa
commit
dd81386f97
1 changed files with 10 additions and 0 deletions
|
|
@ -168,6 +168,7 @@ typedef enum pa_bluetooth_form_factor {
|
|||
PA_BLUETOOTH_FORM_FACTOR_CAR,
|
||||
PA_BLUETOOTH_FORM_FACTOR_HIFI,
|
||||
PA_BLUETOOTH_FORM_FACTOR_PHONE,
|
||||
PA_BLUETOOTH_FORM_FACTOR_COMPUTER,
|
||||
} pa_bluetooth_form_factor_t;
|
||||
|
||||
/* Run from main thread */
|
||||
|
|
@ -194,6 +195,8 @@ static pa_bluetooth_form_factor_t form_factor_from_class(uint32_t class_of_devic
|
|||
minor = (class_of_device >> 2) & 0x3F;
|
||||
|
||||
switch (major) {
|
||||
case 1:
|
||||
return PA_BLUETOOTH_FORM_FACTOR_COMPUTER;
|
||||
case 2:
|
||||
return PA_BLUETOOTH_FORM_FACTOR_PHONE;
|
||||
case 4:
|
||||
|
|
@ -234,6 +237,8 @@ static const char *form_factor_to_string(pa_bluetooth_form_factor_t ff) {
|
|||
return "hifi";
|
||||
case PA_BLUETOOTH_FORM_FACTOR_PHONE:
|
||||
return "phone";
|
||||
case PA_BLUETOOTH_FORM_FACTOR_COMPUTER:
|
||||
return "computer";
|
||||
}
|
||||
|
||||
pa_assert_not_reached();
|
||||
|
|
@ -1950,6 +1955,11 @@ static void create_card_ports(struct userdata *u, pa_hashmap *ports) {
|
|||
input_type = output_type = PA_DEVICE_PORT_TYPE_PHONE;
|
||||
break;
|
||||
|
||||
case PA_BLUETOOTH_FORM_FACTOR_COMPUTER:
|
||||
name_prefix = "computer";
|
||||
input_description = output_description = _("Computer");
|
||||
break;
|
||||
|
||||
case PA_BLUETOOTH_FORM_FACTOR_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue