avprofile.c 20.4 KB
Newer Older
aymeric's avatar
aymeric committed
1
/*
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
 * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features.
 * Copyright (C) 2017 Belledonne Communications SARL
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
aymeric's avatar
aymeric committed
19 20 21


#include <ortp/payloadtype.h>
22
#include <ortp/rtpprofile.h>
23 24
#include <ortp/ortp.h>
#include <ortp/rtcp.h>
aymeric's avatar
aymeric committed
25

26 27
char offset127=127;
char offset0xD5=(char)0xD5;
aymeric's avatar
aymeric committed
28 29
char offset0[4] = {0x00, 0x00, 0x00, 0x00};

30
/*
aymeric's avatar
aymeric committed
31 32 33 34 35
 * IMPORTANT : some compiler don't support the tagged-field syntax. Those
 * macros are there to trap the problem This means that if you want to keep
 * portability, payload types must be defined with their fields in the right
 * order.
 */
Simon Morlat's avatar
Simon Morlat committed
36
#if defined(_ISOC99_SOURCE) || defined(__clang__)
aymeric's avatar
aymeric committed
37 38 39 40 41 42 43 44 45
// ISO C99's tagged syntax
#define TYPE(val)		.type=(val)
#define CLOCK_RATE(val)		.clock_rate=(val)
#define BITS_PER_SAMPLE(val)	.bits_per_sample=(val)
#define ZERO_PATTERN(val)	.zero_pattern=(val)
#define PATTERN_LENGTH(val)	.pattern_length=(val)
#define NORMAL_BITRATE(val)	.normal_bitrate=(val)
#define MIME_TYPE(val)		.mime_type=(val)
#define CHANNELS(val)		.channels=(val)
46 47
#define RECV_FMTP(val)		.recv_fmtp=(val)
#define SEND_FMTP(val)		.send_fmtp=(val)
48 49
#define NO_AVPF		.avpf={.features=PAYLOAD_TYPE_AVPF_NONE, .trr_interval=0}
#define AVPF(feat, intv)		.avpf={.features=(feat), .trr_interval=(intv)}
50
#define FLAGS(val)		.flags=(val)
aymeric's avatar
aymeric committed
51 52 53 54 55 56 57 58 59 60
#elif defined(__GNUC__)
// GCC's legacy tagged syntax (even old versions have it)
#define TYPE(val)		type: (val)
#define CLOCK_RATE(val)		clock_rate: (val)
#define BITS_PER_SAMPLE(val)	bits_per_sample: (val)
#define ZERO_PATTERN(val)	zero_pattern: (val)
#define PATTERN_LENGTH(val)	pattern_length: (val)
#define NORMAL_BITRATE(val)	normal_bitrate: (val)
#define MIME_TYPE(val)		mime_type: (val)
#define CHANNELS(val)		channels: (val)
61 62
#define RECV_FMTP(val)		recv_fmtp: (val)
#define SEND_FMTP(val)		send_fmtp: (val)
63 64
#define NO_AVPF		avpf: {features: PAYLOAD_TYPE_AVPF_NONE, trr_interval: 0}
#define AVPF(feat, intv)		avpf: {features: (feat), trr_interval: (intv)}
65
#define FLAGS(val)		flags: (val)
aymeric's avatar
aymeric committed
66 67 68 69 70 71 72 73 74 75
#else
// No tagged syntax supported
#define TYPE(val)		(val)
#define CLOCK_RATE(val)		(val)
#define BITS_PER_SAMPLE(val)	(val)
#define ZERO_PATTERN(val)	(val)
#define PATTERN_LENGTH(val)	(val)
#define NORMAL_BITRATE(val)	(val)
#define MIME_TYPE(val)		(val)
#define CHANNELS(val)		(val)
76 77
#define RECV_FMTP(val)		(val)
#define SEND_FMTP(val)		(val)
78
#define NO_AVPF		{PAYLOAD_TYPE_AVPF_NONE, 0}
79
#define AVPF(feat, intv)		{(feat), FALSE, (intv)}
80
#define FLAGS(val)		(val)
aymeric's avatar
aymeric committed
81 82 83 84

#endif

PayloadType payload_type_pcmu8000={
85 86
	TYPE(PAYLOAD_AUDIO_CONTINUOUS),
	CLOCK_RATE(8000),
aymeric's avatar
aymeric committed
87 88
	BITS_PER_SAMPLE(8),
	ZERO_PATTERN( &offset127),
89 90 91 92 93 94
	PATTERN_LENGTH(1),
	NORMAL_BITRATE(64000),
	MIME_TYPE("PCMU"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
95
	NO_AVPF,
96
	FLAGS(0)
aymeric's avatar
aymeric committed
97 98 99
};

PayloadType payload_type_pcma8000={
100
	TYPE(PAYLOAD_AUDIO_CONTINUOUS),
aymeric's avatar
aymeric committed
101 102
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(8),
103 104 105 106 107 108 109
	ZERO_PATTERN(&offset0xD5),
	PATTERN_LENGTH(1),
	NORMAL_BITRATE(64000),
	MIME_TYPE("PCMA"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
110
	NO_AVPF,
111
	FLAGS(0)
aymeric's avatar
aymeric committed
112 113 114
};

PayloadType payload_type_pcm8000={
115
	TYPE(PAYLOAD_AUDIO_CONTINUOUS),
aymeric's avatar
aymeric committed
116 117
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(16),
118
	ZERO_PATTERN(offset0),
aymeric's avatar
aymeric committed
119
	PATTERN_LENGTH(1),
120 121 122 123 124
	NORMAL_BITRATE(128000),
	MIME_TYPE("PCM"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
125
	NO_AVPF,
126
	FLAGS(0)
aymeric's avatar
aymeric committed
127 128 129
};

PayloadType payload_type_l16_mono={
130
	TYPE(PAYLOAD_AUDIO_CONTINUOUS),
aymeric's avatar
aymeric committed
131 132
	CLOCK_RATE(44100),
	BITS_PER_SAMPLE(16),
133
	ZERO_PATTERN(offset0),
aymeric's avatar
aymeric committed
134 135
	PATTERN_LENGTH(2),
	NORMAL_BITRATE(705600),				/* (44100 x 16bits per frame x 1 channel) */
136 137 138 139
	MIME_TYPE("L16"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
140
	NO_AVPF,
141
	FLAGS(0)
aymeric's avatar
aymeric committed
142 143 144
};

PayloadType payload_type_l16_stereo={
145
	TYPE(PAYLOAD_AUDIO_CONTINUOUS),
aymeric's avatar
aymeric committed
146 147
	CLOCK_RATE(44100),
	BITS_PER_SAMPLE(32),				/* 16bits x 2 channels */
148
	ZERO_PATTERN(offset0),
aymeric's avatar
aymeric committed
149 150
	PATTERN_LENGTH(4),
	NORMAL_BITRATE(1411200),			/* (44100 x 16bits per frame x 2 channels) */
151 152 153 154
	MIME_TYPE("L16"),
	CHANNELS(2),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
155
	NO_AVPF,
156
	FLAGS(0)
aymeric's avatar
aymeric committed
157 158 159
};

PayloadType payload_type_lpc1016={
160
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
161
	CLOCK_RATE(8000),
162 163 164 165 166 167 168 169
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(2400),
	MIME_TYPE("1016"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
170
	NO_AVPF,
171
	FLAGS(0)
aymeric's avatar
aymeric committed
172 173
};

174 175
PayloadType payload_type_gsm={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
176
	CLOCK_RATE(8000),
177
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
178
	ZERO_PATTERN(NULL),
179 180 181 182 183 184
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(13500),
	MIME_TYPE("GSM"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
185
	NO_AVPF,
186
	FLAGS(0)
aymeric's avatar
aymeric committed
187 188
};

189 190
PayloadType payload_type_lpc={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
191
	CLOCK_RATE(8000),
192
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
193
	ZERO_PATTERN(NULL),
194 195 196 197 198 199
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(5600),		/* 20ms / 14 octets per frame */
	MIME_TYPE("LPC"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
200
	NO_AVPF,
201
	FLAGS(0)
aymeric's avatar
aymeric committed
202 203
};

204 205
PayloadType payload_type_g7231={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
206
	CLOCK_RATE(8000),
207
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
208
	ZERO_PATTERN(NULL),
209 210 211 212 213 214
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(6300),
	MIME_TYPE("G723"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
215
	NO_AVPF,
216
	FLAGS(0)
aymeric's avatar
aymeric committed
217 218
};

Simon Morlat's avatar
Simon Morlat committed
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
PayloadType payload_type_cn={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(8000),
	MIME_TYPE("CN"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
	NO_AVPF,
	FLAGS(0)
};

aymeric's avatar
aymeric committed
234
PayloadType payload_type_g729={
235
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
236
	CLOCK_RATE(8000),
237
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
238
	ZERO_PATTERN(NULL),
239 240 241 242 243 244
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(8000),
	MIME_TYPE("G729"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
245
	NO_AVPF,
246
	FLAGS(0)
aymeric's avatar
aymeric committed
247 248
};

aymeric's avatar
aymeric committed
249
PayloadType payload_type_g7221={
250
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
251
	CLOCK_RATE(16000),
252
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
253
	ZERO_PATTERN(NULL),
254 255 256 257 258 259
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(24000),
	MIME_TYPE("G7221"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
260
	NO_AVPF,
261
	FLAGS(0)
aymeric's avatar
aymeric committed
262 263
};

aymeric's avatar
aymeric committed
264
PayloadType payload_type_g726_40={
265
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
266
	CLOCK_RATE(8000),
267
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
268
	ZERO_PATTERN(NULL),
269 270 271 272 273 274
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(40000),
	MIME_TYPE("G726-40"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
275
	NO_AVPF,
276
	FLAGS(0)
aymeric's avatar
aymeric committed
277 278 279
};

PayloadType payload_type_g726_32={
280
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
281
	CLOCK_RATE(8000),
282
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
283
	ZERO_PATTERN(NULL),
284 285 286 287 288 289
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(32000),
	MIME_TYPE("G726-32"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
290
	NO_AVPF,
291
	FLAGS(0)
aymeric's avatar
aymeric committed
292 293 294
};

PayloadType payload_type_g726_24={
295
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
296
	CLOCK_RATE(8000),
297
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
298
	ZERO_PATTERN(NULL),
299 300 301 302 303 304
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(24000),
	MIME_TYPE("G726-24"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
305
	NO_AVPF,
306
	FLAGS(0)
aymeric's avatar
aymeric committed
307 308 309
};

PayloadType payload_type_g726_16={
310
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
311
	CLOCK_RATE(8000),
312
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
313
	ZERO_PATTERN(NULL),
314 315 316 317 318 319
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(16000),
	MIME_TYPE("G726-16"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
320
	NO_AVPF,
321
	FLAGS(0)
aymeric's avatar
aymeric committed
322 323
};

Simon Morlat's avatar
Simon Morlat committed
324
PayloadType payload_type_aal2_g726_40={
325
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
Simon Morlat's avatar
Simon Morlat committed
326
	CLOCK_RATE(8000),
327
	BITS_PER_SAMPLE(0),
Simon Morlat's avatar
Simon Morlat committed
328
	ZERO_PATTERN(NULL),
329 330 331 332 333 334
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(40000),
	MIME_TYPE("AAL2-G726-40"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
335
	NO_AVPF,
336
	FLAGS(0)
Simon Morlat's avatar
Simon Morlat committed
337 338 339
};

PayloadType payload_type_aal2_g726_32={
340
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
Simon Morlat's avatar
Simon Morlat committed
341
	CLOCK_RATE(8000),
342
	BITS_PER_SAMPLE(0),
Simon Morlat's avatar
Simon Morlat committed
343
	ZERO_PATTERN(NULL),
344 345 346 347 348 349
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(32000),
	MIME_TYPE("AAL2-G726-32"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
350
	NO_AVPF,
351
	FLAGS(0)
Simon Morlat's avatar
Simon Morlat committed
352 353 354
};

PayloadType payload_type_aal2_g726_24={
355
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
Simon Morlat's avatar
Simon Morlat committed
356
	CLOCK_RATE(8000),
357
	BITS_PER_SAMPLE(0),
Simon Morlat's avatar
Simon Morlat committed
358
	ZERO_PATTERN(NULL),
359 360 361 362 363 364
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(24000),
	MIME_TYPE("AAL2-G726-24"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
365
	NO_AVPF,
366
	FLAGS(0)
Simon Morlat's avatar
Simon Morlat committed
367 368 369
};

PayloadType payload_type_aal2_g726_16={
370
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
Simon Morlat's avatar
Simon Morlat committed
371
	CLOCK_RATE(8000),
372
	BITS_PER_SAMPLE(0),
Simon Morlat's avatar
Simon Morlat committed
373
	ZERO_PATTERN(NULL),
374 375 376 377 378 379
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(16000),
	MIME_TYPE("AAL2-G726-16"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
380
	NO_AVPF,
381
	FLAGS(0)
Simon Morlat's avatar
Simon Morlat committed
382 383
};

384 385
PayloadType payload_type_mpv={
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
386 387 388 389
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
390 391 392 393 394
	NORMAL_BITRATE(256000),
	MIME_TYPE("MPV"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
395
	NO_AVPF,
396
	FLAGS(0)
aymeric's avatar
aymeric committed
397 398 399 400
};


PayloadType payload_type_h261={
401
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
402 403 404 405 406
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
407 408 409 410
	MIME_TYPE("H261"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
411
	NO_AVPF,
412
	FLAGS(0)
aymeric's avatar
aymeric committed
413 414 415
};

PayloadType payload_type_h263={
416
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
417 418 419 420 421
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
422 423 424 425
	MIME_TYPE("H263"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
426
	NO_AVPF,
427
	FLAGS(0)
aymeric's avatar
aymeric committed
428 429
};

430 431
PayloadType payload_type_truespeech={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
432
	CLOCK_RATE(8000),
433
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
434
	ZERO_PATTERN(NULL),
435
	PATTERN_LENGTH(0),
aymeric's avatar
aymeric committed
436
	NORMAL_BITRATE(8536),
437 438 439 440
	MIME_TYPE("TSP0"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
441
	NO_AVPF,
442
	FLAGS(0)
aymeric's avatar
aymeric committed
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459
};


#ifdef __cplusplus
extern "C"
{
#endif
RtpProfile av_profile;
#ifdef __cplusplus
}
#endif


void av_profile_init(RtpProfile *profile)
{
	rtp_profile_clear_all(profile);
	profile->name="AV profile";
Sandrine Avakian's avatar
Sandrine Avakian committed
460
	
aymeric's avatar
aymeric committed
461 462 463 464 465 466
	rtp_profile_set_payload(profile,0,&payload_type_pcmu8000);
	rtp_profile_set_payload(profile,1,&payload_type_lpc1016);
	rtp_profile_set_payload(profile,3,&payload_type_gsm);
	rtp_profile_set_payload(profile,7,&payload_type_lpc);
	rtp_profile_set_payload(profile,4,&payload_type_g7231);
	rtp_profile_set_payload(profile,8,&payload_type_pcma8000);
Simon Morlat's avatar
Simon Morlat committed
467
	rtp_profile_set_payload(profile,9,&payload_type_g722);
aymeric's avatar
aymeric committed
468 469
	rtp_profile_set_payload(profile,10,&payload_type_l16_stereo);
	rtp_profile_set_payload(profile,11,&payload_type_l16_mono);
Simon Morlat's avatar
Simon Morlat committed
470
	rtp_profile_set_payload(profile,13,&payload_type_cn);
aymeric's avatar
aymeric committed
471 472 473 474
	rtp_profile_set_payload(profile,18,&payload_type_g729);
	rtp_profile_set_payload(profile,31,&payload_type_h261);
	rtp_profile_set_payload(profile,32,&payload_type_mpv);
	rtp_profile_set_payload(profile,34,&payload_type_h263);
Sandrine Avakian's avatar
Sandrine Avakian committed
475

aymeric's avatar
aymeric committed
476
}
477

aymeric's avatar
aymeric committed
478 479
/* these are extra payload types that can be used dynamically */
PayloadType payload_type_lpc1015={
480
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
481 482 483 484 485
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(2400),
486 487 488 489
	MIME_TYPE("1015"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
490
	NO_AVPF,
491
	FLAGS(0)
aymeric's avatar
aymeric committed
492 493 494
};

PayloadType payload_type_speex_nb={
495
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
496 497 498 499 500
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(8000),   /*not true: 8000 is the minimum*/
501
	MIME_TYPE("speex"),
502 503 504
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
505
	NO_AVPF,
506
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
507 508
};

509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
PayloadType payload_type_bv16={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(16000),/* 5ms / 80 bits per frame */
	MIME_TYPE("BV16"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
	NO_AVPF,
	FLAGS(0)
};

aymeric's avatar
aymeric committed
524
PayloadType payload_type_speex_wb={
525
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
526 527 528 529 530
	CLOCK_RATE(16000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(28000),
531
	MIME_TYPE("speex"),
532 533 534
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
535
	NO_AVPF,
536
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
537 538 539
};

PayloadType payload_type_speex_uwb={
540
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
541 542 543 544 545
	CLOCK_RATE(32000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(28000),
546
	MIME_TYPE("speex"),
547 548 549
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
550
	NO_AVPF,
551
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
552 553 554
};

PayloadType payload_type_ilbc={
555
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
556 557 558 559
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
560
	NORMAL_BITRATE(13300), /* the minimum, with 30ms frames */
561
	MIME_TYPE("iLBC"),
aymeric's avatar
aymeric committed
562
	CHANNELS(1),
563 564
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
565
	NO_AVPF,
566
	FLAGS(0)
aymeric's avatar
aymeric committed
567 568 569 570 571 572 573 574
};

PayloadType payload_type_amr={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
Simon Morlat's avatar
Simon Morlat committed
575
	NORMAL_BITRATE(12200),
576
	MIME_TYPE("AMR"),
577 578 579
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
580
	NO_AVPF,
581
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
582 583 584 585 586 587 588 589
};

PayloadType payload_type_amrwb={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(16000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
590
	NORMAL_BITRATE(23850),
591
	MIME_TYPE("AMR-WB"),
592 593 594
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
595
	NO_AVPF,
596
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
597 598
};

Simon Morlat's avatar
Simon Morlat committed
599 600 601 602 603 604 605 606 607 608 609
PayloadType payload_type_gsm_efr={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(12200),
	MIME_TYPE ("GSM-EFR"),
	CHANNELS(1)
};

aymeric's avatar
aymeric committed
610
PayloadType payload_type_mp4v={
611
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
612 613 614 615 616
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
617 618 619 620
	MIME_TYPE("MP4V-ES"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
621
	AVPF(PAYLOAD_TYPE_AVPF_FIR | PAYLOAD_TYPE_AVPF_PLI, RTCP_DEFAULT_REPORT_INTERVAL),
622
	FLAGS(0)
aymeric's avatar
aymeric committed
623 624 625 626 627 628 629 630 631 632
};


PayloadType payload_type_evrc0={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
633 634 635 636
	MIME_TYPE("EVRC0"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
637
	NO_AVPF,
638
	FLAGS(0)
aymeric's avatar
aymeric committed
639 640
};

smorlat's avatar
smorlat committed
641 642 643 644 645 646 647
PayloadType payload_type_evrcb0={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
648 649 650 651
	MIME_TYPE("EVRCB0"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
652
	NO_AVPF,
653
	FLAGS(0)
smorlat's avatar
smorlat committed
654
};
655

aymeric's avatar
aymeric committed
656
PayloadType payload_type_h263_1998={
657
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
658 659 660 661 662
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
663 664 665 666
	MIME_TYPE("H263-1998"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
667
	NO_AVPF,
668
	FLAGS(0)
aymeric's avatar
aymeric committed
669 670 671
};

PayloadType payload_type_h263_2000={
672
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
673 674 675 676 677
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
678 679 680 681
	MIME_TYPE("H263-2000"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
682
	NO_AVPF,
683
	FLAGS(0)
aymeric's avatar
aymeric committed
684 685 686
};

PayloadType payload_type_theora={
687
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
688 689 690 691 692
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
693 694 695 696
	MIME_TYPE("theora"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
697
	NO_AVPF,
698
	FLAGS(0)
aymeric's avatar
aymeric committed
699 700 701
};

PayloadType payload_type_h264={
702
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
703 704 705 706 707
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
708 709 710 711
	MIME_TYPE("H264"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
Ghislain MARY's avatar
Ghislain MARY committed
712 713
	AVPF(PAYLOAD_TYPE_AVPF_FIR | PAYLOAD_TYPE_AVPF_PLI, RTCP_DEFAULT_REPORT_INTERVAL),
	FLAGS(PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED)
aymeric's avatar
aymeric committed
714 715 716
};

PayloadType payload_type_x_snow={
717
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
718 719 720 721 722
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
723 724 725 726
	MIME_TYPE("x-snow"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
727
	NO_AVPF,
728
	FLAGS(0)
aymeric's avatar
aymeric committed
729 730
};

731
PayloadType payload_type_jpeg={
732
	TYPE(PAYLOAD_VIDEO),
733 734 735 736 737
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
738 739 740 741
	MIME_TYPE("JPEG"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
742
	NO_AVPF,
743
	FLAGS(0)
744 745
};

746
PayloadType payload_type_vp8={
747
	TYPE(PAYLOAD_VIDEO),
748 749 750 751 752
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
753 754 755 756
	MIME_TYPE("VP8"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
757
	AVPF(PAYLOAD_TYPE_AVPF_FIR | PAYLOAD_TYPE_AVPF_PLI | PAYLOAD_TYPE_AVPF_SLI | PAYLOAD_TYPE_AVPF_RPSI, RTCP_DEFAULT_REPORT_INTERVAL),
758
	FLAGS(PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED)
759
};
760

aymeric's avatar
aymeric committed
761
PayloadType	payload_type_t140={
762
	TYPE(PAYLOAD_TEXT),
763 764 765 766 767
	CLOCK_RATE(1000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
768 769 770 771
	MIME_TYPE("t140"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
772
	NO_AVPF,
773
	FLAGS(0)
774 775 776 777 778 779 780 781 782 783
};

PayloadType payload_type_t140_red={
	TYPE(PAYLOAD_TEXT),
	CLOCK_RATE(1000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
	MIME_TYPE("red"),
784 785 786
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
787
	NO_AVPF,
788
	FLAGS(0)
aymeric's avatar
aymeric committed
789 790 791
};

PayloadType	payload_type_x_udpftp={
792 793 794 795 796 797 798 799 800 801
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(1000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
	MIME_TYPE("x-udpftp"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
802
	NO_AVPF,
803
	FLAGS(0)
aymeric's avatar
aymeric committed
804 805
};

Simon Morlat's avatar
Simon Morlat committed
806
PayloadType payload_type_g722={
807 808 809 810 811 812 813 814 815 816
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(64000),
	MIME_TYPE("G722"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
817
	NO_AVPF,
818
	FLAGS(0)
Simon Morlat's avatar
Simon Morlat committed
819 820
};

jehan's avatar
jehan committed
821
PayloadType payload_type_silk_nb={
822
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
jehan's avatar
jehan committed
823
	CLOCK_RATE(8000),
824
	BITS_PER_SAMPLE(0),
jehan's avatar
jehan committed
825
	ZERO_PATTERN(NULL),
826
	PATTERN_LENGTH(0),
827
	NORMAL_BITRATE(13000),
828
	MIME_TYPE("SILK"),
829 830 831
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
832
	NO_AVPF,
833
	FLAGS(PAYLOAD_TYPE_IS_VBR)
jehan's avatar
jehan committed
834 835 836
};

PayloadType payload_type_silk_mb={
837
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
jehan's avatar
jehan committed
838
	CLOCK_RATE(12000),
839
	BITS_PER_SAMPLE(0),
jehan's avatar
jehan committed
840
	ZERO_PATTERN(NULL),
841
	PATTERN_LENGTH(0),
jehan's avatar
jehan committed
842
	NORMAL_BITRATE(15000),
843
	MIME_TYPE("SILK"),
844 845 846
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
847
	NO_AVPF,
848
	FLAGS(PAYLOAD_TYPE_IS_VBR)
jehan's avatar
jehan committed
849 850 851
};

PayloadType payload_type_silk_wb={
852
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
jehan's avatar
jehan committed
853
	CLOCK_RATE(16000),
854
	BITS_PER_SAMPLE(0),
jehan's avatar
jehan committed
855
	ZERO_PATTERN(NULL),
856
	PATTERN_LENGTH(0),
jehan's avatar
jehan committed
857
	NORMAL_BITRATE(20000),
858
	MIME_TYPE("SILK"),
859 860 861
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
862
	NO_AVPF,
863
	FLAGS(PAYLOAD_TYPE_IS_VBR)
jehan's avatar
jehan committed
864 865 866
};

PayloadType payload_type_silk_swb={
867
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
jehan's avatar
jehan committed
868
	CLOCK_RATE(24000),
869
	BITS_PER_SAMPLE(0),
jehan's avatar
jehan committed
870
	ZERO_PATTERN(NULL),
871
	PATTERN_LENGTH(0),
jehan's avatar
jehan committed
872
	NORMAL_BITRATE(30000),
873
	MIME_TYPE("SILK"),
874 875 876
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
877
	NO_AVPF,
878
	FLAGS(PAYLOAD_TYPE_IS_VBR)
jehan's avatar
jehan committed
879
};
Simon Morlat's avatar
Simon Morlat committed
880

881 882 883 884 885 886 887 888 889 890 891 892 893 894 895
PayloadType payload_type_aaceld_16k={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(16000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(24000),
	MIME_TYPE("mpeg4-generic"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
	NO_AVPF,
	FLAGS(PAYLOAD_TYPE_IS_VBR)
};

896
PayloadType payload_type_aaceld_22k={
897
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
johan's avatar
johan committed
898
	CLOCK_RATE(22050),
899
	BITS_PER_SAMPLE(0),
johan's avatar
johan committed
900
	ZERO_PATTERN(NULL),
901
	PATTERN_LENGTH(0),
johan's avatar
johan committed
902
	NORMAL_BITRATE(32000),
903
	MIME_TYPE("mpeg4-generic"),
904 905 906
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
907
	NO_AVPF,
908
	FLAGS(PAYLOAD_TYPE_IS_VBR)
johan's avatar
johan committed
909 910
};

911 912 913 914 915 916 917 918 919 920 921 922 923 924 925
PayloadType payload_type_aaceld_32k={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(32000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(48000),
	MIME_TYPE("mpeg4-generic"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
	NO_AVPF,
	FLAGS(PAYLOAD_TYPE_IS_VBR)
};

johan's avatar
johan committed
926
PayloadType payload_type_aaceld_44k={
927
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
johan's avatar
johan committed
928
	CLOCK_RATE(44100),
929
	BITS_PER_SAMPLE(0),
johan's avatar
johan committed
930
	ZERO_PATTERN(NULL),
931
	PATTERN_LENGTH(0),
johan's avatar
johan committed
932
	NORMAL_BITRATE(64000),
933
	MIME_TYPE("mpeg4-generic"),
934
	CHANNELS(1),
935 936
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
937
	NO_AVPF,
938
	FLAGS(PAYLOAD_TYPE_IS_VBR)
Ghislain MARY's avatar
Ghislain MARY committed
939 940
};

941 942 943 944 945 946 947 948 949 950 951 952 953 954 955
PayloadType payload_type_aaceld_48k={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(48000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(64000),
	MIME_TYPE("mpeg4-generic"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
	NO_AVPF,
	FLAGS(PAYLOAD_TYPE_IS_VBR)
};

Ghislain MARY's avatar
Ghislain MARY committed
956 957
PayloadType payload_type_opus = {
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
958
	CLOCK_RATE(48000), /*mandatory according to RFC*/
Ghislain MARY's avatar
Ghislain MARY committed
959 960 961 962 963
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(20000),
	MIME_TYPE("opus"),
964 965 966
	CHANNELS(2), /*mandatory according to RFC*/
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
967
	NO_AVPF,
968
	FLAGS(PAYLOAD_TYPE_IS_VBR)
Ghislain MARY's avatar
Ghislain MARY committed
969
};
970 971

PayloadType payload_type_isac = {
972
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
973 974 975 976 977 978
	CLOCK_RATE(16000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(32000),
	MIME_TYPE("iSAC"),
979 980 981
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
982
	NO_AVPF,
983
	FLAGS(PAYLOAD_TYPE_IS_VBR)
984
};
johan's avatar
johan committed
985 986 987 988 989 990 991 992 993 994 995 996 997 998 999

PayloadType payload_type_codec2={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(3200),
	MIME_TYPE("CODEC2"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
	NO_AVPF,
	FLAGS(0)
};