formats.h
Go to the documentation of this file.
// Copyright (C) 2002 Federico Montesino Pouzols <fedemp@altern.org>.
//
// 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.
//
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
//
// This exception applies only to the code released under the name GNU
// ccRTP. If you copy code from other releases into a copy of GNU
// ccRTP, as the General Public License permits, the exception does
// not apply to the code that you add in this way. To avoid misleading
// anyone as to the status of such modified files, you must delete
// this exception notice from them.
//
// If you write modifications of your own for GNU ccRTP, it is your choice
// whether to permit this exception to apply to your modifications.
// If you do not wish that, delete this exception notice.
//
#ifndef CCXX_RTP_FORMATS_H_
#define CCXX_RTP_FORMATS_H_
NAMESPACE_COMMONCPP
typedef uint8 PayloadType;
const PayloadType ptINVALID = 128;
typedef enum {
// Types for audio formats:
sptPCMU = 0,
firstStaticPayloadType = sptPCMU,
// 1016 static payload type is now deprecated. Type 1 is reserved.
// spt1016, ///< CELP audio (FED-STD 1016) (RFC 1890)
sptG726_32 = 2,
sptGSM,
sptG723,
sptDVI4_8000,
sptDVI4_16000,
sptLPC,
sptPCMA,
sptG722,
sptL16_DUAL,
sptL16_MONO,
sptQCELP,
// Type 13 is reserved.
sptMPA = 14,
sptG728,
sptDVI4_11025,
sptDVI4_22050,
sptG729,
// Type 19 is reserved. Types 20 - 23 are unassigned.
lastStaticAudioPayloadType = sptG729,
// Types for video formats:
// Type 24 is unassigned.
sptCELB = 25,
sptJPEG,
// Type 27 is unassigned.
sptNV = 28,
// Types 29 and 30 are unassigned.
sptH261 = 31,
sptMPV,
sptMP2T,
sptH263,
// Types 35 - 71 are unassigned.
// Types 72 - 76 are reserved.
// Types 96 - 127 are dynamic.
lastStaticPayloadType = sptH263
} StaticPayloadType;
class __EXPORT PayloadFormat
{
public:
inline PayloadType getPayloadType() const
{ return payloadType; }
inline uint32 getRTPClockRate() const
{ return RTPClockRate; }
protected:
PayloadFormat()
{ }
inline virtual ~PayloadFormat()
{ }
inline void setPayloadType(PayloadType pt)
{ payloadType = pt; }
inline void setRTPClockRate(uint32 rate)
{ RTPClockRate = rate; }
// default clock rate
static const uint32 defaultRTPClockRate;
private:
PayloadType payloadType;
uint32 RTPClockRate;
};
class __EXPORT StaticPayloadFormat : public PayloadFormat
{
public:
StaticPayloadFormat(StaticPayloadType type);
private:
static uint32 staticAudioTypesRates[lastStaticAudioPayloadType -
firstStaticPayloadType + 1];
};
class __EXPORT DynamicPayloadFormat : public PayloadFormat
{
public:
DynamicPayloadFormat(PayloadType type, uint32 rate);
};
// payload
END_NAMESPACE
#endif // ndef CCXX_RTP_FORMATS_H_
DynamicPayloadFormat::DynamicPayloadFormat
DynamicPayloadFormat(PayloadType type, uint32 rate)
Constructor.
PayloadFormat::PayloadFormat
PayloadFormat()
PayloadFormat must not be used but as base class.
Definition formats.h:156
PayloadFormat::getPayloadType
PayloadType getPayloadType() const
Get payload type numeric identifier carried in RTP packets.
Definition formats.h:138
PayloadFormat::getRTPClockRate
uint32 getRTPClockRate() const
Get RTP clock rate for this payload format.
Definition formats.h:149
PayloadFormat::~PayloadFormat
virtual ~PayloadFormat()
PayloadFormat must not be used but as base class.
Definition formats.h:162
PayloadFormat::defaultRTPClockRate
static const uint32 defaultRTPClockRate
Definition formats.h:182
PayloadFormat::setPayloadType
void setPayloadType(PayloadType pt)
Set payload type numeric identifier carried in RTP packets.
Definition formats.h:170
PayloadFormat::setRTPClockRate
void setRTPClockRate(uint32 rate)
Set RTP clock rate.
Definition formats.h:178
StaticPayloadFormat::StaticPayloadFormat
StaticPayloadFormat(StaticPayloadType type)
Constructor.
PayloadType
uint8 PayloadType
RTP payload type numeric identifier.
Definition formats.h:63
ptINVALID
const PayloadType ptINVALID
Predefined value for invalid or uninitialized payload type variables.
Definition formats.h:66
StaticPayloadType
StaticPayloadType
RTP static payload types (default bindings) defined in the AVP profile.
Definition formats.h:74
sptLPC
@ sptLPC
LPC audio (RFC 1890).
Definition formats.h:85
sptJPEG
@ sptJPEG
JPEG (ISO 10918) video (RFCs 1890, 2435).
Definition formats.h:103
sptDVI4_16000
@ sptDVI4_16000
Modified IMA ADPCM audio 16Khz (RFC 1890).
Definition formats.h:84
sptPCMU
@ sptPCMU
ITU-T G.711. mu-law audio 8 Khz (RFC 1890).
Definition formats.h:76
sptG723
@ sptG723
ITU-T G.723. MP-MLQ ACELP audio (RFC 1890).
Definition formats.h:82
sptDVI4_11025
@ sptDVI4_11025
DVI audio at 11025 hz (by Joseph Di Pol).
Definition formats.h:94
sptMP2T
@ sptMP2T
MPEG 2 Transport stream (RFCs 1890, 2250).
Definition formats.h:109
sptH261
@ sptH261
ITU-T H.261 video (RFCs 1890, 2032).
Definition formats.h:107
lastStaticAudioPayloadType
@ lastStaticAudioPayloadType
Definition formats.h:98
lastStaticPayloadType
@ lastStaticPayloadType
Definition formats.h:114
sptQCELP
@ sptQCELP
Audio at 8000 hz.
Definition formats.h:90
sptG726_32
@ sptG726_32
ITU-T G.726. ADPCM audio (RFC 1890).
Definition formats.h:80
sptDVI4_8000
@ sptDVI4_8000
Modified IMA ADPCM audio 8Khz (RFC 1890).
Definition formats.h:83
sptL16_MONO
@ sptL16_MONO
Linear uncompressed mono audio (RFC 1890).
Definition formats.h:89
sptL16_DUAL
@ sptL16_DUAL
Linear uncompressed dual audio (RFC 1890).
Definition formats.h:88
sptCELB
@ sptCELB
Sun's propietary video (RFCs 1890, 2029).
Definition formats.h:102
sptMPV
@ sptMPV
MPEG Video elem. stream (RFCs 1890, 2250).
Definition formats.h:108
sptNV
@ sptNV
Ron Frederick's nv audio (RFC 1890).
Definition formats.h:105
sptG728
@ sptG728
ITU-T G.728. LD-CELP audio.
Definition formats.h:93
sptGSM
@ sptGSM
GSM audio (RFC 1890).
Definition formats.h:81
sptDVI4_22050
@ sptDVI4_22050
DVI audio at 22050 hz (by Joseph Di Pol).
Definition formats.h:95
sptG722
@ sptG722
Audio (RFCs 1890, 3047).
Definition formats.h:87
firstStaticPayloadType
@ firstStaticPayloadType
Definition formats.h:77
sptPCMA
@ sptPCMA
ITU-T G.711 A-law audio 8 Khz (RFC 1890).
Definition formats.h:86
sptH263
@ sptH263
ITU-T H.263 video (RFCs 2190, 2429).
Definition formats.h:110
sptG729
@ sptG729
ITU-T G.729. CS-ACELP audio.
Definition formats.h:96
sptMPA
@ sptMPA
MPEG Audio elem. stream (RFCs 1890, 2250).
Definition formats.h:92