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
41NAMESPACE_COMMONCPP
42
63typedef uint8 PayloadType;
64
67
74typedef enum {
75 // Types for audio formats:
76 sptPCMU = 0,
78 // 1016 static payload type is now deprecated. Type 1 is reserved.
79 // spt1016, ///< CELP audio (FED-STD 1016) (RFC 1890)
91 // Type 13 is reserved.
92 sptMPA = 14,
97 // Type 19 is reserved. Types 20 - 23 are unassigned.
99
100 // Types for video formats:
101 // Type 24 is unassigned.
102 sptCELB = 25,
104 // Type 27 is unassigned.
105 sptNV = 28,
106 // Types 29 and 30 are unassigned.
107 sptH261 = 31,
111 // Types 35 - 71 are unassigned.
112 // Types 72 - 76 are reserved.
113 // Types 96 - 127 are dynamic.
116
130class __EXPORT PayloadFormat
131{
132public:
139 { return payloadType; }
140
149 inline uint32 getRTPClockRate() const
150 { return RTPClockRate; }
151
152protected:
157 { }
158
162 inline virtual ~PayloadFormat()
163 { }
164
171 { payloadType = pt; }
172
178 inline void setRTPClockRate(uint32 rate)
179 { RTPClockRate = rate; }
180
181 // default clock rate
182 static const uint32 defaultRTPClockRate;
183
184private:
185 PayloadType payloadType;
186 uint32 RTPClockRate;
187};
188
201class __EXPORT StaticPayloadFormat : public PayloadFormat
202{
203public:
213
214private:
220 static uint32 staticAudioTypesRates[lastStaticAudioPayloadType -
222};
223
235class __EXPORT DynamicPayloadFormat : public PayloadFormat
236{
237public:
246};
247 // payload
249
250END_NAMESPACE
251
252#endif // ndef CCXX_RTP_FORMATS_H_
253
Dynamic payload format objects.
Definition: formats.h:236
DynamicPayloadFormat(PayloadType type, uint32 rate)
Constructor.
Base payload format class.
Definition: formats.h:131
PayloadFormat()
PayloadFormat must not be used but as base class.
Definition: formats.h:156
PayloadType getPayloadType() const
Get payload type numeric identifier carried in RTP packets.
Definition: formats.h:138
uint32 getRTPClockRate() const
Get RTP clock rate for this payload format.
Definition: formats.h:149
virtual ~PayloadFormat()
PayloadFormat must not be used but as base class.
Definition: formats.h:162
static const uint32 defaultRTPClockRate
Definition: formats.h:182
void setPayloadType(PayloadType pt)
Set payload type numeric identifier carried in RTP packets.
Definition: formats.h:170
void setRTPClockRate(uint32 rate)
Set RTP clock rate.
Definition: formats.h:178
Static payload format objects.
Definition: formats.h:202
StaticPayloadFormat(StaticPayloadType type)
Constructor.
uint8 PayloadType
RTP payload type numeric identifier.
Definition: formats.h:63
const PayloadType ptINVALID
Predefined value for invalid or uninitialized payload type variables.
Definition: formats.h:66
StaticPayloadType
RTP static payload types (default bindings) defined in the AVP profile.
Definition: formats.h:74
@ sptLPC
LPC audio (RFC 1890)
Definition: formats.h:85
@ sptJPEG
JPEG (ISO 10918) video (RFCs 1890, 2435)
Definition: formats.h:103
@ sptDVI4_16000
Modified IMA ADPCM audio 16Khz (RFC 1890)
Definition: formats.h:84
@ sptPCMU
ITU-T G.711. mu-law audio 8 Khz (RFC 1890)
Definition: formats.h:76
@ sptG723
ITU-T G.723. MP-MLQ ACELP audio (RFC 1890)
Definition: formats.h:82
@ sptDVI4_11025
DVI audio at 11025 hz (by Joseph Di Pol)
Definition: formats.h:94
@ sptMP2T
MPEG 2 Transport stream (RFCs 1890, 2250)
Definition: formats.h:109
@ sptH261
ITU-T H.261 video (RFCs 1890, 2032)
Definition: formats.h:107
@ lastStaticAudioPayloadType
Definition: formats.h:98
@ lastStaticPayloadType
Definition: formats.h:114
@ sptQCELP
Audio at 8000 hz.
Definition: formats.h:90
@ sptG726_32
ITU-T G.726. ADPCM audio (RFC 1890)
Definition: formats.h:80
@ sptDVI4_8000
Modified IMA ADPCM audio 8Khz (RFC 1890)
Definition: formats.h:83
@ sptL16_MONO
Linear uncompressed mono audio (RFC 1890)
Definition: formats.h:89
@ sptL16_DUAL
Linear uncompressed dual audio (RFC 1890)
Definition: formats.h:88
@ sptCELB
Sun's propietary video (RFCs 1890, 2029)
Definition: formats.h:102
@ sptMPV
MPEG Video elem. stream (RFCs 1890, 2250)
Definition: formats.h:108
@ sptNV
Ron Frederick's nv audio (RFC 1890)
Definition: formats.h:105
@ sptG728
ITU-T G.728. LD-CELP audio.
Definition: formats.h:93
@ sptGSM
GSM audio (RFC 1890)
Definition: formats.h:81
@ sptDVI4_22050
DVI audio at 22050 hz (by Joseph Di Pol)
Definition: formats.h:95
@ sptG722
Audio (RFCs 1890, 3047)
Definition: formats.h:87
@ firstStaticPayloadType
Definition: formats.h:77
@ sptPCMA
ITU-T G.711 A-law audio 8 Khz (RFC 1890)
Definition: formats.h:86
@ sptH263
ITU-T H.263 video (RFCs 2190, 2429)
Definition: formats.h:110
@ sptG729
ITU-T G.729. CS-ACELP audio.
Definition: formats.h:96
@ sptMPA
MPEG Audio elem. stream (RFCs 1890, 2250)
Definition: formats.h:92