JRTPLIB  3.11.2 (development version)
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.

#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...
 
 RTPRawPacket (uint8_t *data, size_t datalen, RTPAddress *address, RTPTime &recvtime, 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.
 
size_t GetDataLength () const
 Returns the length of the packet described by this instance.
 
RTPTime GetReceiveTime () const
 Returns the time at which this packet was received.
 
const RTPAddressGetSenderAddress () const
 Returns the address stored in this packet.
 
bool IsRTP () const
 Returns true if this data is RTP data, false if it is RTCP data.
 
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.
 
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).
 

Constructor & Destructor Documentation

◆ RTPRawPacket() [1/2]

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. If you don't know if it's an RTP or RTCP packet, you can use the other constructor which tries to determine the type based on the header. A memory manager can be installed as well.

◆ RTPRawPacket() [2/2]

jrtplib::RTPRawPacket::RTPRawPacket ( uint8_t *  data,
size_t  datalen,
RTPAddress address,
RTPTime recvtime,
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. A memory manager can be installed as well. This is similar to the other constructor where you have to specify yourself if the packet is supposed to contain RTP or RTCP data. In this version, based on the header information the packet type will be determined.

Member Function Documentation

◆ SetData()

void jrtplib::RTPRawPacket::SetData ( uint8_t *  data,
size_t  datalen 
)
inline

◆ ZeroData()

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: