37 #ifndef RTPRAWPACKET_H
39 #define RTPRAWPACKET_H
41 #include "rtpconfig.h"
90 bool IsRTP()
const {
return isrtp; }
99 void ZeroData() { packetdata = 0; packetdatalength = 0; }
104 uint8_t *AllocateBytes(
bool isrtp,
int recvlen)
const;
108 void SetData(uint8_t *data,
size_t datalen);
117 size_t packetdatalength;
126 packetdatalength = datalen;
127 senderaddress = address;
134 packetdatalength = datalen;
135 senderaddress = address;
138 if (datalen >=
sizeof(RTCPCommonHeader))
140 RTCPCommonHeader *rtcpheader = (RTCPCommonHeader *)data;
141 uint8_t packettype = rtcpheader->packettype;
143 if (packettype >= 200 && packettype <= 204)
148 inline RTPRawPacket::~RTPRawPacket()
153 inline void RTPRawPacket::DeleteData()
156 RTPDeleteByteArray(packetdata,GetMemoryManager());
158 RTPDelete(senderaddress,GetMemoryManager());
166 JRTPLIB_UNUSED(isrtp);
173 RTPDeleteByteArray(packetdata,GetMemoryManager());
176 packetdatalength = datalen;
182 RTPDelete(senderaddress, GetMemoryManager());
184 senderaddress = address;
This class is an abstract class which is used to specify destinations, multicast groups etc.
Definition: rtpaddress.h:51
A memory manager.
Definition: rtpmemorymanager.h:151
This class is used by the transmission component to store the incoming RTP and RTCP data in.
Definition: rtprawpacket.h:53
const RTPAddress * GetSenderAddress() const
Returns the address stored in this packet.
Definition: rtprawpacket.h:87
void SetData(uint8_t *data, size_t datalen)
Deallocates the previously stored data and replaces it with the data that's specified,...
Definition: rtprawpacket.h:170
void SetSenderAddress(RTPAddress *address)
Deallocates the currently stored RTPAddress instance and replaces it with the one that's specified (y...
Definition: rtprawpacket.h:179
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.
Definition: rtprawpacket.h:123
void ZeroData()
Sets the pointer to the data stored in this packet to zero.
Definition: rtprawpacket.h:99
uint8_t * GetData()
Returns the pointer to the data which is contained in this packet.
Definition: rtprawpacket.h:78
bool IsRTP() const
Returns true if this data is RTP data, false if it is RTCP data.
Definition: rtprawpacket.h:90
RTPTime GetReceiveTime() const
Returns the time at which this packet was received.
Definition: rtprawpacket.h:84
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 ...
Definition: rtprawpacket.h:164
size_t GetDataLength() const
Returns the length of the packet described by this instance.
Definition: rtprawpacket.h:81
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:86
#define RTPMEM_TYPE_BUFFER_RECEIVEDRTPPACKET
Buffer to store an incoming RTP packet.
Definition: rtpmemorymanager.h:48
#define RTPMEM_TYPE_BUFFER_RECEIVEDRTCPPACKET
Buffer to store an incoming RTCP packet.
Definition: rtpmemorymanager.h:51