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 <rtcpcompoundpacketbuilder.h>
Classes | |
class | Buffer |
class | Report |
class | SDES |
class | SDESSource |
Public Member Functions | |
RTCPCompoundPacketBuilder () | |
~RTCPCompoundPacketBuilder () | |
int | InitBuild (std::size_t maxpacketsize) |
int | InitBuild (void *externalbuffer, std::size_t buffersize) |
int | StartSenderReport (uint32_t senderssrc, const RTPNTPTime &ntptimestamp, uint32_t rtptimestamp, uint32_t packetcount, uint32_t octetcount) |
int | StartReceiverReport (uint32_t senderssrc) |
int | AddReportBlock (uint32_t ssrc, uint8_t fractionlost, int32_t packetslost, uint32_t exthighestseq, uint32_t jitter, uint32_t lsr, uint32_t dlsr) |
int | AddSDESSource (uint32_t ssrc) |
int | AddSDESNormalItem (RTCPSDESPacket::ItemType t, const void *itemdata, uint8_t itemlength) |
int | AddSDESPrivateItem (const void *prefixdata, uint8_t prefixlength, const void *valuedata, uint8_t valuelength) |
int | AddBYEPacket (uint32_t *ssrcs, uint8_t numssrcs, const void *reasondata, uint8_t reasonlength) |
int | AddAPPPacket (uint8_t subtype, uint32_t ssrc, const uint8_t name[4], const void *appdata, std::size_t appdatalen) |
int | EndBuild () |
Public Member Functions inherited from qrtplib::RTCPCompoundPacket | |
RTCPCompoundPacket (RTPRawPacket &rawpack) | |
RTCPCompoundPacket (uint8_t *packet, std::size_t len) | |
virtual | ~RTCPCompoundPacket () |
int | GetCreationError () |
uint8_t * | GetCompoundPacketData () |
std::size_t | GetCompoundPacketLength () |
void | GotoFirstPacket () |
RTCPPacket * | GetNextPacket () |
Private Member Functions | |
void | ClearBuildBuffers () |
Private Attributes | |
RTPEndian | m_endian |
std::size_t | maximumpacketsize |
uint8_t * | buffer |
bool | external |
bool | arebuilding |
Report | report |
SDES | sdes |
std::list< Buffer > | byepackets |
std::size_t | byesize |
std::list< Buffer > | apppackets |
std::size_t | appsize |
Additional Inherited Members | |
Protected Member Functions inherited from qrtplib::RTCPCompoundPacket | |
RTCPCompoundPacket () | |
void | ClearPacketList () |
int | ParseData (uint8_t *packet, std::size_t len) |
Protected Attributes inherited from qrtplib::RTCPCompoundPacket | |
RTPEndian | m_endian |
int | error |
uint8_t * | compoundpacket |
std::size_t | compoundpacketlength |
std::list< RTCPPacket * > | rtcppacklist |
std::list< RTCPPacket * >::const_iterator | rtcppackit |
This class can be used to construct an RTCP compound packet. The RTCPCompoundPacketBuilder class can be used to construct an RTCP compound packet. It inherits the member functions of RTCPCompoundPacket which can be used to access the information in the compound packet once it has been built successfully. The member functions described below return ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT
if the action would cause the maximum allowed size to be exceeded.
Definition at line 62 of file rtcpcompoundpacketbuilder.h.
qrtplib::RTCPCompoundPacketBuilder::RTCPCompoundPacketBuilder | ( | ) |
Constructs an RTCPCompoundPacketBuilder instance, optionally installing a memory manager.
Definition at line 44 of file rtcpcompoundpacketbuilder.cpp.
References appsize, arebuilding, buffer, byesize, external, and maximumpacketsize.
qrtplib::RTCPCompoundPacketBuilder::~RTCPCompoundPacketBuilder | ( | ) |
Definition at line 54 of file rtcpcompoundpacketbuilder.cpp.
References ClearBuildBuffers(), qrtplib::RTCPCompoundPacket::compoundpacket, and external.
int qrtplib::RTCPCompoundPacketBuilder::AddAPPPacket | ( | uint8_t | subtype, |
uint32_t | ssrc, | ||
const uint8_t | name[4], | ||
const void * | appdata, | ||
std::size_t | appdatalen | ||
) |
Adds the APP packet specified by the arguments to the compound packet. Adds the APP packet specified by the arguments to the compound packet. Note that appdatalen
has to be a multiple of four.
Definition at line 397 of file rtcpcompoundpacketbuilder.cpp.
References apppackets, appsize, arebuilding, byesize, qrtplib::RTCPCommonHeader::count, ERR_RTP_RTCPCOMPPACKBUILDER_APPDATALENTOOBIG, ERR_RTP_RTCPCOMPPACKBUILDER_ILLEGALAPPDATALENGTH, ERR_RTP_RTCPCOMPPACKBUILDER_ILLEGALSUBTYPE, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, qrtplib::RTCPCommonHeader::length, maximumpacketsize, qrtplib::RTCPCompoundPacketBuilder::Report::NeededBytes(), qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytes(), qrtplib::RTCPCommonHeader::packettype, qrtplib::RTCPCommonHeader::padding, report, RTP_RTCPTYPE_APP, sdes, and qrtplib::RTCPCommonHeader::version.
Referenced by qrtplib::RTPSession::SendRTCPAPPPacket().
int qrtplib::RTCPCompoundPacketBuilder::AddBYEPacket | ( | uint32_t * | ssrcs, |
uint8_t | numssrcs, | ||
const void * | reasondata, | ||
uint8_t | reasonlength | ||
) |
Adds a BYE packet to the compound packet. Adds a BYE packet to the compound packet. It will contain numssrcs
source identifiers specified in ssrcs
and will indicate as reason for leaving the string of length reasonlength
containing data reasondata
.
Definition at line 331 of file rtcpcompoundpacketbuilder.cpp.
References appsize, arebuilding, byepackets, byesize, qrtplib::RTCPCommonHeader::count, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, ERR_RTP_RTCPCOMPPACKBUILDER_TOOMANYSSRCS, i, qrtplib::RTCPCommonHeader::length, maximumpacketsize, qrtplib::RTCPCompoundPacketBuilder::Report::NeededBytes(), qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytes(), qrtplib::RTCPCommonHeader::packettype, qrtplib::RTCPCommonHeader::padding, report, RTP_RTCPTYPE_BYE, sdes, and qrtplib::RTCPCommonHeader::version.
Referenced by qrtplib::RTCPPacketBuilder::BuildBYEPacket().
int qrtplib::RTCPCompoundPacketBuilder::AddReportBlock | ( | uint32_t | ssrc, |
uint8_t | fractionlost, | ||
int32_t | packetslost, | ||
uint32_t | exthighestseq, | ||
uint32_t | jitter, | ||
uint32_t | lsr, | ||
uint32_t | dlsr | ||
) |
Adds the report block information specified by the function's arguments. Adds the report block information specified by the function's arguments. If more than 31 report blocks are added, the builder will automatically use a new RTCP receiver report packet.
Definition at line 181 of file rtcpcompoundpacketbuilder.cpp.
References appsize, arebuilding, byesize, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, ERR_RTP_RTCPCOMPPACKBUILDER_REPORTNOTSTARTED, qrtplib::RTCPCompoundPacketBuilder::Report::headerlength, maximumpacketsize, qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytes(), qrtplib::RTCPCompoundPacketBuilder::Report::NeededBytesWithExtraReportBlock(), report, qrtplib::RTCPCompoundPacketBuilder::Report::reportblocks, sdes, and qrtplib::RTCPReceiverReport::ssrc.
Referenced by qrtplib::RTCPPacketBuilder::FillInReportBlocks().
int qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem | ( | RTCPSDESPacket::ItemType | t, |
const void * | itemdata, | ||
uint8_t | itemlength | ||
) |
Adds a normal (non-private) SDES item of type t
to the current SDES chunk. Adds a normal (non-private) SDES item of type t
to the current SDES chunk. The item's value will have length itemlength
and will contain the data itemdata
.
Definition at line 232 of file rtcpcompoundpacketbuilder.cpp.
References qrtplib::RTCPCompoundPacketBuilder::SDES::AddItem(), appsize, arebuilding, byesize, qrtplib::RTCPSDESPacket::CNAME, qrtplib::RTCPSDESPacket::EMAIL, ERR_RTP_RTCPCOMPPACKBUILDER_INVALIDITEMTYPE, ERR_RTP_RTCPCOMPPACKBUILDER_NOCURRENTSOURCE, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, qrtplib::RTCPSDESHeader::length, qrtplib::RTCPSDESPacket::LOC, maximumpacketsize, qrtplib::RTCPSDESPacket::NAME, qrtplib::RTCPCompoundPacketBuilder::Report::NeededBytes(), qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytesWithExtraItem(), qrtplib::RTCPSDESPacket::NOTE, qrtplib::RTCPSDESPacket::PHONE, report, RTCP_SDES_ID_CNAME, RTCP_SDES_ID_EMAIL, RTCP_SDES_ID_LOCATION, RTCP_SDES_ID_NAME, RTCP_SDES_ID_NOTE, RTCP_SDES_ID_PHONE, RTCP_SDES_ID_TOOL, sdes, qrtplib::RTCPSDESHeader::sdesid, qrtplib::RTCPCompoundPacketBuilder::SDES::sdessources, and qrtplib::RTCPSDESPacket::TOOL.
Referenced by qrtplib::RTCPPacketBuilder::BuildBYEPacket(), qrtplib::RTCPPacketBuilder::BuildNextPacket(), qrtplib::RTCPPacketBuilder::FillInSDES(), and qrtplib::RTPSession::SendRTCPAPPPacket().
int qrtplib::RTCPCompoundPacketBuilder::AddSDESPrivateItem | ( | const void * | prefixdata, |
uint8_t | prefixlength, | ||
const void * | valuedata, | ||
uint8_t | valuelength | ||
) |
Adds an SDES PRIV item described by the function's arguments to the current SDES chunk.
Definition at line 292 of file rtcpcompoundpacketbuilder.cpp.
References qrtplib::RTCPCompoundPacketBuilder::SDES::AddItem(), appsize, arebuilding, byesize, ERR_RTP_RTCPCOMPPACKBUILDER_NOCURRENTSOURCE, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, ERR_RTP_RTCPCOMPPACKBUILDER_TOTALITEMLENGTHTOOBIG, qrtplib::RTCPSDESHeader::length, maximumpacketsize, qrtplib::RTCPCompoundPacketBuilder::Report::NeededBytes(), qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytesWithExtraItem(), report, RTCP_SDES_ID_PRIVATE, sdes, qrtplib::RTCPSDESHeader::sdesid, and qrtplib::RTCPCompoundPacketBuilder::SDES::sdessources.
int qrtplib::RTCPCompoundPacketBuilder::AddSDESSource | ( | uint32_t | ssrc | ) |
Starts an SDES chunk for participant ssrc
.
Definition at line 214 of file rtcpcompoundpacketbuilder.cpp.
References qrtplib::RTCPCompoundPacketBuilder::SDES::AddSSRC(), appsize, arebuilding, byesize, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, maximumpacketsize, qrtplib::RTCPCompoundPacketBuilder::Report::NeededBytes(), qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytesWithExtraSource(), report, and sdes.
Referenced by qrtplib::RTCPPacketBuilder::BuildBYEPacket(), qrtplib::RTCPPacketBuilder::BuildNextPacket(), and qrtplib::RTPSession::SendRTCPAPPPacket().
|
private |
Definition at line 61 of file rtcpcompoundpacketbuilder.cpp.
References apppackets, appsize, byepackets, byesize, qrtplib::RTCPCompoundPacketBuilder::Report::Clear(), qrtplib::RTCPCompoundPacketBuilder::SDES::Clear(), report, and sdes.
Referenced by EndBuild(), and ~RTCPCompoundPacketBuilder().
int qrtplib::RTCPCompoundPacketBuilder::EndBuild | ( | ) |
Finishes building the compound packet. Finishes building the compound packet. If successful, the RTCPCompoundPacket member functions can be used to access the RTCP packet data.
Definition at line 447 of file rtcpcompoundpacketbuilder.cpp.
References apppackets, appsize, arebuilding, buffer, byepackets, byesize, ClearBuildBuffers(), qrtplib::RTCPCompoundPacket::compoundpacket, qrtplib::RTCPCompoundPacket::compoundpacketlength, qrtplib::RTCPCommonHeader::count, ERR_RTP_RTCPCOMPPACKBUILDER_NOREPORTPRESENT, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, external, qrtplib::RTCPCompoundPacketBuilder::Report::headerdata, qrtplib::RTCPCompoundPacketBuilder::Report::headerlength, i, qrtplib::RTCPCompoundPacketBuilder::Report::isSR, qrtplib::RTCPCommonHeader::length, qrtplib::RTCPCompoundPacketBuilder::Report::NeededBytes(), qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytes(), qrtplib::RTCPCommonHeader::packettype, qrtplib::RTCPCommonHeader::padding, report, qrtplib::RTCPCompoundPacketBuilder::Report::reportblocks, qrtplib::RTCPCompoundPacket::rtcppacklist, RTP_RTCPTYPE_RR, RTP_RTCPTYPE_SDES, RTP_RTCPTYPE_SR, sdes, qrtplib::RTCPCompoundPacketBuilder::SDES::sdessources, and qrtplib::RTCPCommonHeader::version.
Referenced by qrtplib::RTCPPacketBuilder::BuildBYEPacket(), qrtplib::RTCPPacketBuilder::BuildNextPacket(), and qrtplib::RTPSession::SendRTCPAPPPacket().
int qrtplib::RTCPCompoundPacketBuilder::InitBuild | ( | std::size_t | maxpacketsize | ) |
Starts building an RTCP compound packet with maximum size maxpacketsize
. Starts building an RTCP compound packet with maximum size maxpacketsize
. New memory will be allocated to store the packet.
Definition at line 83 of file rtcpcompoundpacketbuilder.cpp.
References appsize, arebuilding, buffer, byesize, qrtplib::RTCPCompoundPacket::compoundpacket, ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYBUILT, ERR_RTP_RTCPCOMPPACKBUILDER_MAXPACKETSIZETOOSMALL, external, maximumpacketsize, and RTP_MINPACKETSIZE.
Referenced by qrtplib::RTCPPacketBuilder::BuildBYEPacket(), qrtplib::RTCPPacketBuilder::BuildNextPacket(), and qrtplib::RTPSession::SendRTCPAPPPacket().
int qrtplib::RTCPCompoundPacketBuilder::InitBuild | ( | void * | externalbuffer, |
std::size_t | buffersize | ||
) |
Starts building a RTCP compound packet. Starts building a RTCP compound packet. Data will be stored in externalbuffer
which can contain buffersize
bytes.
Definition at line 103 of file rtcpcompoundpacketbuilder.cpp.
References appsize, arebuilding, buffer, byesize, qrtplib::RTCPCompoundPacket::compoundpacket, ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYBUILT, ERR_RTP_RTCPCOMPPACKBUILDER_BUFFERSIZETOOSMALL, external, maximumpacketsize, and RTP_MINPACKETSIZE.
int qrtplib::RTCPCompoundPacketBuilder::StartReceiverReport | ( | uint32_t | senderssrc | ) |
Adds a receiver report to the compound packet. Tells the packet builder that the packet should start with a receiver report which will contain he sender SSRC senderssrc
. Once the sender report is started, report blocks can be added using the AddReportBlock function.
Definition at line 156 of file rtcpcompoundpacketbuilder.cpp.
References appsize, arebuilding, byesize, ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYGOTREPORT, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, qrtplib::RTCPCompoundPacketBuilder::Report::headerdata, qrtplib::RTCPCompoundPacketBuilder::Report::headerlength, qrtplib::RTCPCompoundPacketBuilder::Report::isSR, maximumpacketsize, qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytes(), report, and sdes.
Referenced by qrtplib::RTCPPacketBuilder::BuildBYEPacket(), qrtplib::RTCPPacketBuilder::BuildNextPacket(), and qrtplib::RTPSession::SendRTCPAPPPacket().
int qrtplib::RTCPCompoundPacketBuilder::StartSenderReport | ( | uint32_t | senderssrc, |
const RTPNTPTime & | ntptimestamp, | ||
uint32_t | rtptimestamp, | ||
uint32_t | packetcount, | ||
uint32_t | octetcount | ||
) |
Adds a sender report to the compound packet. Tells the packet builder that the packet should start with a sender report which will contain the sender information specified by this function's arguments. Once the sender report is started, report blocks can be added using the AddReportBlock function.
Definition at line 123 of file rtcpcompoundpacketbuilder.cpp.
References appsize, arebuilding, byesize, ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYGOTREPORT, ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, qrtplib::RTPNTPTime::GetLSW(), qrtplib::RTPNTPTime::GetMSW(), qrtplib::RTCPCompoundPacketBuilder::Report::headerdata, qrtplib::RTCPCompoundPacketBuilder::Report::headerlength, qrtplib::RTCPCompoundPacketBuilder::Report::isSR, maximumpacketsize, qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytes(), qrtplib::RTCPSenderReport::ntptime_lsw, qrtplib::RTCPSenderReport::ntptime_msw, qrtplib::RTCPSenderReport::octetcount, qrtplib::RTCPSenderReport::packetcount, report, qrtplib::RTCPSenderReport::rtptimestamp, and sdes.
Referenced by qrtplib::RTCPPacketBuilder::BuildBYEPacket(), and qrtplib::RTCPPacketBuilder::BuildNextPacket().
|
private |
Definition at line 398 of file rtcpcompoundpacketbuilder.h.
Referenced by AddAPPPacket(), ClearBuildBuffers(), and EndBuild().
|
private |
Definition at line 399 of file rtcpcompoundpacketbuilder.h.
Referenced by AddAPPPacket(), AddBYEPacket(), AddReportBlock(), AddSDESNormalItem(), AddSDESPrivateItem(), AddSDESSource(), ClearBuildBuffers(), EndBuild(), InitBuild(), RTCPCompoundPacketBuilder(), StartReceiverReport(), and StartSenderReport().
|
private |
Definition at line 390 of file rtcpcompoundpacketbuilder.h.
Referenced by AddAPPPacket(), AddBYEPacket(), AddReportBlock(), AddSDESNormalItem(), AddSDESPrivateItem(), AddSDESSource(), EndBuild(), InitBuild(), RTCPCompoundPacketBuilder(), StartReceiverReport(), and StartSenderReport().
|
private |
Definition at line 388 of file rtcpcompoundpacketbuilder.h.
Referenced by EndBuild(), InitBuild(), and RTCPCompoundPacketBuilder().
|
private |
Definition at line 395 of file rtcpcompoundpacketbuilder.h.
Referenced by AddBYEPacket(), ClearBuildBuffers(), and EndBuild().
|
private |
Definition at line 396 of file rtcpcompoundpacketbuilder.h.
Referenced by AddAPPPacket(), AddBYEPacket(), AddReportBlock(), AddSDESNormalItem(), AddSDESPrivateItem(), AddSDESSource(), ClearBuildBuffers(), EndBuild(), InitBuild(), RTCPCompoundPacketBuilder(), StartReceiverReport(), and StartSenderReport().
|
private |
Definition at line 389 of file rtcpcompoundpacketbuilder.h.
Referenced by EndBuild(), InitBuild(), RTCPCompoundPacketBuilder(), and ~RTCPCompoundPacketBuilder().
|
private |
Definition at line 386 of file rtcpcompoundpacketbuilder.h.
|
private |
Definition at line 387 of file rtcpcompoundpacketbuilder.h.
Referenced by AddAPPPacket(), AddBYEPacket(), AddReportBlock(), AddSDESNormalItem(), AddSDESPrivateItem(), AddSDESSource(), InitBuild(), RTCPCompoundPacketBuilder(), StartReceiverReport(), and StartSenderReport().
|
private |
Definition at line 392 of file rtcpcompoundpacketbuilder.h.
Referenced by AddAPPPacket(), AddBYEPacket(), AddReportBlock(), AddSDESNormalItem(), AddSDESPrivateItem(), AddSDESSource(), ClearBuildBuffers(), EndBuild(), StartReceiverReport(), and StartSenderReport().
|
private |
Definition at line 393 of file rtcpcompoundpacketbuilder.h.
Referenced by AddAPPPacket(), AddBYEPacket(), AddReportBlock(), AddSDESNormalItem(), AddSDESPrivateItem(), AddSDESSource(), ClearBuildBuffers(), EndBuild(), StartReceiverReport(), and StartSenderReport().