OPAL
Version 3.18.8
|
#include <rtp.h>
Data Structures | |
struct | MetaData |
Public Types | |
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, StartConflictRTCP = RTP_ControlFrame::e_FirstValidPayloadType&0x7f, EndConflictRTCP = RTP_ControlFrame::e_LastValidPayloadType&0x7f, 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) | |
RTP_DataFrame (const PBYTEArray &data) | |
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) |
RTP_SequenceNumber | GetSequenceNumber () const |
void | SetSequenceNumber (RTP_SequenceNumber n) |
RTP_Timestamp | GetTimestamp () const |
void | SetTimestamp (RTP_Timestamp t) |
RTP_SyncSourceId | GetSyncSource () const |
void | SetSyncSource (RTP_SyncSourceId s) |
PINDEX | GetContribSrcCount () const |
RTP_SyncSourceId | GetContribSource (PINDEX idx) const |
void | SetContribSource (PINDEX idx, RTP_SyncSourceId src) |
PINDEX | GetHeaderSize () const |
void | CopyHeader (const RTP_DataFrame &other) |
void | Copy (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) |
bool | SetPayload (const BYTE *data, PINDEX sz) |
BYTE * | GetPayloadPtr () const |
virtual PObject * | Clone () const |
bool | SetPacketSize (PINDEX sz) |
PINDEX | GetPacketSize () const |
const MetaData & | GetMetaData () const |
void | SetMetaData (const MetaData &metaData) |
PTime | GetAbsoluteTime () const |
void | SetAbsoluteTime () |
void | SetAbsoluteTime (const PTime &t) |
void | SetTransmitTime (const PTime &when) |
void | SetTransmitTimeNTP (uint64_t ntp) |
void | SetReceivedTime (const PTime &when) |
unsigned | GetDiscontinuity () const |
void | SetDiscontinuity (unsigned lost) |
const PString & | GetLipSyncId () const |
void | SetLipSyncId (const PString &id) |
P_DEPRECATED const PString & | GetBundleId () const |
P_DEPRECATED void | SetBundleId (const PString &id) |
Static Public Attributes | |
static const unsigned | MaxHeaderExtensionId = 65535 |
static const unsigned | MaxHeaderExtensionIdOneByte = 14 |
static const unsigned | MaxHeaderExtensionIdTwoByte = 255 |
Protected Member Functions | |
bool | AdjustHeaderSize (PINDEX newSize) |
Protected Attributes | |
PINDEX | m_headerSize |
PINDEX | m_payloadSize |
PINDEX | m_paddingSize |
MetaData | m_metaData |
An RTP data frame encapsulation.
RTP_DataFrame::RTP_DataFrame | ( | PINDEX | payloadSize = 0 , |
PINDEX | bufferSize = 0 |
||
) |
Referenced by Clone().
RTP_DataFrame::RTP_DataFrame | ( | const BYTE * | data, |
PINDEX | len, | ||
bool | dynamic = true |
||
) |
RTP_DataFrame::RTP_DataFrame | ( | const PBYTEArray & | data | ) |
|
protected |
|
inlinevirtual |
References RTP_DataFrame().
void RTP_DataFrame::Copy | ( | const RTP_DataFrame & | other | ) |
void RTP_DataFrame::CopyHeader | ( | const RTP_DataFrame & | other | ) |
|
inline |
Get absolute (wall clock) time of packet, as calculated via RTCP and timestamp, if available.
References RTP_DataFrame::MetaData::m_absoluteTime, and m_metaData.
|
inline |
References RTP_DataFrame::MetaData::m_lipSyncId, and m_metaData.
RTP_SyncSourceId RTP_DataFrame::GetContribSource | ( | PINDEX | idx | ) | const |
|
inline |
|
inline |
Get sequence number discontinuity. If non-zero this indicates the number of packets detected as missing before this packet.
References RTP_DataFrame::MetaData::m_discontinuity, and m_metaData.
|
inline |
PINDEX RTP_DataFrame::GetExtensionSizeDWORDs | ( | ) | const |
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.
id | Identifier for extension |
length | Length of extension in bytes |
idx | Index of extension |
BYTE* RTP_DataFrame::GetHeaderExtension | ( | HeaderExtensionType | type, |
unsigned | id, | ||
PINDEX & | length | ||
) | const |
Get header extension by specified id.
type | Type of extension to get |
id | Identifier for extension |
length | Length of extension in bytes |
|
inline |
References m_headerSize.
|
inline |
Get the identifier that links audio and video streams for "lip synch" purposes.
References RTP_DataFrame::MetaData::m_lipSyncId, and m_metaData.
|
inline |
|
inline |
Get meta data for RTP packet.
References m_metaData.
PINDEX RTP_DataFrame::GetPacketSize | ( | ) | const |
|
inline |
|
inline |
References m_headerSize, and m_payloadSize.
|
inline |
References m_paddingSize.
|
inline |
References m_headerSize.
Referenced by OpalT140RTPFrame::AsString().
|
inline |
References m_payloadSize.
Referenced by OpalT140RTPFrame::AsString().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set absolute (wall clock) time of media, as calculated via RTCP and timestamp.
References RTP_DataFrame::MetaData::m_absoluteTime, and m_metaData.
|
inline |
References RTP_DataFrame::MetaData::m_absoluteTime, and m_metaData.
|
inline |
References RTP_DataFrame::MetaData::m_lipSyncId, and m_metaData.
void RTP_DataFrame::SetContribSource | ( | PINDEX | idx, |
RTP_SyncSourceId | src | ||
) |
|
inline |
Set sequence number discontinuity.
References RTP_DataFrame::MetaData::m_discontinuity, and m_metaData.
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 appended to ones already present. An existing extension of the same ID will be overwritten, if it is the same size. If not the same size, an assert is thrown.
id | Identifier for extension |
length | Length of extension in bytes |
data | Data to put into extension |
type | RFC standard used |
|
inline |
Set the identifier that links audio and video streams for "lip synch" purposes.
References RTP_DataFrame::MetaData::m_lipSyncId, and m_metaData.
void RTP_DataFrame::SetMarker | ( | bool | m | ) |
|
inline |
Set meta data for RTP packet.
References m_metaData.
bool RTP_DataFrame::SetPacketSize | ( | PINDEX | sz | ) |
|
inline |
bool RTP_DataFrame::SetPaddingSize | ( | PINDEX | sz | ) |
bool RTP_DataFrame::SetPayload | ( | const BYTE * | data, |
PINDEX | sz | ||
) |
bool RTP_DataFrame::SetPayloadSize | ( | PINDEX | sz | ) |
void RTP_DataFrame::SetPayloadType | ( | PayloadTypes | t | ) |
|
inline |
Set (wall clock) time of packet receipt.
References m_metaData, and RTP_DataFrame::MetaData::m_receivedTime.
|
inline |
|
inline |
|
inline |
|
inline |
Set (wall clock) time of packet transmission.
References m_metaData, and RTP_DataFrame::MetaData::m_transmitTime.
|
inline |
References m_metaData, and RTP_DataFrame::MetaData::m_transmitTime.
|
protected |
Referenced by GetHeaderSize(), GetPaddingPtr(), and GetPayloadPtr().
|
protected |
|
protected |
Referenced by GetPaddingSize().
|
protected |
Referenced by GetPaddingPtr(), and GetPayloadSize().
|
static |
|
static |
|
static |