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-2015 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 Lesser General Public License
14
// along with GNU ccRTP. If not, see <http://www.gnu.org/licenses/>.
15
//
16
// As a special exception, you may use this file as part of a free software
17
// library without restriction. Specifically, if other files instantiate
18
// templates or use macros or inline functions from this file, or you compile
19
// this file and link it with other files to produce an executable, this
20
// file does not by itself cause the resulting executable to be covered by
21
// the GNU General Public License. This exception does not however
22
// invalidate any other reasons why the executable file might be covered by
23
// the GNU General Public License.
24
//
25
// This exception applies only to the code released under the name GNU
26
// ccRTP. If you copy code from other releases into a copy of GNU
27
// ccRTP, as the General Public License permits, the exception does
28
// not apply to the code that you add in this way. To avoid misleading
29
// anyone as to the status of such modified files, you must delete
30
// this exception notice from them.
31
//
32
// If you write modifications of your own for GNU ccRTP, it is your choice
33
// whether to permit this exception to apply to your modifications.
34
// If you do not wish that, delete this exception notice.
35
//
36
37
#ifndef CCXX_RTP_FORMATS_H_
38
#define CCXX_RTP_FORMATS_H_
39
40
NAMESPACE_COMMONCPP
41
62
typedef
uint8
PayloadType
;
63
65
const
PayloadType
ptINVALID
= 128;
66
73
typedef
enum
{
74
// Types for audio formats:
75
sptPCMU
= 0,
76
firstStaticPayloadType
=
sptPCMU
,
77
// 1016 static payload type is now deprecated. Type 1 is reserved.
78
// spt1016, ///< CELP audio (FED-STD 1016) (RFC 1890)
79
sptG726_32
= 2,
80
sptGSM
,
81
sptG723
,
82
sptDVI4_8000
,
83
sptDVI4_16000
,
84
sptLPC
,
85
sptPCMA
,
86
sptG722
,
87
sptL16_DUAL
,
88
sptL16_MONO
,
89
sptQCELP
,
90
// Type 13 is reserved.
91
sptMPA
= 14,
92
sptG728
,
93
sptDVI4_11025
,
94
sptDVI4_22050
,
95
sptG729
,
96
// Type 19 is reserved. Types 20 - 23 are unassigned.
97
lastStaticAudioPayloadType
=
sptG729
,
98
99
// Types for video formats:
100
// Type 24 is unassigned.
101
sptCELB
= 25,
102
sptJPEG
,
103
// Type 27 is unassigned.
104
sptNV
= 28,
105
// Types 29 and 30 are unassigned.
106
sptH261
= 31,
107
sptMPV
,
108
sptMP2T
,
109
sptH263
,
110
// Types 35 - 71 are unassigned.
111
// Types 72 - 76 are reserved.
112
// Types 96 - 127 are dynamic.
113
lastStaticPayloadType
=
sptH263
114
}
StaticPayloadType
;
115
129
class
__EXPORT
PayloadFormat
130
{
131
public
:
137
inline
PayloadType
getPayloadType()
const
138
{
return
payloadType; }
139
148
inline
uint32 getRTPClockRate()
const
149
{
return
RTPClockRate; }
150
151
protected
:
155
PayloadFormat
()
156
{ }
157
161
inline
virtual
~
PayloadFormat
()
162
{ }
163
169
inline
void
setPayloadType(
PayloadType
pt)
170
{ payloadType = pt; }
171
177
inline
void
setRTPClockRate(uint32 rate)
178
{ RTPClockRate = rate; }
179
180
// default clock rate
181
static
const
uint32
defaultRTPClockRate
;
182
183
private
:
184
PayloadType
payloadType;
185
uint32 RTPClockRate;
186
};
187
200
class
__EXPORT
StaticPayloadFormat
:
public
PayloadFormat
201
{
202
public
:
211
StaticPayloadFormat
(
StaticPayloadType
type);
212
213
private
:
219
static
uint32 staticAudioTypesRates[
lastStaticAudioPayloadType
-
220
firstStaticPayloadType
+ 1];
221
};
222
234
class
__EXPORT
DynamicPayloadFormat
:
public
PayloadFormat
235
{
236
public
:
244
DynamicPayloadFormat
(
PayloadType
type, uint32 rate);
245
};
246
// payload
248
249
END_NAMESPACE
250
251
#endif // ndef CCXX_RTP_FORMATS_H_
252
Generated on Mon Feb 25 2019 13:42:42 for ccRTP by
1.8.3.1