diff mbox series

[BlueZ,v1,3/4] client/player: Make endpoint.show print local preset

Message ID 20240819195102.37393-3-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1,1/4] client/player: Add support for entering metadata via endpoint.presets | expand

Commit Message

Luiz Augusto von Dentz Aug. 19, 2024, 7:51 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This makes command endpoint.show print preset set with endpoint.presets:

>endpoint.show /local/endpoint/ep2
Endpoint /local/endpoint/ep2
	UUID 00002bc9-0000-1000-8000-00805f9b34fb
	Codec 0x06 (6)
	Capabilities.#0: len 0x03 type 0x01
	Capabilities.Sampling Frequencies: 0x00ff
	Capabilities.Sampling Frequency: 8 Khz (0x0001)
	Capabilities.Sampling Frequency: 11.25 Khz (0x0002)
	Capabilities.Sampling Frequency: 16 Khz (0x0004)
	Capabilities.Sampling Frequency: 22.05 Khz (0x0008)
	Capabilities.Sampling Frequency: 24 Khz (0x0010)
	Capabilities.Sampling Frequency: 32 Khz (0x0020)
	Capabilities.Sampling Frequency: 44.1 Khz (0x0040)
	Capabilities.Sampling Frequency: 48 Khz (0x0080)
	Capabilities.#1: len 0x02 type 0x02
	Capabilities.Frame Duration: 0x03
	Capabilities.Frame Duration: 7.5 ms (0x01)
	Capabilities.Frame Duration: 10 ms (0x02)
	Capabilities.#2: len 0x05 type 0x04
	Capabilities.Frame Length: 26 (0x001a) - 240 (0x00f0)
	Capabilities.#3: len 0x02 type 0x03
	Capabilities.Audio Channel Count: 0x01
	Capabilities.Audio Channel Count: 1 channel (0x01)
	Preset 32_1_1
	Configuration.#0: len 0x02 type 0x01
	Configuration.Sampling Frequency: 32 Khz (0x06)
	Configuration.#1: len 0x02 type 0x02
	Configuration.Frame Duration: 7.5 ms (0x00)
	Configuration.#2: len 0x03 type 0x04
	Configuration.Frame Length: 60 (0x003c)
	Locations 0x00000002 (2)
---
 client/player.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/client/player.c b/client/player.c
index cfaf1137c92e..5644b0d616c9 100644
--- a/client/player.c
+++ b/client/player.c
@@ -2797,13 +2797,26 @@  static void print_capabilities(GDBusProxy *proxy)
 	print_codec(uuid, codec, &caps, &meta);
 }
 
+static void print_preset(struct codec_preset *codec, uint8_t codec_id)
+{
+	bt_shell_printf("\tPreset %s\n", codec->name);
+
+	if (codec_id == LC3_ID)
+		print_lc3_cfg(codec->data.iov_base, codec->data.iov_len);
+}
+
 static void print_local_endpoint(struct endpoint *ep)
 {
 	bt_shell_printf("Endpoint %s\n", ep->path);
 	bt_shell_printf("\tUUID %s\n", ep->uuid);
 	bt_shell_printf("\tCodec 0x%02x (%u)\n", ep->codec, ep->codec);
+
 	if (ep->caps)
 		print_codec(ep->uuid, ep->codec, ep->caps, ep->meta);
+
+	if (ep->codec_preset)
+		print_preset(ep->codec_preset, ep->codec);
+
 	if (ep->locations)
 		bt_shell_printf("\tLocations 0x%08x (%u)\n", ep->locations,
 				ep->locations);