[PATCH] tools/hcidump: Decode MPEG-1,2 Audio codec capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 tools/parser/avdtp.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/tools/parser/avdtp.c b/tools/parser/avdtp.c
index 14dc417..5969067 100644
--- a/tools/parser/avdtp.c
+++ b/tools/parser/avdtp.c
@@ -222,6 +222,7 @@ static void capabilities(int level, struct frame *frm)
 			uint8_t type, codec;
 			uint16_t tmp, freq, vndcodec = 0;
 			uint32_t bitrate, vendor = 0;
+			int i;
 
 			type  = get_u8(frm);
 			codec = get_u8(frm);
@@ -288,6 +289,63 @@ static void capabilities(int level, struct frame *frm)
 				p_indent(level + 1, frm);
 				printf("Bitpool Range %d-%d\n", tmp, get_u8(frm));
 				break;
+			case 1:
+				tmp = get_u8(frm);
+				p_indent(level + 1, frm);
+				printf("Layers: ");
+				if (tmp & 0x80)
+					printf("1 ");
+				if (tmp & 0x40)
+					printf("2 ");
+				if (tmp & 0x20)
+					printf("3 ");
+				printf("\n");
+				p_indent(level + 1, frm);
+				printf("CRC Protection: %s\n",
+						tmp & 0x10 ? "Yes" : "No");
+				p_indent(level + 1, frm);
+				if (tmp & 0x08)
+					printf("Mono ");
+				if (tmp & 0x04)
+					printf("DualChannel ");
+				if (tmp & 0x02)
+					printf("Stereo ");
+				if (tmp & 0x01)
+					printf("JointStereo ");
+				printf("\n");
+				tmp = get_u8(frm);
+				p_indent(level + 1, frm);
+				printf("Media Payload Format: RFC-2250 %s\n",
+						tmp & 0x40 ? "RFC-3119" : "");
+				p_indent(level + 1, frm);
+				if (tmp & 0x20)
+					printf("16kHz ");
+				if (tmp & 0x10)
+					printf("22.05kHz ");
+				if (tmp & 0x08)
+					printf("24kHz ");
+				if (tmp & 0x04)
+					printf("32kHz ");
+				if (tmp & 0x02)
+					printf("44.1kHz ");
+				if (tmp & 0x01)
+					printf("48kHz ");
+				printf("\n");
+				tmp = get_u16(frm);
+				p_indent(level + 1, frm);
+				printf("VBR: %s\n",
+						tmp & 0x8000 ? "Yes" : "No");
+				p_indent(level + 1, frm);
+				printf("Bit Rate Indexes: ");
+				if (tmp & 0x8000) {
+					printf("n/a");
+				} else {
+					for (i = 0; i < 15; i++, tmp >>= 1)
+						if (tmp & 0x0001)
+							printf("%d ", i);
+				}
+				printf("\n");
+				break;
 			case 2:
 				tmp = get_u8(frm);
 				p_indent(level + 1, frm);
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux