# RTP_DataFrame Class Reference

`#include <rtp.h>`

Inheritance diagram for RTP_DataFrame:

[legend]

## Public Types

| ProtocolVersion = 2
| MinHeaderSize = 12
| MaxMtuPayloadSize = (576-20-16-12)
| PCMU
| FS1016
| G721
| G726 = G721
| GSM
| G7231
| DVI4_8k
| DVI4_16k
| LPC
| PCMA
| G722
| L16_Stereo
| L16_Mono
| G723
| CN
| MPA
| G728
| DVI4_11k
| DVI4_22k
| G729
| Cisco_CN
| CelB = 25
| JPEG
| H261 = 31
| MPV
| MP2T
| H263
| T38 = 38
| LastKnownPayloadType
| DynamicBase = 96
| MaxPayloadType = 127
| IllegalPayloadType
| RFC3550
| RFC5285_OneByte
| RFC5285_TwoByte
enum | { ProtocolVersion = 2, MinHeaderSize = 12, MaxMtuPayloadSize = (576-20-16-12) }
enum | PayloadTypes { PCMU, FS1016, G721, G726 = G721, GSM, G7231, DVI4_8k, DVI4_16k, LPC, PCMA, G722, L16_Stereo, L16_Mono, G723, CN, MPA, G728, DVI4_11k, DVI4_22k, G729, Cisco_CN, CelB = 25, JPEG, H261 = 31, MPV, MP2T, H263, T38 = 38, LastKnownPayloadType, DynamicBase = 96, MaxPayloadType = 127, IllegalPayloadType }
enum | HeaderExtensionType { RFC3550, RFC5285_OneByte, RFC5285_TwoByte }
| Extension header types. More...

## Public Member Functions

| RTP_DataFrame (PINDEX payloadSize=0, PINDEX bufferSize=0)
| RTP_DataFrame (const BYTE *data, PINDEX len, bool dynamic=true)
unsigned | GetVersion () const
bool | GetExtension () const
void | SetExtension (bool ext)
bool | GetMarker () const
void | SetMarker (bool m)
bool | GetPadding () const
void | SetPadding (bool v)
BYTE * | GetPaddingPtr () const
PINDEX | GetPaddingSize () const
bool | SetPaddingSize (PINDEX sz)
PayloadTypes | GetPayloadType () const
void | SetPayloadType (PayloadTypes t)
WORD | GetSequenceNumber () const
void | SetSequenceNumber (WORD n)
DWORD | GetTimestamp () const
void | SetTimestamp (DWORD t)
DWORD | GetSyncSource () const
void | SetSyncSource (DWORD s)
PINDEX | GetContribSrcCount () const
DWORD | GetContribSource (PINDEX idx) const
void | SetContribSource (PINDEX idx, DWORD src)
PINDEX | GetHeaderSize () const
void | CopyHeader (const RTP_DataFrame &other)
BYTE * | GetHeaderExtension (unsigned &id, PINDEX &length, int idx=-1) const
BYTE * | GetHeaderExtension (HeaderExtensionType type, unsigned id, PINDEX &length) const
bool | SetHeaderExtension (unsigned id, PINDEX length, const BYTE *data, HeaderExtensionType type)
PINDEX | GetExtensionSizeDWORDs () const
bool | SetExtensionSizeDWORDs (PINDEX sz)
PINDEX | GetPayloadSize () const
bool | SetPayloadSize (PINDEX sz)
BYTE * | GetPayloadPtr () const
virtual PObject * | Clone () const
virtual void | PrintOn (ostream &strm) const
bool | SetPacketSize (PINDEX sz)
PTime | GetAbsoluteTime () const
void | SetAbsoluteTime ()
void | SetAbsoluteTime (const PTime &t)
unsigned | GetDiscontinuity () const
void | SetDiscontinuity (unsigned lost)

## Protected Attributes

PINDEX | m_headerSize
PINDEX | m_payloadSize
PINDEX | m_paddingSize
PTime | m_absoluteTime
unsigned | m_discontinuity

## Detailed Description

An RTP data frame encapsulation.

## Member Enumeration Documentation

anonymous enum

Enumerator:

  ProtocolVersion |
  MinHeaderSize |
  MaxMtuPayloadSize |

enum RTP_DataFrame::HeaderExtensionType

Extension header types.

Enumerator:

  RFC3550 |
  RFC5285_OneByte |
  RFC5285_TwoByte |

enum RTP_DataFrame::PayloadTypes

Enumerator:

  PCMU |
  FS1016 |
  G721 |
  G726 |
  GSM |
  G7231 |
  DVI4_8k |
  DVI4_16k |
  LPC |
  PCMA |
  G722 |
  L16_Stereo |
  L16_Mono |
  G723 |
  CN |
  MPA |
  G728 |
  DVI4_11k |
  DVI4_22k |
  G729 |
  Cisco_CN |
  CelB |
  JPEG |
  H261 |
  MPV |
  MP2T |
  H263 |
  T38 |
  LastKnownPayloadType |
  DynamicBase |
  MaxPayloadType |
  IllegalPayloadType |

## Constructor & Destructor Documentation

RTP_DataFrame::RTP_DataFrame | ( | PINDEX | payloadSize = `0`,
|  | PINDEX | bufferSize = `0` |
| ) |  |  |

RTP_DataFrame::RTP_DataFrame | ( | const BYTE * | data,
|  | PINDEX | len,
|  | bool | dynamic = `true` |
| ) |  |  |

## Member Function Documentation

virtual PObject* RTP_DataFrame::Clone | ( |  | ) | const`[inline, virtual]`

void RTP_DataFrame::CopyHeader | ( | const RTP_DataFrame & | other | ) |

PTime RTP_DataFrame::GetAbsoluteTime | ( |  | ) | const`[inline]`

Get absolute (wall clock) time of packet, if known.

DWORD RTP_DataFrame::GetContribSource | ( | PINDEX | idx | ) | const

PINDEX RTP_DataFrame::GetContribSrcCount | ( |  | ) | const`[inline]`

unsigned RTP_DataFrame::GetDiscontinuity | ( |  | ) | const`[inline]`

Get sequence number discontinuity. If non-zero this indicates the number of packets detected as missing before this packet.

bool RTP_DataFrame::GetExtension | ( |  | ) | const`[inline]`

PINDEX RTP_DataFrame::GetExtensionSizeDWORDs | ( |  | ) | const

BYTE* RTP_DataFrame::GetHeaderExtension | ( | HeaderExtensionType | type,
|  | unsigned | id,
|  | PINDEX & | length |
| ) |  |  | const

Get header extension by specified id.

Returns:
  NULL if no extension of that id and type is present.

Parameters:

  type | Type of extension to get
  id | Identifier for extension
  length | Length of extension in bytes

BYTE* RTP_DataFrame::GetHeaderExtension | ( | unsigned & | id,
|  | PINDEX & | length,
|  | int | idx = `-1` |
| ) |  |  | const

Get header extension. If idx < 0 then gets RFC 3550 format extension type. If idx >= 0 then get RFC 5285 format extension type for the idx'th extension.

Returns:
  NULL if no extension

Parameters:

  id | Identifier for extension
  length | Length of extension in bytes
  idx | Index of extension

PINDEX RTP_DataFrame::GetHeaderSize | ( |  | ) | const`[inline]`

bool RTP_DataFrame::GetMarker | ( |  | ) | const`[inline]`

bool RTP_DataFrame::GetPadding | ( |  | ) | const`[inline]`

BYTE* RTP_DataFrame::GetPaddingPtr | ( |  | ) | const`[inline]`

PINDEX RTP_DataFrame::GetPaddingSize | ( |  | ) | const`[inline]`

BYTE* RTP_DataFrame::GetPayloadPtr | ( |  | ) | const`[inline]`

PINDEX RTP_DataFrame::GetPayloadSize | ( |  | ) | const`[inline]`

PayloadTypes RTP_DataFrame::GetPayloadType | ( |  | ) | const`[inline]`

WORD RTP_DataFrame::GetSequenceNumber | ( |  | ) | const`[inline]`

DWORD RTP_DataFrame::GetSyncSource | ( |  | ) | const`[inline]`

DWORD RTP_DataFrame::GetTimestamp | ( |  | ) | const`[inline]`

unsigned RTP_DataFrame::GetVersion | ( |  | ) | const`[inline]`

virtual void RTP_DataFrame::PrintOn | ( | ostream & | strm | ) | const`[virtual]`

void RTP_DataFrame::SetAbsoluteTime | ( | const PTime & | t | ) | `[inline]`

void RTP_DataFrame::SetAbsoluteTime | ( |  | ) | `[inline]`

Set absolute (wall clock) time of packet.

void RTP_DataFrame::SetContribSource | ( | PINDEX | idx,
|  | DWORD | src |
| ) |  |  |

void RTP_DataFrame::SetDiscontinuity | ( | unsigned | lost | ) | `[inline]`

void RTP_DataFrame::SetExtension | ( | bool | ext | ) |

bool RTP_DataFrame::SetExtensionSizeDWORDs | ( | PINDEX | sz | ) |

bool RTP_DataFrame::SetHeaderExtension | ( | unsigned | id,
|  | PINDEX | length,
|  | const BYTE * | data,
|  | HeaderExtensionType | type |
| ) |  |  |

Set header extension. Note when RFC 5285 formats are used, the extension is appened to ones already present.

Returns:
  true if extension legal.

Parameters:

  id | Identifier for extension
  length | Length of extension in bytes
  data | Data to put into extension
  type | RFC standard used

void RTP_DataFrame::SetMarker | ( | bool | m | ) |

bool RTP_DataFrame::SetPacketSize | ( | PINDEX | sz | ) |

void RTP_DataFrame::SetPadding | ( | bool | v | ) | `[inline]`

bool RTP_DataFrame::SetPaddingSize | ( | PINDEX | sz | ) |

bool RTP_DataFrame::SetPayloadSize | ( | PINDEX | sz | ) |

void RTP_DataFrame::SetPayloadType | ( | PayloadTypes | t | ) |

void RTP_DataFrame::SetSequenceNumber | ( | WORD | n | ) | `[inline]`

void RTP_DataFrame::SetSyncSource | ( | DWORD | s | ) | `[inline]`

void RTP_DataFrame::SetTimestamp | ( | DWORD | t | ) | `[inline]`

## Field Documentation

PTime RTP_DataFrame::m_absoluteTime `[protected]`

unsigned RTP_DataFrame::m_discontinuity `[protected]`

PINDEX RTP_DataFrame::m_headerSize `[protected]`

PINDEX RTP_DataFrame::m_paddingSize `[protected]`

PINDEX RTP_DataFrame::m_payloadSize `[protected]`

The documentation for this class was generated from the following file:

- rtp.h