diff mbox series

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

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

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint fail WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search 9: B3 Line contains hard tab characters (\t): " UUID 00002bc9-0000-1000-8000-00805f9b34fb" 10: B3 Line contains hard tab characters (\t): " Codec 0x06 (6)" 11: B3 Line contains hard tab characters (\t): " Capabilities.#0: len 0x03 type 0x01" 12: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequencies: 0x00ff" 13: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 8 Khz (0x0001)" 14: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 11.25 Khz (0x0002)" 15: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 16 Khz (0x0004)" 16: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 22.05 Khz (0x0008)" 17: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 24 Khz (0x0010)" 18: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 32 Khz (0x0020)" 19: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 44.1 Khz (0x0040)" 20: B3 Line contains hard tab characters (\t): " Capabilities.Sampling Frequency: 48 Khz (0x0080)" 21: B3 Line contains hard tab characters (\t): " Capabilities.#1: len 0x02 type 0x02" 22: B3 Line contains hard tab characters (\t): " Capabilities.Frame Duration: 0x03" 23: B3 Line contains hard tab characters (\t): " Capabilities.Frame Duration: 7.5 ms (0x01)" 24: B3 Line contains hard tab characters (\t): " Capabilities.Frame Duration: 10 ms (0x02)" 25: B3 Line contains hard tab characters (\t): " Capabilities.#2: len 0x05 type 0x04" 26: B3 Line contains hard tab characters (\t): " Capabilities.Frame Length: 26 (0x001a) - 240 (0x00f0)" 27: B3 Line contains hard tab characters (\t): " Capabilities.#3: len 0x02 type 0x03" 28: B3 Line contains hard tab characters (\t): " Capabilities.Audio Channel Count: 0x01" 29: B3 Line contains hard tab characters (\t): " Capabilities.Audio Channel Count: 1 channel (0x01)" 30: B3 Line contains hard tab characters (\t): " Preset 32_1_1" 31: B3 Line contains hard tab characters (\t): " Configuration.#0: len 0x02 type 0x01" 32: B3 Line contains hard tab characters (\t): " Configuration.Sampling Frequency: 32 Khz (0x06)" 33: B3 Line contains hard tab characters (\t): " Configuration.#1: len 0x02 type 0x02" 34: B3 Line contains hard tab characters (\t): " Configuration.Frame Duration: 7.5 ms (0x00)" 35: B3 Line contains hard tab characters (\t): " Configuration.#2: len 0x03 type 0x04" 36: B3 Line contains hard tab characters (\t): " Configuration.Frame Length: 60 (0x003c)" 37: B3 Line contains hard tab characters (\t): " Locations 0x00000002 (2)"
tedd_an/IncrementalBuild success Incremental Build PASS

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);