RTPPacket(3) | Library Functions Manual | RTPPacket(3) |
NAME¶
RTPPacket - A base class for both IncomingRTPPkt and OutgoingRTPPkt.
SYNOPSIS¶
#include <rtppkt.h>
Inherited by IncomingRTPPkt, and OutgoingRTPPkt.
Classes¶
struct RFC2833Payload
a structure defining RFC2833 Telephony events.
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, CryptoContext *pcc=NULL)
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.
uint32 getRawPacketSizeSrtp () const
size_t getSizeOfFixedHeader () const
void reComputePayLength (bool padding)
Re-compute payload length. struct RFC2833Payload *
getRaw2833Payload (void)
Fetch a raw 2833 packet. uint16 get2833Duration (void)
Fetch 2833 duration field. void set2833Duration (uint16 timestamp)
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). uint32
srtpDataOffset
Offset into packet memory pointing to area for SRTP data. int32
srtpLength
Lebgth of additional SRTP data. uint32 total
total length, including header, payload and padding uint32 payloadSize
note: payload (not full packet) size.
Detailed Description¶
A base class for both IncomingRTPPkt and OutgoingRTPPkt.
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.
Author:
Constructor & Destructor Documentation¶
RTPPacket::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. Commonly used to build RTPPacket objects from incoming data.
Parameters:
len total length (header + payload + padding) of the packet
duplicate whether to memcopy the packet. At present, this feature is not used.
Note:
RTPPacket::RTPPacket (size_t hdrlen, size_t plen, uint8 paddinglen, CryptoContext * pcc = NULL)¶
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.
Parameters:
plen payload length.
paddinglen pad packet to a multiple of paddinglen
Note:
virtual RTPPacket::~RTPPacket () [inline], [protected], [virtual]¶
Destructor, free the buffer provided in the constructor.
Member Function Documentation¶
void RTPPacket::endPacket () [protected]¶
Free memory allocated for the packet.
uint16 RTPPacket::get2833Duration (void) [inline]¶
Fetch 2833 duration field.
Returns:
const uint32* RTPPacket::getCSRCs () const [inline]¶
Get the 32-bit identifiers of the contributing sources for the packet as an array, of length getCSRCsCount().
Returns:
uint16 RTPPacket::getCSRCsCount () const [inline]¶
Get the number of contributing sources specified in the packet header.
const unsigned char* RTPPacket::getHdrExtContent () const [inline]¶
Get the content of the header extension.
Returns:
uint32 RTPPacket::getHdrExtSize () const [inline]¶
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.
Returns:
Note:
uint16 RTPPacket::getHdrExtUndefined () const [inline]¶
Get the first 16 bits (in network order) of the header of the RTP header extension. Its meaning is undefined at this level.
Returns:
Note:
RTPFixedHeader* RTPPacket::getHeader () const [inline], [protected]¶
Return low level structure for the header of the packet.
Returns:
const RTPHeaderExt* RTPPacket::getHeaderExt () const [inline], [protected]¶
Get a pointer to RTPHeaderExt pointing after the RTP header (fixed part plus contributing sources). No check for for the X bit is done.
Returns:
uint32 RTPPacket::getHeaderSize () const [inline]¶
Get the length of the header, including contributing sources identifiers and header extension, if present.
Returns:
uint8 RTPPacket::getPaddingSize () const [inline]¶
Get the number of octets padding the end of the payload section.
Returns:
const uint8* const RTPPacket::getPayload () const [inline]¶
Returns:
uint32 RTPPacket::getPayloadSize () const [inline]¶
Returns:
PayloadType RTPPacket::getPayloadType () const [inline]¶
Returns:
uint8 RTPPacket::getProtocolVersion () const [inline]¶
Returns:
struct RFC2833Payload* RTPPacket::getRaw2833Payload (void) [inline]¶
Fetch a raw 2833 packet.
Returns:
const unsigned char* const RTPPacket::getRawPacket () const [inline]¶
Get the raw packet as it will be sent through the network.
Returns:
uint32 RTPPacket::getRawPacketSize () const [inline]¶
Get the raw packet length, including header, extension, payload and padding.
Returns:
uint32 RTPPacket::getRawPacketSizeSrtp () const [inline]¶
uint32 RTPPacket::getRawTimestamp () const [inline], [protected]¶
Obtain the absolute timestamp carried in the packet header.
Returns:
uint16 RTPPacket::getSeqNum () const [inline]¶
Returns:
size_t RTPPacket::getSizeOfFixedHeader () const [inline]¶
uint32 RTPPacket::getTimestamp () const [inline]¶
Returns:
bool RTPPacket::isExtended () const [inline]¶
Ask whether the packet contains header extensions.
Returns:
bool RTPPacket::isMarked () const [inline]¶
Ask whether the packet is marked (for isntance, is a new talk spurt in some audio profiles).
Returns:
bool RTPPacket::isPadded () const [inline]¶
Ask whether the packet contains padding bytes at the end.
Returns:
void RTPPacket::reComputePayLength (bool padding)¶
Re-compute payload length. This recomputation may be necessary in case of SRTP. We need to decrypt the packet before we can handle padding. See takeInDataPacket in incqueue.cpp
Parameters:
void RTPPacket::set2833Duration (uint16 timestamp) [inline]¶
Set 2833 duration field.
Parameters:
void RTPPacket::setbuffer (const void * src, size_t len, size_t pos) [inline], [protected]¶
void RTPPacket::setExtension (bool e) [inline], [protected]¶
Member Data Documentation¶
uint16 RTPPacket::cachedSeqNum [protected]¶
Packet sequence number in host order.
uint32 RTPPacket::cachedTimestamp [protected]¶
Packet timestamp in host order (includes initial shift).
uint32 RTPPacket::payloadSize [protected]¶
note: payload (not full packet) size.
uint32 RTPPacket::srtpDataOffset [protected]¶
Offset into packet memory pointing to area for SRTP data. This offset points to the memory where the SRTP protect will store the authentication and MKI data.
int32 RTPPacket::srtpLength [protected]¶
Lebgth of additional SRTP data. Covers the SRTP authentication and MKI data.
uint32 RTPPacket::total [protected]¶
total length, including header, payload and padding
Author¶
Generated automatically by Doxygen for ccRTP from the source code.
Sat Oct 27 2018 | ccRTP |