33 #define VBAN_HEADER_SIZE (4 + 1 + 1 + 1 + 1 + 16)
34 #define VBAN_STREAM_NAME_SIZE 16
35 #define VBAN_PROTOCOL_MAX_SIZE 1464
36 #define VBAN_DATA_MAX_SIZE (VBAN_PROTOCOL_MAX_SIZE - VBAN_HEADER_SIZE)
37 #define VBAN_CHANNELS_MAX_NB 256
38 #define VBAN_SAMPLES_MAX_NB 256
42 #define VBAN_PACKET_NUM_SAMPLES 256
43 #define VBAN_PACKET_MAX_SAMPLES 256
44 #define VBAN_PACKET_HEADER_BYTES 24
45 #define VBAN_PACKET_COUNTER_BYTES 4
46 #define VBAN_PACKET_MAX_LEN_BYTES (VBAN_PACKET_HEADER_BYTES + VBAN_PACKET_COUNTER_BYTES + VBAN_PACKET_MAX_SAMPLES*2)
55 uint8_t sample_format;
56 char stream_name[VBAN_STREAM_NAME_SIZE];
62 uint32_t* packet_counter;
64 uint8_t packet[VBAN_PROTOCOL_MAX_SIZE];
65 uint16_t packet_data_bytes;
66 uint16_t packet_total_bytes;
72 #define VBAN_SR_MASK 0x1F
73 #define VBAN_SR_MAXNUMBER 21
74 static long const VBanSRList[VBAN_SR_MAXNUMBER]=
76 6000, 12000, 24000, 48000, 96000, 192000, 384000,
77 8000, 16000, 32000, 64000, 128000, 256000, 512000,
78 11025, 22050, 44100, 88200, 176400, 352800, 705600
88 SAMPLE_RATE_192000_HZ,
89 SAMPLE_RATE_384000_HZ,
94 SAMPLE_RATE_128000_HZ,
95 SAMPLE_RATE_256000_HZ,
96 SAMPLE_RATE_512000_HZ,
100 SAMPLE_RATE_88200_HZ,
101 SAMPLE_RATE_176400_HZ,
102 SAMPLE_RATE_352800_HZ,
103 SAMPLE_RATE_705600_HZ
107 #define VBAN_PROTOCOL_MASK 0xE0
110 VBAN_PROTOCOL_AUDIO = 0x00,
111 VBAN_PROTOCOL_SERIAL = 0x20,
112 VBAN_PROTOCOL_TXT = 0x40,
113 VBAN_PROTOCOL_UNDEFINED_1 = 0x80,
114 VBAN_PROTOCOL_UNDEFINED_2 = 0xA0,
115 VBAN_PROTOCOL_UNDEFINED_3 = 0xC0,
116 VBAN_PROTOCOL_UNDEFINED_4 = 0xE0
119 #define VBAN_BIT_RESOLUTION_MASK 0x07
120 enum VBanBitResolution
122 VBAN_BITFMT_8_INT = 0,
126 VBAN_BITFMT_32_FLOAT,
127 VBAN_BITFMT_64_FLOAT,
130 VBAN_BIT_RESOLUTION_MAX
133 static int const VBanBitResolutionSize[VBAN_BIT_RESOLUTION_MAX] =
138 #define VBAN_RESERVED_MASK 0x08
140 #define VBAN_CODEC_MASK 0xF0
143 VBAN_CODEC_PCM = 0x00,
144 VBAN_CODEC_VBCA = 0x10,
145 VBAN_CODEC_VBCV = 0x20,
146 VBAN_CODEC_UNDEFINED_3 = 0x30,
147 VBAN_CODEC_UNDEFINED_4 = 0x40,
148 VBAN_CODEC_UNDEFINED_5 = 0x50,
149 VBAN_CODEC_UNDEFINED_6 = 0x60,
150 VBAN_CODEC_UNDEFINED_7 = 0x70,
151 VBAN_CODEC_UNDEFINED_8 = 0x80,
152 VBAN_CODEC_UNDEFINED_9 = 0x90,
153 VBAN_CODEC_UNDEFINED_10 = 0xA0,
154 VBAN_CODEC_UNDEFINED_11 = 0xB0,
155 VBAN_CODEC_UNDEFINED_12 = 0xC0,
156 VBAN_CODEC_UNDEFINED_13 = 0xD0,
157 VBAN_CODEC_UNDEFINED_14 = 0xE0,
158 VBAN_CODEC_USER = 0xF0
166 #define VBAN_BPS_MASK 0xE0
167 #define VBAN_BPS_MAXNUMBER 25
168 static long const VBanBPSList[VBAN_BPS_MAXNUMBER] =
170 0, 110, 150, 300, 600,
171 1200, 2400, 4800, 9600, 14400,
172 19200, 31250, 38400, 57600, 115200,
173 128000, 230400, 250000, 256000, 460800,
174 921600,1000000,1500000,2000000, 3000000
177 #define VBAN_DATATYPE_MASK 0x07
178 #define VBAN_DATATYPE_MAXNUMBER 1
179 enum VBanDataTypeList
181 VBAN_DATATYPE_8BITS = 0
184 #define VBAN_STREAMTYPE_MASK 0xF0
187 VBAN_TXT_ASCII = 0x00,
188 VBAN_TXT_UTF8 = 0x10,
189 VBAN_TXT_WCHAR = 0x20,
190 VBAN_TXT_UNDEFINED_3 = 0x30,
191 VBAN_TXT_UNDEFINED_4 = 0x40,
192 VBAN_TXT_UNDEFINED_5 = 0x50,
193 VBAN_TXT_UNDEFINED_6 = 0x60,
194 VBAN_TXT_UNDEFINED_7 = 0x70,
195 VBAN_TXT_UNDEFINED_8 = 0x80,
196 VBAN_TXT_UNDEFINED_9 = 0x90,
197 VBAN_TXT_UNDEFINED_10 = 0xA0,
198 VBAN_TXT_UNDEFINED_11 = 0xB0,
199 VBAN_TXT_UNDEFINED_12 = 0xC0,
200 VBAN_TXT_UNDEFINED_13 = 0xD0,
201 VBAN_TXT_UNDEFINED_14 = 0xE0,