mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
bluetooth: Add support for getting current active codec
For example, using the following on the command line will return the current codec for a bluetooth device pacmd send-message /card/bluez_card.4C_BC_98_80_01_9B/bluez get-codec where 4C_BC_98_80_01_9B is the bluetooth device. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>
This commit is contained in:
parent
4ce996b74a
commit
6044169763
1 changed files with 12 additions and 0 deletions
|
|
@ -2418,6 +2418,18 @@ static int bluez5_device_message_handler(const char *object_path, const char *me
|
|||
return PA_OK;
|
||||
} else if (pa_streq(message, "list-codecs")) {
|
||||
*response = list_codecs(u);
|
||||
return PA_OK;
|
||||
} else if (pa_streq(message, "get-codec")) {
|
||||
pa_message_params *param;
|
||||
param = pa_message_params_new();
|
||||
|
||||
if (u->a2dp_codec)
|
||||
pa_message_params_write_string(param, u->a2dp_codec->name);
|
||||
else
|
||||
pa_message_params_write_string(param, "none");
|
||||
|
||||
*response = pa_message_params_to_string_free(param);
|
||||
|
||||
return PA_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue