SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
qrtplib::RTPRawPacket Class Reference

#include <rtprawpacket.h>

+ Collaboration diagram for qrtplib::RTPRawPacket:

Public Member Functions

 RTPRawPacket (const uint8_t *data, std::size_t datalen, const RTPAddress &address, RTPTime &recvtime, bool rtp)
 
 ~RTPRawPacket ()
 
uint8_tGetData ()
 
std::size_t GetDataLength () const
 
RTPTime GetReceiveTime () const
 
const RTPAddressGetSenderAddress () const
 
bool IsRTP () const
 
void SetData (const uint8_t *data, std::size_t datalen)
 
void SetSenderAddress (const RTPAddress &address)
 

Private Member Functions

void DeleteData ()
 

Private Attributes

uint8_tpacketdata
 
std::size_t packetdatalength
 
RTPTime receivetime
 
RTPAddress senderaddress
 
bool isrtp
 

Detailed Description

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

Definition at line 50 of file rtprawpacket.h.

Constructor & Destructor Documentation

◆ RTPRawPacket()

qrtplib::RTPRawPacket::RTPRawPacket ( const uint8_t data,
std::size_t  datalen,
const RTPAddress address,
RTPTime recvtime,
bool  rtp 
)
inline

Creates an instance which stores data from data with length datalen. 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.

Definition at line 110 of file rtprawpacket.h.

References isrtp, packetdata, packetdatalength, and senderaddress.

110  :
111  receivetime(recvtime)
112 {
113  packetdata = new uint8_t[datalen];
114  memcpy(packetdata, data, datalen);
115  packetdatalength = datalen;
116  senderaddress = address;
117  isrtp = rtp;
118 }
RTPAddress senderaddress
Definition: rtprawpacket.h:106
unsigned char uint8_t
Definition: rtptypes_win.h:42
std::size_t packetdatalength
Definition: rtprawpacket.h:104

◆ ~RTPRawPacket()

qrtplib::RTPRawPacket::~RTPRawPacket ( )
inline

Definition at line 120 of file rtprawpacket.h.

References DeleteData().

121 {
122  DeleteData();
123 }
+ Here is the call graph for this function:

Member Function Documentation

◆ DeleteData()

void qrtplib::RTPRawPacket::DeleteData ( )
inlineprivate

Definition at line 125 of file rtprawpacket.h.

References packetdata.

Referenced by IsRTP(), and ~RTPRawPacket().

126 {
127  if (packetdata)
128  {
129  delete[] packetdata;
130  packetdata = 0;
131  }
132 }
+ Here is the caller graph for this function:

◆ GetData()

uint8_t* qrtplib::RTPRawPacket::GetData ( )
inline

Returns the pointer to the data which is contained in this packet.

Definition at line 64 of file rtprawpacket.h.

References packetdata.

Referenced by qrtplib::RTPPacket::ParseRawPacket(), and qrtplib::RTCPCompoundPacket::RTCPCompoundPacket().

65  {
66  return packetdata;
67  }
+ Here is the caller graph for this function:

◆ GetDataLength()

std::size_t qrtplib::RTPRawPacket::GetDataLength ( ) const
inline

Returns the length of the packet described by this instance.

Definition at line 70 of file rtprawpacket.h.

References packetdatalength.

Referenced by qrtplib::RTPPacket::ParseRawPacket(), and qrtplib::RTCPCompoundPacket::RTCPCompoundPacket().

71  {
72  return packetdatalength;
73  }
std::size_t packetdatalength
Definition: rtprawpacket.h:104
+ Here is the caller graph for this function:

◆ GetReceiveTime()

RTPTime qrtplib::RTPRawPacket::GetReceiveTime ( ) const
inline

Returns the time at which this packet was received.

Definition at line 76 of file rtprawpacket.h.

References receivetime.

Referenced by qrtplib::RTPSession::ProcessPolledData(), and qrtplib::RTPSources::ProcessRawPacket().

77  {
78  return receivetime;
79  }
+ Here is the caller graph for this function:

◆ GetSenderAddress()

const RTPAddress& qrtplib::RTPRawPacket::GetSenderAddress ( ) const
inline

Returns the address stored in this packet.

Definition at line 82 of file rtprawpacket.h.

References senderaddress.

Referenced by qrtplib::RTPSession::ProcessPolledData(), and qrtplib::RTPSources::ProcessRawPacket().

83  {
84  return senderaddress;
85  }
RTPAddress senderaddress
Definition: rtprawpacket.h:106
+ Here is the caller graph for this function:

◆ IsRTP()

bool qrtplib::RTPRawPacket::IsRTP ( ) const
inline

Returns true if this data is RTP data, false if it is RTCP data.

Definition at line 88 of file rtprawpacket.h.

References DeleteData(), isrtp, SetData(), and SetSenderAddress().

Referenced by qrtplib::RTPPacket::ParseRawPacket(), qrtplib::RTPSources::ProcessRawPacket(), and qrtplib::RTCPCompoundPacket::RTCPCompoundPacket().

89  {
90  return isrtp;
91  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetData()

void qrtplib::RTPRawPacket::SetData ( const uint8_t data,
std::size_t  datalen 
)
inline

Deallocates the previously stored data and replaces it with the data that's specified, can be useful when e.g. decrypting data in RTPSession::OnChangeIncomingData

Definition at line 134 of file rtprawpacket.h.

References packetdata, and packetdatalength.

Referenced by IsRTP().

135 {
136  if (packetdata) {
137  delete[] packetdata;
138  }
139 
140  packetdata = new uint8_t[datalen];
141  memcpy(packetdata, data, datalen);
142  packetdatalength = datalen;
143 }
unsigned char uint8_t
Definition: rtptypes_win.h:42
std::size_t packetdatalength
Definition: rtprawpacket.h:104
+ Here is the caller graph for this function:

◆ SetSenderAddress()

void qrtplib::RTPRawPacket::SetSenderAddress ( const RTPAddress address)
inline

Deallocates the currently stored RTPAddress instance and replaces it with the one that's specified (you probably don't need this function).

Definition at line 145 of file rtprawpacket.h.

References senderaddress.

Referenced by IsRTP().

146 {
147  senderaddress = address;
148 }
RTPAddress senderaddress
Definition: rtprawpacket.h:106
+ Here is the caller graph for this function:

Member Data Documentation

◆ isrtp

bool qrtplib::RTPRawPacket::isrtp
private

Definition at line 107 of file rtprawpacket.h.

Referenced by IsRTP(), and RTPRawPacket().

◆ packetdata

uint8_t* qrtplib::RTPRawPacket::packetdata
private

Definition at line 103 of file rtprawpacket.h.

Referenced by DeleteData(), GetData(), RTPRawPacket(), and SetData().

◆ packetdatalength

std::size_t qrtplib::RTPRawPacket::packetdatalength
private

Definition at line 104 of file rtprawpacket.h.

Referenced by GetDataLength(), RTPRawPacket(), and SetData().

◆ receivetime

RTPTime qrtplib::RTPRawPacket::receivetime
private

Definition at line 105 of file rtprawpacket.h.

Referenced by GetReceiveTime().

◆ senderaddress

RTPAddress qrtplib::RTPRawPacket::senderaddress
private

Definition at line 106 of file rtprawpacket.h.

Referenced by GetSenderAddress(), RTPRawPacket(), and SetSenderAddress().


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