-
Notifications
You must be signed in to change notification settings - Fork 108
/
codecs.h
166 lines (154 loc) · 3.63 KB
/
codecs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#ifndef CODECS_H
#define CODECS_H
#define PAYLOAD_PCMU 0
#define PAYLOAD_GSM 3
#define PAYLOAD_G723 4
#define PAYLOAD_PCMA 8
#define PAYLOAD_G722 9
#define PAYLOAD_G729 18
#define PAYLOAD_ILBC 97
#define PAYLOAD_SPEEX 98
#define PAYLOAD_CLEARMODE 100
#define PAYLOAD_SILK 301
#define PAYLOAD_SILK8 302
#define PAYLOAD_SILK12 303
#define PAYLOAD_SILK16 304
#define PAYLOAD_SILK24 305
#define PAYLOAD_ISAC 306
#define PAYLOAD_ISAC16 307
#define PAYLOAD_ISAC32 308
#define PAYLOAD_OPUS 311
#define PAYLOAD_OPUS8 312
#define PAYLOAD_OPUS12 313
#define PAYLOAD_OPUS16 314
#define PAYLOAD_OPUS24 315
#define PAYLOAD_OPUS48 316
#define PAYLOAD_AMR 320
#define PAYLOAD_AMRWB 321
#define PAYLOAD_G7221 331
#define PAYLOAD_G72218 331
#define PAYLOAD_G722112 332
#define PAYLOAD_G722116 333
#define PAYLOAD_G722124 334
#define PAYLOAD_G722132 335
#define PAYLOAD_G722148 336
#define PAYLOAD_XOPUS 337
#define PAYLOAD_XOPUS8 338
#define PAYLOAD_XOPUS12 339
#define PAYLOAD_XOPUS16 340
#define PAYLOAD_XOPUS24 341
#define PAYLOAD_XOPUS48 342
#define PAYLOAD_VXOPUS 343
#define PAYLOAD_VXOPUS8 344
#define PAYLOAD_VXOPUS12 345
#define PAYLOAD_VXOPUS16 346
#define PAYLOAD_VXOPUS24 347
#define PAYLOAD_VXOPUS48 348
#define PAYLOAD_MP4ALATM128 349
#define PAYLOAD_MP4ALATM64 350
#define PAYLOAD_G72616 351
#define PAYLOAD_G72624 352
#define PAYLOAD_G72632 353
#define PAYLOAD_G72640 354
#define PAYLOAD_AAL2_G72616 355
#define PAYLOAD_AAL2_G72624 356
#define PAYLOAD_AAL2_G72632 357
#define PAYLOAD_AAL2_G72640 358
#define PAYLOAD_EVS 359
#define PAYLOAD_TELEVENT 400
#define PAYLOAD_VIDEO 10000
inline const char *codec2text(int codec) {
switch(codec) {
case PAYLOAD_PCMU:
return "G.711 ulaw";
case PAYLOAD_GSM:
return "GSM";
case PAYLOAD_G723:
return "G.723";
case PAYLOAD_PCMA:
return "G.711 alaw";
case PAYLOAD_G722:
return "G.722";
case PAYLOAD_G729:
return "G.729";
case PAYLOAD_ILBC:
return "iLBC";
case PAYLOAD_SPEEX:
return "speex";
case PAYLOAD_CLEARMODE:
return "clearmode";
case PAYLOAD_SILK:
case PAYLOAD_SILK8:
case PAYLOAD_SILK12:
case PAYLOAD_SILK16:
case PAYLOAD_SILK24:
return "SILK";
case PAYLOAD_ISAC:
case PAYLOAD_ISAC16:
case PAYLOAD_ISAC32:
return "iSAC";
case PAYLOAD_OPUS:
case PAYLOAD_OPUS8:
case PAYLOAD_OPUS12:
case PAYLOAD_OPUS16:
case PAYLOAD_OPUS24:
case PAYLOAD_OPUS48:
return "OPUS";
case PAYLOAD_AMR:
return "amr";
case PAYLOAD_AMRWB:
return "amr-wb";
case PAYLOAD_G72218:
case PAYLOAD_G722112:
case PAYLOAD_G722116:
case PAYLOAD_G722124:
case PAYLOAD_G722132:
case PAYLOAD_G722148:
return "G.722.1";
case PAYLOAD_XOPUS:
case PAYLOAD_XOPUS8:
case PAYLOAD_XOPUS12:
case PAYLOAD_XOPUS16:
case PAYLOAD_XOPUS24:
case PAYLOAD_XOPUS48:
return "XOPUS";
case PAYLOAD_VXOPUS:
case PAYLOAD_VXOPUS8:
case PAYLOAD_VXOPUS12:
case PAYLOAD_VXOPUS16:
case PAYLOAD_VXOPUS24:
case PAYLOAD_VXOPUS48:
return "VXOPUS";
case PAYLOAD_TELEVENT:
return "TELEPHONE EVENT";
case PAYLOAD_MP4ALATM128:
case PAYLOAD_MP4ALATM64:
return "MP4A-LATM";
case PAYLOAD_G72616:
case PAYLOAD_G72624:
case PAYLOAD_G72632:
case PAYLOAD_G72640:
return "G726";
case PAYLOAD_AAL2_G72616:
case PAYLOAD_AAL2_G72624:
case PAYLOAD_AAL2_G72632:
case PAYLOAD_AAL2_G72640:
return "AAL2-G726";
case PAYLOAD_EVS:
return "EVS";
default:
return "UNKNOWN CODEC NUMBER";
}
}
#define USE_ILBC_ENHANCER 0
#define ILBC_MS 30
/* #define ILBC_MS 20 */
#define ILBC_FRAME_LEN 50 /* apparently... */
#define ILBC_SAMPLES 240 /* 30ms at 8000 hz */
#define GSM_SAMPLES 160
#define GSM_FRAME_LEN 33
#define MSGSM_FRAME_LEN 65
#define BUFFER_SAMPLES 8000
#define CODEC_LEN 1
#define UNLINK_RAW 1
#endif //CODECS_H