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.
|
#include <rtppacket.h>
Public Member Functions | |
RTPPacket (RTPRawPacket &rawpack) | |
RTPPacket (uint8_t payloadtype, const void *payloaddata, unsigned int payloadlen, uint16_t seqnr, uint32_t timestamp, uint32_t ssrc, bool gotmarker, uint8_t numcsrcs, const uint32_t *csrcs, bool gotextension, uint16_t extensionid, uint16_t extensionlen_numwords, const void *extensiondata, unsigned int maxpacksize) | |
RTPPacket (uint8_t payloadtype, const void *payloaddata, unsigned int payloadlen, uint16_t seqnr, uint32_t timestamp, uint32_t ssrc, bool gotmarker, uint8_t numcsrcs, const uint32_t *csrcs, bool gotextension, uint16_t extensionid, uint16_t extensionlen_numwords, const void *extensiondata, void *buffer, unsigned int buffersize) | |
virtual | ~RTPPacket () |
int | GetCreationError () const |
bool | HasExtension () const |
bool | HasMarker () const |
int | GetCSRCCount () const |
uint32_t | GetCSRC (int num) const |
uint8_t | GetPayloadType () const |
uint32_t | GetExtendedSequenceNumber () const |
uint16_t | GetSequenceNumber () const |
void | SetExtendedSequenceNumber (uint32_t seq) |
uint32_t | GetTimestamp () const |
uint32_t | GetSSRC () const |
uint8_t * | GetPacketData () const |
uint8_t * | GetPayloadData () const |
unsigned int | GetPacketLength () const |
unsigned int | GetPayloadLength () const |
uint16_t | GetExtensionID () const |
uint8_t * | GetExtensionData () const |
unsigned int | GetExtensionLength () const |
RTPTime | GetReceiveTime () const |
Private Member Functions | |
void | Clear () |
int | ParseRawPacket (RTPRawPacket &rawpack) |
int | BuildPacket (uint8_t payloadtype, const void *payloaddata, unsigned int payloadlen, uint16_t seqnr, uint32_t timestamp, uint32_t ssrc, bool gotmarker, uint8_t numcsrcs, const uint32_t *csrcs, bool gotextension, uint16_t extensionid, uint16_t extensionlen_numwords, const void *extensiondata, void *buffer, unsigned int maxsize) |
Private Attributes | |
RTPEndian | m_endian |
int | error |
bool | hasextension |
bool | hasmarker |
int | numcsrcs |
uint8_t | payloadtype |
uint32_t | extseqnr |
uint32_t | timestamp |
uint32_t | ssrc |
uint8_t * | packet |
uint8_t * | payload |
unsigned int | packetlength |
unsigned int | payloadlength |
uint16_t | extid |
uint8_t * | extension |
unsigned int | extensionlength |
bool | externalbuffer |
RTPTime | receivetime |
Represents an RTP Packet. The RTPPacket class can be used to parse a RTPRawPacket instance if it represents RTP data. The class can also be used to create a new RTP packet according to the parameters specified by the user.
Definition at line 56 of file rtppacket.h.
qrtplib::RTPPacket::RTPPacket | ( | RTPRawPacket & | rawpack | ) |
Creates an RTPPacket instance based upon the data in rawpack
, optionally installing a memory manager. Creates an RTPPacket instance based upon the data in rawpack
, optionally installing a memory manager. If successful, the data is moved from the raw packet to the RTPPacket instance.
Definition at line 63 of file rtppacket.cpp.
References Clear(), error, and ParseRawPacket().
qrtplib::RTPPacket::RTPPacket | ( | uint8_t | payloadtype, |
const void * | payloaddata, | ||
unsigned int | payloadlen, | ||
uint16_t | seqnr, | ||
uint32_t | timestamp, | ||
uint32_t | ssrc, | ||
bool | gotmarker, | ||
uint8_t | numcsrcs, | ||
const uint32_t * | csrcs, | ||
bool | gotextension, | ||
uint16_t | extensionid, | ||
uint16_t | extensionlen_numwords, | ||
const void * | extensiondata, | ||
unsigned int | maxpacksize | ||
) |
Creates a new buffer for an RTP packet and fills in the fields according to the specified parameters. Creates a new buffer for an RTP packet and fills in the fields according to the specified parameters. If maxpacksize
is not equal to zero, an error is generated if the total packet size would exceed maxpacksize
. The arguments of the constructor are self-explanatory. Note that the size of a header extension is specified in a number of 32-bit words. A memory manager can be installed.
Definition at line 70 of file rtppacket.cpp.
References BuildPacket(), Clear(), and error.
qrtplib::RTPPacket::RTPPacket | ( | uint8_t | payloadtype, |
const void * | payloaddata, | ||
unsigned int | payloadlen, | ||
uint16_t | seqnr, | ||
uint32_t | timestamp, | ||
uint32_t | ssrc, | ||
bool | gotmarker, | ||
uint8_t | numcsrcs, | ||
const uint32_t * | csrcs, | ||
bool | gotextension, | ||
uint16_t | extensionid, | ||
uint16_t | extensionlen_numwords, | ||
const void * | extensiondata, | ||
void * | buffer, | ||
unsigned int | buffersize | ||
) |
This constructor is similar to the other constructor, but here data is stored in an external buffer buffer
with size buffersize
.
Definition at line 106 of file rtppacket.cpp.
References BuildPacket(), Clear(), ERR_RTP_PACKET_EXTERNALBUFFERNULL, ERR_RTP_PACKET_ILLEGALBUFFERSIZE, and error.
|
inlinevirtual |
|
private |
Definition at line 264 of file rtppacket.cpp.
References qrtplib::RTPHeader::csrccount, ERR_RTP_PACKET_BADPAYLOADTYPE, ERR_RTP_PACKET_DATAEXCEEDSMAXSIZE, ERR_RTP_PACKET_TOOMANYCSRCS, qrtplib::RTPHeader::extension, extensionlength, externalbuffer, qrtplib::RTPExtensionHeader::extid, extid, extseqnr, hasextension, hasmarker, i, qrtplib::RTPExtensionHeader::length, qrtplib::RTPHeader::marker, numcsrcs, packet, packetlength, qrtplib::RTPHeader::padding, payload, payloadlength, qrtplib::RTPHeader::payloadtype, payloadtype, RTP_MAXCSRCS, RTP_VERSION, qrtplib::RTPHeader::sequencenumber, qrtplib::RTPHeader::ssrc, ssrc, qrtplib::RTPHeader::timestamp, timestamp, and qrtplib::RTPHeader::version.
Referenced by GetReceiveTime(), and RTPPacket().
|
private |
Definition at line 43 of file rtppacket.cpp.
References error, extension, extensionlength, externalbuffer, extid, extseqnr, hasextension, hasmarker, numcsrcs, packet, packetlength, payload, payloadlength, payloadtype, ssrc, and timestamp.
Referenced by GetReceiveTime(), and RTPPacket().
|
inline |
If an error occurred in one of the constructors, this function returns the error code.
Definition at line 111 of file rtppacket.h.
References error.
Referenced by qrtplib::RTPPacketBuilder::PrivateBuildPacket(), and qrtplib::RTPSources::ProcessRawPacket().
uint32_t qrtplib::RTPPacket::GetCSRC | ( | int | num | ) | const |
Returns a specific CSRC identifier. Returns a specific CSRC identifier. The parameter num
can go from 0 to GetCSRCCount()-1.
Definition at line 249 of file rtppacket.cpp.
References m_endian, numcsrcs, packet, and qrtplib::RTPEndian::qToHost().
Referenced by GetCSRCCount(), and qrtplib::RTPSources::ProcessRTPPacket().
|
inline |
Returns the number of CSRCs contained in this packet.
Definition at line 129 of file rtppacket.h.
References GetCSRC(), and numcsrcs.
Referenced by qrtplib::RTPSources::ProcessRTPPacket().
|
inline |
Returns the extended sequence number of the packet. Returns the extended sequence number of the packet. When the packet is just received, only the low $16$ bits will be set. The high 16 bits can be filled in later.
Definition at line 149 of file rtppacket.h.
References extseqnr.
Referenced by qrtplib::RTPSourceStats::ProcessPacket(), and qrtplib::RTPInternalSourceData::ProcessRTPPacket().
|
inline |
Returns the length of the header extension data.
Definition at line 209 of file rtppacket.h.
References extension.
|
inline |
If a header extension is present, this function returns the extension identifier.
Definition at line 203 of file rtppacket.h.
References extid.
|
inline |
Returns the length of the header extension data.
Definition at line 215 of file rtppacket.h.
References extensionlength.
|
inline |
Returns a pointer to the data of the entire packet.
Definition at line 179 of file rtppacket.h.
References packet.
|
inline |
Returns the length of the entire packet.
Definition at line 191 of file rtppacket.h.
References packetlength.
Referenced by qrtplib::RTPPacketBuilder::PrivateBuildPacket().
|
inline |
Returns a pointer to the actual payload data.
Definition at line 185 of file rtppacket.h.
References payload.
|
inline |
Returns the payload length.
Definition at line 197 of file rtppacket.h.
References payloadlength.
Referenced by qrtplib::RTPPacketBuilder::PrivateBuildPacket().
|
inline |
Returns the payload type of the packet.
Definition at line 140 of file rtppacket.h.
References payloadtype.
|
inline |
Returns the time at which this packet was received. When an RTPPacket instance is created from an RTPRawPacket instance, the raw packet's reception time is stored in the RTPPacket instance. This function then retrieves that time.
Definition at line 225 of file rtppacket.h.
References BuildPacket(), Clear(), ParseRawPacket(), and receivetime.
|
inline |
Returns the sequence number of this packet.
Definition at line 155 of file rtppacket.h.
References extseqnr.
|
inline |
Returns the SSRC identifier stored in this packet.
Definition at line 173 of file rtppacket.h.
References ssrc.
Referenced by qrtplib::RTPSources::ProcessRTPPacket().
|
inline |
Returns the timestamp of this packet.
Definition at line 167 of file rtppacket.h.
References timestamp.
Referenced by qrtplib::RTPSourceStats::ProcessPacket().
|
inline |
Returns true
if the RTP packet has a header extension and false
otherwise.
Definition at line 117 of file rtppacket.h.
References hasextension.
|
inline |
Returns true
if the marker bit was set and false
otherwise.
Definition at line 123 of file rtppacket.h.
References hasmarker.
|
private |
Definition at line 148 of file rtppacket.cpp.
References qrtplib::RTPHeader::csrccount, ERR_RTP_PACKET_INVALIDPACKET, qrtplib::RTPHeader::extension, extension, extensionlength, qrtplib::RTPExtensionHeader::extid, extid, extseqnr, qrtplib::RTPRawPacket::GetData(), qrtplib::RTPRawPacket::GetDataLength(), hasextension, hasmarker, qrtplib::RTPRawPacket::IsRTP(), qrtplib::RTPExtensionHeader::length, m_endian, qrtplib::RTPHeader::marker, numcsrcs, packet, packetlength, qrtplib::RTPHeader::padding, payload, payloadlength, qrtplib::RTPHeader::payloadtype, payloadtype, qrtplib::RTPEndian::qToHost(), RTP_RTCPTYPE_RR, RTP_RTCPTYPE_SR, RTP_VERSION, qrtplib::RTPHeader::sequencenumber, qrtplib::RTPHeader::ssrc, ssrc, qrtplib::RTPHeader::timestamp, timestamp, and qrtplib::RTPHeader::version.
Referenced by GetReceiveTime(), and RTPPacket().
|
inline |
Sets the extended sequence number of this packet to seq
.
Definition at line 161 of file rtppacket.h.
References extseqnr.
Referenced by qrtplib::RTPSourceStats::ProcessPacket().
|
private |
Definition at line 236 of file rtppacket.h.
Referenced by Clear(), GetCreationError(), and RTPPacket().
|
private |
Definition at line 247 of file rtppacket.h.
Referenced by Clear(), GetExtensionData(), and ParseRawPacket().
|
private |
Definition at line 248 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetExtensionLength(), and ParseRawPacket().
|
private |
Definition at line 250 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), and ~RTPPacket().
|
private |
Definition at line 246 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetExtensionID(), and ParseRawPacket().
|
private |
Definition at line 242 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetExtendedSequenceNumber(), GetSequenceNumber(), ParseRawPacket(), and SetExtendedSequenceNumber().
|
private |
Definition at line 238 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), HasExtension(), and ParseRawPacket().
|
private |
Definition at line 238 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), HasMarker(), and ParseRawPacket().
|
private |
Definition at line 235 of file rtppacket.h.
Referenced by GetCSRC(), and ParseRawPacket().
|
private |
Definition at line 239 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetCSRC(), GetCSRCCount(), and ParseRawPacket().
|
private |
Definition at line 243 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetCSRC(), GetPacketData(), ParseRawPacket(), and ~RTPPacket().
|
private |
Definition at line 244 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetPacketLength(), and ParseRawPacket().
|
private |
Definition at line 243 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetPayloadData(), and ParseRawPacket().
|
private |
Definition at line 244 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetPayloadLength(), and ParseRawPacket().
|
private |
Definition at line 241 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetPayloadType(), and ParseRawPacket().
|
private |
Definition at line 252 of file rtppacket.h.
Referenced by GetReceiveTime().
|
private |
Definition at line 242 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetSSRC(), and ParseRawPacket().
|
private |
Definition at line 242 of file rtppacket.h.
Referenced by BuildPacket(), Clear(), GetTimestamp(), and ParseRawPacket().