ccRTP
Main Page
Modules
Classes
Files
Examples
File List
File Members
src
ccrtp
formats.h
Go to the documentation of this file.
1
// Copyright (C) 2002 Federico Montesino Pouzols <fedemp@altern.org>.
2
//
3
// This program is free software; you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation; either version 2 of the License, or
6
// (at your option) any later version.
7
//
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
//
17
// As a special exception, you may use this file as part of a free software
18
// library without restriction. Specifically, if other files instantiate
19
// templates or use macros or inline functions from this file, or you compile
20
// this file and link it with other files to produce an executable, this
21
// file does not by itself cause the resulting executable to be covered by
22
// the GNU General Public License. This exception does not however
23
// invalidate any other reasons why the executable file might be covered by
24
// the GNU General Public License.
25
//
26
// This exception applies only to the code released under the name GNU
27
// ccRTP. If you copy code from other releases into a copy of GNU
28
// ccRTP, as the General Public License permits, the exception does
29
// not apply to the code that you add in this way. To avoid misleading
30
// anyone as to the status of such modified files, you must delete
31
// this exception notice from them.
32
//
33
// If you write modifications of your own for GNU ccRTP, it is your choice
34
// whether to permit this exception to apply to your modifications.
35
// If you do not wish that, delete this exception notice.
36
//
37
38
#ifndef CCXX_RTP_FORMATS_H_
39
#define CCXX_RTP_FORMATS_H_
40
41
#ifdef CCXX_NAMESPACES
42
namespace
ost {
43
#endif
44
65
typedef
uint8
PayloadType
;
66
68
const
PayloadType
ptINVALID
= 128;
69
76
typedef
enum
{
77
// Types for audio formats:
78
sptPCMU
= 0,
79
firstStaticPayloadType
=
sptPCMU
,
80
// 1016 static payload type is now deprecated. Type 1 is reserved.
81
// spt1016, ///< CELP audio (FED-STD 1016) (RFC 1890)
82
sptG726_32
= 2,
83
sptGSM
,
84
sptG723
,
85
sptDVI4_8000
,
86
sptDVI4_16000
,
87
sptLPC
,
88
sptPCMA
,
89
sptG722
,
90
sptL16_DUAL
,
91
sptL16_MONO
,
92
sptQCELP
,
93
// Type 13 is reserved.
94
sptMPA
= 14,
95
sptG728
,
96
sptDVI4_11025
,
97
sptDVI4_22050
,
98
sptG729
,
99
// Type 19 is reserved. Types 20 - 23 are unassigned.
100
lastStaticAudioPayloadType
=
sptG729
,
101
102
// Types for video formats:
103
// Type 24 is unassigned.
104
sptCELB
= 25,
105
sptJPEG
,
106
// Type 27 is unassigned.
107
sptNV
= 28,
108
// Types 29 and 30 are unassigned.
109
sptH261
= 31,
110
sptMPV
,
111
sptMP2T
,
112
sptH263
,
113
// Types 35 - 71 are unassigned.
114
// Types 72 - 76 are reserved.
115
// Types 96 - 127 are dynamic.
116
lastStaticPayloadType
=
sptH263
117
}
StaticPayloadType
;
118
132
class
__EXPORT
PayloadFormat
133
{
134
public
:
140
inline
PayloadType
getPayloadType()
const
141
{
return
payloadType; }
142
151
inline
uint32 getRTPClockRate()
const
152
{
return
RTPClockRate; }
153
154
protected
:
158
PayloadFormat
()
159
{ }
160
164
inline
virtual
~
PayloadFormat
()
165
{ }
166
172
inline
void
setPayloadType(
PayloadType
pt)
173
{ payloadType = pt; }
174
180
inline
void
setRTPClockRate(uint32 rate)
181
{ RTPClockRate = rate; }
182
183
// default clock rate
184
static
const
uint32
defaultRTPClockRate
;
185
186
private
:
187
PayloadType
payloadType;
188
uint32 RTPClockRate;
189
};
190
203
class
__EXPORT
StaticPayloadFormat
:
public
PayloadFormat
204
{
205
public
:
214
StaticPayloadFormat
(
StaticPayloadType
type);
215
216
private
:
222
static
uint32 staticAudioTypesRates[
lastStaticAudioPayloadType
-
223
firstStaticPayloadType
+ 1];
224
};
225
237
class
__EXPORT
DynamicPayloadFormat
:
public
PayloadFormat
238
{
239
public
:
247
DynamicPayloadFormat
(
PayloadType
type, uint32 rate);
248
};
249
// payload
251
252
#ifdef CCXX_NAMESPACES
253
}
254
#endif
255
256
#endif // ndef CCXX_RTP_FORMATS_H_
257
Generated on Mon Sep 3 2012 01:30:02 for ccRTP by
1.8.1.1