#include <rtppkt.h>
Inheritance diagram for RTPPacket:
Public Member Functions | |
RTPPacket (const unsigned char *const block, size_t len, bool duplicate=false) | |
Constructor, construct a packet object given the memory zone its content (header and payload) is stored. | |
RTPPacket (size_t hdrlen, size_t plen, uint8 paddinglen) | |
Construct a packet object without specifying its real content yet. | |
uint32 | getHeaderSize () const |
Get the length of the header, including contributing sources identifiers and header extension, if present. | |
const uint8 *const | getPayload () const |
uint32 | getPayloadSize () const |
PayloadType | getPayloadType () const |
uint16 | getSeqNum () const |
uint32 | getTimestamp () const |
uint8 | getProtocolVersion () const |
bool | isPadded () const |
Ask whether the packet contains padding bytes at the end. | |
uint8 | getPaddingSize () const |
Get the number of octets padding the end of the payload section. | |
bool | isMarked () const |
Ask whether the packet is marked (for isntance, is a new talk spurt in some audio profiles). | |
bool | isExtended () const |
Ask whether the packet contains header extensions. | |
uint16 | getCSRCsCount () const |
Get the number of contributing sources specified in the packet header. | |
const uint32 * | getCSRCs () const |
Get the 32-bit identifiers of the contributing sources for the packet as an array, of length getCSRCsCount(). | |
uint16 | getHdrExtUndefined () const |
Get the first 16 bits (in network order) of the header of the RTP header extension. | |
uint32 | getHdrExtSize () const |
Get the length (in octets) of the data contained in the header extension. | |
const unsigned char * | getHdrExtContent () const |
Get the content of the header extension. | |
const unsigned char *const | getRawPacket () const |
Get the raw packet as it will be sent through the network. | |
uint32 | getRawPacketSize () const |
Get the raw packet length, including header, extension, payload and padding. | |
size_t | getSizeOfFixedHeader () const |
RFC2833Payload * | getRaw2833Payload (void) |
Fetch a raw 2833 packet. | |
uint16 | get2833Duration (void) |
Fetch 2833 duration field. | |
void | set2833Duration (uint16 d) |
Set 2833 duration field. | |
Protected Member Functions | |
virtual | ~RTPPacket () |
Destructor, free the buffer provided in the constructor. | |
void | endPacket () |
Free memory allocated for the packet. | |
RTPFixedHeader * | getHeader () const |
Return low level structure for the header of the packet. | |
void | setExtension (bool e) |
const RTPHeaderExt * | getHeaderExt () const |
Get a pointer to RTPHeaderExt pointing after the RTP header (fixed part plus contributing sources). | |
uint32 | getRawTimestamp () const |
Obtain the absolute timestamp carried in the packet header. | |
void | setbuffer (const void *src, size_t len, size_t pos) |
Protected Attributes | |
uint16 | cachedSeqNum |
Packet sequence number in host order. | |
uint32 | cachedTimestamp |
Packet timestamp in host order (includes initial shift). | |
Classes | |
struct | RFC2833Payload |
a structure defining RFC2833 Telephony events. More... | |
struct | RTPFixedHeader |
RTP fixed header as it is send through the network. | |
struct | RTPHeaderExt |
Fixed component of the variable-length header extension, appended to the fixed header, after the CSRC list, when X == 1. |
Provides common low level header structures and related methods. This class provides an interface that allows for partial and generic manipulation of RTP data packets. Values are returned in host order, except raw structures, which are returned as they are sent through the network.
|
Constructor, construct a packet object given the memory zone its content (header and payload) is stored. Commonly used to build RTPPacket objects from incoming data.
|
|
Construct a packet object without specifying its real content yet. Commonly used for outgoing packets. Header fields and payload must be filled in by another methods or by a derived constructor.
|
|
Destructor, free the buffer provided in the constructor.
|
|
Free memory allocated for the packet.
|
|
Fetch 2833 duration field.
|
|
Get the 32-bit identifiers of the contributing sources for the packet as an array, of length getCSRCsCount().
|
|
Get the number of contributing sources specified in the packet header.
|
|
Get the content of the header extension.
|
|
Get the length (in octets) of the data contained in the header extension. Note that this length does not include the four octets at the beginning of the header extension.
|
|
Get the first 16 bits (in network order) of the header of the RTP header extension. Its meaning is undefined at this level.
|
|
Return low level structure for the header of the packet.
|
|
Get a pointer to RTPHeaderExt pointing after the RTP header (fixed part plus contributing sources). No check for for the X bit is done.
|
|
Get the length of the header, including contributing sources identifiers and header extension, if present.
|
|
Get the number of octets padding the end of the payload section.
|
|
|
|
|
|
|
|
|
|
Fetch a raw 2833 packet.
|
|
Get the raw packet as it will be sent through the network.
|
|
Get the raw packet length, including header, extension, payload and padding.
|
|
Obtain the absolute timestamp carried in the packet header.
|
|
|
|
|
|
|
|
Ask whether the packet contains header extensions.
|
|
Ask whether the packet is marked (for isntance, is a new talk spurt in some audio profiles).
|
|
Ask whether the packet contains padding bytes at the end.
|
|
Set 2833 duration field.
|
|
|
|
|
|
Packet sequence number in host order.
|
|
Packet timestamp in host order (includes initial shift).
|