avprofile.c 19.7 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 19 20 21
/*
  The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
  Copyright (C) 2001  Simon MORLAT simon.morlat@linphone.org

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library 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
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/


#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 79
#define NO_AVPF		{PAYLOAD_TYPE_AVPF_NONE, 0}
#define AVPF(feat, intv)		{(feat), (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 176
PayloadType payload_type_gsm={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
177
	CLOCK_RATE(8000),
178
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
179
	ZERO_PATTERN(NULL),
180 181 182 183 184 185
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(13500),
	MIME_TYPE("GSM"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
186
	NO_AVPF,
187
	FLAGS(0)
aymeric's avatar
aymeric committed
188 189
};

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

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

Simon Morlat's avatar
Simon Morlat committed
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
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
235
PayloadType payload_type_g729={
236
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
237
	CLOCK_RATE(8000),
238
	BITS_PER_SAMPLE(0),
aymeric's avatar
aymeric committed
239
	ZERO_PATTERN(NULL),
240 241 242 243 244 245
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(8000),
	MIME_TYPE("G729"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
246
	NO_AVPF,
247
	FLAGS(0)
aymeric's avatar
aymeric committed
248 249
};

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

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

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

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

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

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

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

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

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

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


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

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

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


#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";
	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 475
	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);
}
476

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

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

PayloadType payload_type_speex_wb={
509
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
510 511 512 513 514
	CLOCK_RATE(16000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(28000),
515
	MIME_TYPE("speex"),
516 517 518
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
519
	NO_AVPF,
520
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
521 522 523
};

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

PayloadType payload_type_ilbc={
539
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
aymeric's avatar
aymeric committed
540 541 542 543
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
544
	NORMAL_BITRATE(13300), /* the minimum, with 30ms frames */
545
	MIME_TYPE("iLBC"),
aymeric's avatar
aymeric committed
546
	CHANNELS(1),
547 548
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
549
	NO_AVPF,
550
	FLAGS(0)
aymeric's avatar
aymeric committed
551 552 553 554 555 556 557 558
};

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
559
	NORMAL_BITRATE(12200),
560
	MIME_TYPE("AMR"),
561 562 563
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
564
	NO_AVPF,
565
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
566 567 568 569 570 571 572 573
};

PayloadType payload_type_amrwb={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(16000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
574
	NORMAL_BITRATE(23850),
575
	MIME_TYPE("AMR-WB"),
576 577 578
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
579
	NO_AVPF,
580
	FLAGS(PAYLOAD_TYPE_IS_VBR)
aymeric's avatar
aymeric committed
581 582
};

Simon Morlat's avatar
Simon Morlat committed
583 584 585 586 587 588 589 590 591 592 593
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
594
PayloadType payload_type_mp4v={
595
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
596 597 598 599 600
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
601 602 603 604
	MIME_TYPE("MP4V-ES"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
605
	NO_AVPF,
606
	FLAGS(0)
aymeric's avatar
aymeric committed
607 608 609 610 611 612 613 614 615 616
};


PayloadType payload_type_evrc0={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
617 618 619 620
	MIME_TYPE("EVRC0"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
621
	NO_AVPF,
622
	FLAGS(0)
aymeric's avatar
aymeric committed
623 624
};

smorlat's avatar
smorlat committed
625 626 627 628 629 630 631
PayloadType payload_type_evrcb0={
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
	CLOCK_RATE(8000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
632 633 634 635
	MIME_TYPE("EVRCB0"),
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
636
	NO_AVPF,
637
	FLAGS(0)
smorlat's avatar
smorlat committed
638
};
639

aymeric's avatar
aymeric committed
640
PayloadType payload_type_h263_1998={
641
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
642 643 644 645 646
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
647 648 649 650
	MIME_TYPE("H263-1998"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
651
	NO_AVPF,
652
	FLAGS(0)
aymeric's avatar
aymeric committed
653 654 655
};

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

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

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

PayloadType payload_type_x_snow={
701
	TYPE(PAYLOAD_VIDEO),
aymeric's avatar
aymeric committed
702 703 704 705 706
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
707 708 709 710
	MIME_TYPE("x-snow"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
711
	NO_AVPF,
712
	FLAGS(0)
aymeric's avatar
aymeric committed
713 714
};

715
PayloadType payload_type_jpeg={
716
	TYPE(PAYLOAD_VIDEO),
717 718 719 720 721
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
722 723 724 725
	MIME_TYPE("JPEG"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
726
	NO_AVPF,
727
	FLAGS(0)
728 729
};

730
PayloadType payload_type_vp8={
731
	TYPE(PAYLOAD_VIDEO),
732 733 734 735 736
	CLOCK_RATE(90000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(256000),
737 738 739 740
	MIME_TYPE("VP8"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
741
	AVPF(PAYLOAD_TYPE_AVPF_FIR | PAYLOAD_TYPE_AVPF_PLI | PAYLOAD_TYPE_AVPF_SLI | PAYLOAD_TYPE_AVPF_RPSI, RTCP_DEFAULT_REPORT_INTERVAL),
742
	FLAGS(PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED)
743
};
744

aymeric's avatar
aymeric committed
745
PayloadType	payload_type_t140={
746
	TYPE(PAYLOAD_TEXT),
747 748 749 750 751
	CLOCK_RATE(1000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(0),
752 753 754 755
	MIME_TYPE("t140"),
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
756
	NO_AVPF,
757
	FLAGS(0)
758 759 760 761 762 763 764 765 766 767
};

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"),
768 769 770
	CHANNELS(0),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
771
	NO_AVPF,
772
	FLAGS(0)
aymeric's avatar
aymeric committed
773 774 775
};

PayloadType	payload_type_x_udpftp={
776 777 778 779 780 781 782 783 784 785
	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),
786
	NO_AVPF,
787
	FLAGS(0)
aymeric's avatar
aymeric committed
788 789
};

Simon Morlat's avatar
Simon Morlat committed
790
PayloadType payload_type_g722={
791 792 793 794 795 796 797 798 799 800
	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),
801
	NO_AVPF,
802
	FLAGS(0)
Simon Morlat's avatar
Simon Morlat committed
803 804
};

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

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

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

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

865 866 867 868 869 870 871 872 873 874 875 876 877 878 879
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)
};

880
PayloadType payload_type_aaceld_22k={
881
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
johan's avatar
johan committed
882
	CLOCK_RATE(22050),
883
	BITS_PER_SAMPLE(0),
johan's avatar
johan committed
884
	ZERO_PATTERN(NULL),
885
	PATTERN_LENGTH(0),
johan's avatar
johan committed
886
	NORMAL_BITRATE(32000),
887
	MIME_TYPE("mpeg4-generic"),
888 889 890
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
891
	NO_AVPF,
892
	FLAGS(PAYLOAD_TYPE_IS_VBR)
johan's avatar
johan committed
893 894
};

895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
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
910
PayloadType payload_type_aaceld_44k={
911
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
johan's avatar
johan committed
912
	CLOCK_RATE(44100),
913
	BITS_PER_SAMPLE(0),
johan's avatar
johan committed
914
	ZERO_PATTERN(NULL),
915
	PATTERN_LENGTH(0),
johan's avatar
johan committed
916
	NORMAL_BITRATE(64000),
917
	MIME_TYPE("mpeg4-generic"),
918
	CHANNELS(1),
919 920
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
921
	NO_AVPF,
922
	FLAGS(PAYLOAD_TYPE_IS_VBR)
Ghislain MARY's avatar
Ghislain MARY committed
923 924
};

925 926 927 928 929 930 931 932 933 934 935 936 937 938 939
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
940 941
PayloadType payload_type_opus = {
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
942
	CLOCK_RATE(48000), /*mandatory according to RFC*/
Ghislain MARY's avatar
Ghislain MARY committed
943 944 945 946 947
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(20000),
	MIME_TYPE("opus"),
948 949 950
	CHANNELS(2), /*mandatory according to RFC*/
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
951
	NO_AVPF,
952
	FLAGS(PAYLOAD_TYPE_IS_VBR)
Ghislain MARY's avatar
Ghislain MARY committed
953
};
954 955

PayloadType payload_type_isac = {
956
	TYPE(PAYLOAD_AUDIO_PACKETIZED),
957 958 959 960 961 962
	CLOCK_RATE(16000),
	BITS_PER_SAMPLE(0),
	ZERO_PATTERN(NULL),
	PATTERN_LENGTH(0),
	NORMAL_BITRATE(32000),
	MIME_TYPE("iSAC"),
963 964 965
	CHANNELS(1),
	RECV_FMTP(NULL),
	SEND_FMTP(NULL),
966
	NO_AVPF,
967
	FLAGS(PAYLOAD_TYPE_IS_VBR)
968
};