JRTPLIB  3.11.0
Public Member Functions | List of all members
jrtplib::RTPRawPacket Class Reference

This class is used by the transmission component to store the incoming RTP and RTCP data in. More...

#include <rtprawpacket.h>

Inherits jrtplib::RTPMemoryObject.

Public Member Functions

 RTPRawPacket (uint8_t *data, size_t datalen, RTPAddress *address, RTPTime &recvtime, bool rtp, RTPMemoryManager *mgr=0)
 Creates an instance which stores data from data with length datalen. More...
 
uint8_t * GetData ()
 Returns the pointer to the data which is contained in this packet. More...
 
size_t GetDataLength () const
 Returns the length of the packet described by this instance. More...
 
RTPTime GetReceiveTime () const
 Returns the time at which this packet was received. More...
 
const RTPAddressGetSenderAddress () const
 Returns the address stored in this packet. More...
 
bool IsRTP () const
 Returns true if this data is RTP data, false if it is RTCP data. More...
 
void ZeroData ()
 Sets the pointer to the data stored in this packet to zero. More...
 
uint8_t * AllocateBytes (bool isrtp, int recvlen) const
 Allocates a number of bytes for RTP or RTCP data using the memory manager that was used for this raw packet instance, can be useful if the RTPRawPacket::SetData function will be used. More...
 
void SetData (uint8_t *data, size_t datalen)
 Deallocates the previously stored data and replaces it with the data that's specified, can be useful when e.g. More...
 
void SetSenderAddress (RTPAddress *address)
 Deallocates the currently stored RTPAddress instance and replaces it with the one that's specified (you probably don't need this function). More...
 

Detailed Description

Constructor & Destructor Documentation

jrtplib::RTPRawPacket::RTPRawPacket ( uint8_t *  data,
size_t  datalen,
RTPAddress address,
RTPTime recvtime,
bool  rtp,
RTPMemoryManager mgr = 0 
)
inline

Creates an instance which stores data from data with length datalen. Only the pointer to the data is stored, no actual copy is made! The address from which this packet originated is set to address and the time at which the packet was received is set to recvtime. The flag which indicates whether this data is RTP or RTCP data is set to rtp. A memory manager can be installed as well.

Member Function Documentation

uint8_t * jrtplib::RTPRawPacket::AllocateBytes ( bool  isrtp,
int  recvlen 
) const
inline
uint8_t* jrtplib::RTPRawPacket::GetData ( )
inline
size_t jrtplib::RTPRawPacket::GetDataLength ( ) const
inline
RTPTime jrtplib::RTPRawPacket::GetReceiveTime ( ) const
inline
const RTPAddress* jrtplib::RTPRawPacket::GetSenderAddress ( ) const
inline
bool jrtplib::RTPRawPacket::IsRTP ( ) const
inline
void jrtplib::RTPRawPacket::SetData ( uint8_t *  data,
size_t  datalen 
)
inline
void jrtplib::RTPRawPacket::SetSenderAddress ( RTPAddress address)
inline
void jrtplib::RTPRawPacket::ZeroData ( )
inline

Sets the pointer to the data stored in this packet to zero. This will prevent a delete call for the actual data when the destructor of RTPRawPacket is called. This function is used by the RTPPacket and RTCPCompoundPacket classes to obtain the packet data (without having to copy it) and to make sure the data isn't deleted when the destructor of RTPRawPacket is called.


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