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 <rtcppacketbuilder.h>
Classes | |
class | RTCPSDESInfoInternal |
Public Member Functions | |
RTCPPacketBuilder (RTPSources &sources, RTPPacketBuilder &rtppackbuilder) | |
~RTCPPacketBuilder () | |
int | Init (std::size_t maxpacksize, double timestampunit, const void *cname, std::size_t cnamelen) |
void | Destroy () |
int | SetTimestampUnit (double tsunit) |
int | SetMaximumPacketSize (std::size_t maxpacksize) |
int | SetPreTransmissionDelay (const RTPTime &delay) |
int | BuildNextPacket (RTCPCompoundPacket **pack) |
int | BuildBYEPacket (RTCPCompoundPacket **pack, const void *reason, std::size_t reasonlength, bool useSRifpossible=true) |
void | SetNameInterval (int count) |
void | SetEMailInterval (int count) |
void | SetLocationInterval (int count) |
void | SetPhoneInterval (int count) |
void | SetToolInterval (int count) |
void | SetNoteInterval (int count) |
int | SetLocalName (const void *s, std::size_t len) |
int | SetLocalEMail (const void *s, std::size_t len) |
int | SetLocalLocation (const void *s, std::size_t len) |
int | SetLocalPhone (const void *s, std::size_t len) |
int | SetLocalTool (const void *s, std::size_t len) |
int | SetLocalNote (const void *s, std::size_t len) |
uint8_t * | GetLocalCNAME (std::size_t *len) const |
Private Member Functions | |
void | ClearAllSourceFlags () |
int | FillInReportBlocks (RTCPCompoundPacketBuilder *pack, const RTPTime &curtime, int maxcount, bool *full, int *added, int *skipped, bool *atendoflist) |
int | FillInSDES (RTCPCompoundPacketBuilder *pack, bool *full, bool *processedall, int *added) |
void | ClearAllSDESFlags () |
Private Attributes | |
RTPSources & | sources |
RTPPacketBuilder & | rtppacketbuilder |
bool | init |
std::size_t | maxpacketsize |
double | timestampunit |
bool | firstpacket |
RTPTime | prevbuildtime |
RTPTime | transmissiondelay |
RTCPSDESInfoInternal | ownsdesinfo |
int | interval_name |
int | interval_email |
int | interval_location |
int | interval_phone |
int | interval_tool |
int | interval_note |
bool | doname |
bool | doemail |
bool | doloc |
bool | dophone |
bool | dotool |
bool | donote |
bool | processingsdes |
int | sdesbuildcount |
This class can be used to build RTCP compound packets, on a higher level than the RTCPCompoundPacketBuilder. The class RTCPPacketBuilder can be used to build RTCP compound packets. This class is more high-level than the RTCPCompoundPacketBuilder class: it uses the information of an RTPPacketBuilder instance and of an RTPSources instance to automatically generate the next compound packet which should be sent. It also provides functions to determine when SDES items other than the CNAME item should be sent.
Definition at line 64 of file rtcppacketbuilder.h.
qrtplib::RTCPPacketBuilder::RTCPPacketBuilder | ( | RTPSources & | sources, |
RTPPacketBuilder & | rtppackbuilder | ||
) |
Creates an RTCPPacketBuilder instance. Creates an instance which will use the source table sources
and the RTP packet builder rtppackbuilder
to determine the information for the next RTCP compound packet. Optionally, the memory manager mgr
can be installed.
Definition at line 43 of file rtcppacketbuilder.cpp.
References qrtplib::RTPTimeInitializerObject::Dummy(), init, and qrtplib::timeinit.
qrtplib::RTCPPacketBuilder::~RTCPPacketBuilder | ( | ) |
Definition at line 50 of file rtcppacketbuilder.cpp.
References Destroy().
int qrtplib::RTCPPacketBuilder::BuildBYEPacket | ( | RTCPCompoundPacket ** | pack, |
const void * | reason, | ||
std::size_t | reasonlength, | ||
bool | useSRifpossible = true |
||
) |
Builds a BYE packet with reason for leaving specified by reason
and length reasonlength
. Builds a BYE packet with reason for leaving specified by reason
and length reasonlength
. If useSRifpossible
is set to true
, the RTCP compound packet will start with a sender report if allowed. Otherwise, a receiver report is used.
Definition at line 627 of file rtcppacketbuilder.cpp.
References qrtplib::RTCPCompoundPacketBuilder::AddBYEPacket(), qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), qrtplib::RTCPCompoundPacketBuilder::AddSDESSource(), qrtplib::RTCPSDESPacket::CNAME, qrtplib::RTPTime::CurrentTime(), qrtplib::RTCPCompoundPacketBuilder::EndBuild(), ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, ERR_RTP_RTCPPACKETBUILDER_NOTINIT, ERR_RTP_RTCPPACKETBUILDER_PACKETFILLEDTOOSOON, qrtplib::RTCPSDESInfo::GetCNAME(), qrtplib::RTPTime::GetDouble(), qrtplib::RTPTime::GetNTPTime(), qrtplib::RTPSources::GetOwnSourceInfo(), qrtplib::RTPPacketBuilder::GetPacketCount(), qrtplib::RTPPacketBuilder::GetPacketTime(), qrtplib::RTPPacketBuilder::GetPacketTimestamp(), qrtplib::RTPPacketBuilder::GetPayloadOctetCount(), qrtplib::RTPPacketBuilder::GetSSRC(), init, qrtplib::RTCPCompoundPacketBuilder::InitBuild(), qrtplib::RTPSourceData::IsSender(), maxpacketsize, ownsdesinfo, rtppacketbuilder, sources, qrtplib::RTCPCompoundPacketBuilder::StartReceiverReport(), qrtplib::RTCPCompoundPacketBuilder::StartSenderReport(), and timestampunit.
Referenced by qrtplib::RTPSession::BYEDestroy(), and qrtplib::RTPSession::ProcessPolledData().
int qrtplib::RTCPPacketBuilder::BuildNextPacket | ( | RTCPCompoundPacket ** | pack | ) |
Builds the next RTCP compound packet which should be sent and stores it in pack
.
Definition at line 101 of file rtcppacketbuilder.cpp.
References qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), qrtplib::RTCPCompoundPacketBuilder::AddSDESSource(), ClearAllSDESFlags(), ClearAllSourceFlags(), qrtplib::RTCPSDESPacket::CNAME, qrtplib::RTPTime::CurrentTime(), doemail, doloc, doname, donote, dophone, dotool, qrtplib::RTCPCompoundPacketBuilder::EndBuild(), ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, ERR_RTP_RTCPPACKETBUILDER_NOTINIT, ERR_RTP_RTCPPACKETBUILDER_PACKETFILLEDTOOSOON, FillInReportBlocks(), FillInSDES(), firstpacket, qrtplib::RTCPSDESInfo::GetCNAME(), qrtplib::RTPTime::GetDouble(), qrtplib::RTPTime::GetNTPTime(), qrtplib::RTPSources::GetOwnSourceInfo(), qrtplib::RTPPacketBuilder::GetPacketCount(), qrtplib::RTPPacketBuilder::GetPacketTime(), qrtplib::RTPPacketBuilder::GetPacketTimestamp(), qrtplib::RTPPacketBuilder::GetPayloadOctetCount(), qrtplib::RTPPacketBuilder::GetSSRC(), qrtplib::RTPSources::GetTotalCount(), init, qrtplib::RTCPCompoundPacketBuilder::InitBuild(), interval_email, interval_location, interval_name, interval_note, interval_phone, interval_tool, qrtplib::RTPSourceData::IsSender(), maxpacketsize, ownsdesinfo, prevbuildtime, processingsdes, rtppacketbuilder, sdesbuildcount, sources, qrtplib::RTCPCompoundPacketBuilder::StartReceiverReport(), qrtplib::RTCPCompoundPacketBuilder::StartSenderReport(), timestampunit, and transmissiondelay.
Referenced by qrtplib::RTPSession::ProcessPolledData().
|
private |
Definition at line 622 of file rtcppacketbuilder.cpp.
References qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ClearFlags(), and ownsdesinfo.
Referenced by BuildNextPacket().
|
private |
Definition at line 309 of file rtcppacketbuilder.cpp.
References qrtplib::RTPSources::GetCurrentSourceInfo(), qrtplib::RTPSources::GotoFirstSource(), qrtplib::RTPSources::GotoNextSource(), qrtplib::RTPSourceData::SetProcessedInRTCP(), and sources.
Referenced by BuildNextPacket(), and Init().
void qrtplib::RTCPPacketBuilder::Destroy | ( | ) |
Cleans up the builder.
Definition at line 93 of file rtcppacketbuilder.cpp.
References qrtplib::RTCPSDESInfo::Clear(), init, and ownsdesinfo.
Referenced by qrtplib::RTPSession::BYEDestroy(), qrtplib::RTPSession::Destroy(), qrtplib::RTPSession::InternalCreate(), and ~RTCPPacketBuilder().
|
private |
Definition at line 321 of file rtcppacketbuilder.cpp.
References qrtplib::RTCPCompoundPacketBuilder::AddReportBlock(), ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, firstpacket, qrtplib::RTPSources::GetCurrentSourceInfo(), qrtplib::RTPTime::GetDouble(), qrtplib::RTPNTPTime::GetLSW(), qrtplib::RTPNTPTime::GetMSW(), qrtplib::RTPSourceData::GetSSRC(), qrtplib::RTPSources::GotoFirstSource(), qrtplib::RTPSources::GotoNextSource(), qrtplib::RTPSourceData::INF_GetBaseSequenceNumber(), qrtplib::RTPSourceData::INF_GetExtendedHighestSequenceNumber(), qrtplib::RTPSourceData::INF_GetJitter(), qrtplib::RTPSourceData::INF_GetLastRTPPacketTime(), qrtplib::RTPSourceData::INF_GetNumPacketsReceived(), qrtplib::RTPSourceData::INF_GetNumPacketsReceivedInInterval(), qrtplib::RTPSourceData::INF_GetSavedExtendedSequenceNumber(), qrtplib::RTPSourceData::INF_HasSentData(), qrtplib::RTPSourceData::INF_StartNewInterval(), qrtplib::RTPSourceData::IsCSRC(), qrtplib::RTPSourceData::IsOwnSSRC(), qrtplib::RTPSourceData::IsProcessedInRTCP(), prevbuildtime, qrtplib::RTPSourceData::SetProcessedInRTCP(), sources, qrtplib::RTPSourceData::SR_GetNTPTimestamp(), qrtplib::RTPSourceData::SR_GetReceiveTime(), and qrtplib::RTPSourceData::SR_HasInfo().
Referenced by BuildNextPacket().
|
private |
Definition at line 503 of file rtcppacketbuilder.cpp.
References qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), doemail, doloc, doname, donote, dophone, dotool, qrtplib::RTCPSDESPacket::EMAIL, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, qrtplib::RTCPSDESInfo::GetEMail(), qrtplib::RTCPSDESInfo::GetLocation(), qrtplib::RTCPSDESInfo::GetName(), qrtplib::RTCPSDESInfo::GetNote(), qrtplib::RTCPSDESInfo::GetPhone(), qrtplib::RTCPSDESInfo::GetTool(), qrtplib::RTCPSDESPacket::LOC, qrtplib::RTCPSDESPacket::NAME, qrtplib::RTCPSDESPacket::NOTE, ownsdesinfo, qrtplib::RTCPSDESPacket::PHONE, qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedEMail(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedLocation(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedName(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedNote(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedPhone(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedTool(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedEMail(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedLocation(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedName(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedNote(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedPhone(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedTool(), and qrtplib::RTCPSDESPacket::TOOL.
Referenced by BuildNextPacket().
|
inline |
Returns the own CNAME item with length len
Definition at line 263 of file rtcppacketbuilder.h.
Referenced by qrtplib::RTPSession::SendRTCPAPPPacket().
int qrtplib::RTCPPacketBuilder::Init | ( | std::size_t | maxpacksize, |
double | timestampunit, | ||
const void * | cname, | ||
std::size_t | cnamelen | ||
) |
Initializes the builder. Initializes the builder to use the maximum allowed packet size maxpacksize
, timestamp unit timestampunit
and the SDES CNAME item specified by cname
with length cnamelen
. The timestamp unit is defined as a time interval divided by the timestamp interval corresponding to that interval: for 8000 Hz audio this would be 1/8000.
Definition at line 55 of file rtcppacketbuilder.cpp.
References ClearAllSourceFlags(), ERR_RTP_RTCPPACKETBUILDER_ALREADYINIT, ERR_RTP_RTCPPACKETBUILDER_ILLEGALMAXPACKSIZE, ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT, firstpacket, init, interval_email, interval_location, interval_name, interval_note, interval_phone, interval_tool, maxpacketsize, ownsdesinfo, processingsdes, RTP_MINPACKETSIZE, sdesbuildcount, qrtplib::RTCPSDESInfo::SetCNAME(), timestampunit, and transmissiondelay.
Referenced by qrtplib::RTPSession::InternalCreate().
|
inline |
Sets the RTCP interval for the SDES e-mail item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES e-mail item will be added after the sources in the source table have been processed count
times.
Definition at line 155 of file rtcppacketbuilder.h.
Referenced by qrtplib::RTPSession::SetEMailInterval().
|
inline |
Sets the SDES e-mail item for the local participant to the value s
with length len
.
Definition at line 223 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetLocalEMail().
|
inline |
Sets the SDES location item for the local participant to the value s
with length len
.
Definition at line 231 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetLocalLocation().
|
inline |
Sets the SDES name item for the local participant to the value s
with length len
.
Definition at line 215 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetLocalName().
|
inline |
Sets the SDES note item for the local participant to the value s
with length len
.
Definition at line 255 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetLocalNote().
|
inline |
Sets the SDES phone item for the local participant to the value s
with length len
.
Definition at line 239 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetLocalPhone().
|
inline |
Sets the SDES tool item for the local participant to the value s
with length len
.
Definition at line 247 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetLocalTool().
|
inline |
Sets the RTCP interval for the SDES location item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES location item will be added after the sources in the source table have been processed count
times.
Definition at line 168 of file rtcppacketbuilder.h.
Referenced by qrtplib::RTPSession::SetLocationInterval().
|
inline |
Sets the maximum size allowed size of an RTCP compound packet to maxpacksize
.
Definition at line 102 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_ILLEGALMAXPACKSIZE, ERR_RTP_RTCPPACKETBUILDER_NOTINIT, and RTP_MINPACKETSIZE.
Referenced by qrtplib::RTPSession::SetMaximumPacketSize().
|
inline |
Sets the RTCP interval for the SDES name item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES name item will be added after the sources in the source table have been processed count
times.
Definition at line 142 of file rtcppacketbuilder.h.
Referenced by qrtplib::RTPSession::SetNameInterval().
|
inline |
Sets the RTCP interval for the SDES note item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES note item will be added after the sources in the source table have been processed count
times.
Definition at line 207 of file rtcppacketbuilder.h.
Referenced by qrtplib::RTPSession::SetNoteInterval().
|
inline |
Sets the RTCP interval for the SDES phone item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES phone item will be added after the sources in the source table have been processed count
times.
Definition at line 181 of file rtcppacketbuilder.h.
Referenced by qrtplib::RTPSession::SetPhoneInterval().
|
inline |
This function allows you to inform RTCP packet builder about the delay between sampling the first sample of a packet and sending the packet. This function allows you to inform RTCP packet builder about the delay between sampling the first sample of a packet and sending the packet. This delay is taken into account when calculating the relation between RTP timestamp and wallclock time, used for inter-media synchronization.
Definition at line 118 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetPreTransmissionDelay().
|
inline |
Sets the timestamp unit to be used to tsunit
. Sets the timestamp unit to be used to tsunit
. The timestamp unit is defined as a time interval divided by the timestamp interval corresponding to that interval: for 8000 Hz audio this would be 1/8000.
Definition at line 91 of file rtcppacketbuilder.h.
References ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT, and ERR_RTP_RTCPPACKETBUILDER_NOTINIT.
Referenced by qrtplib::RTPSession::SetTimestampUnit().
|
inline |
Sets the RTCP interval for the SDES tool item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES tool item will be added after the sources in the source table have been processed count
times.
Definition at line 194 of file rtcppacketbuilder.h.
Referenced by qrtplib::RTPSession::SetToolInterval().
|
private |
Definition at line 355 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and FillInSDES().
|
private |
Definition at line 355 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and FillInSDES().
|
private |
Definition at line 355 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and FillInSDES().
|
private |
Definition at line 355 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and FillInSDES().
|
private |
Definition at line 355 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and FillInSDES().
|
private |
Definition at line 355 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and FillInSDES().
|
private |
Definition at line 281 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), FillInReportBlocks(), and Init().
|
private |
Definition at line 278 of file rtcppacketbuilder.h.
Referenced by BuildBYEPacket(), BuildNextPacket(), Destroy(), Init(), and RTCPPacketBuilder().
|
private |
Definition at line 353 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 353 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 353 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 354 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 354 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 354 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 279 of file rtcppacketbuilder.h.
Referenced by BuildBYEPacket(), BuildNextPacket(), and Init().
|
private |
Definition at line 352 of file rtcppacketbuilder.h.
Referenced by BuildBYEPacket(), BuildNextPacket(), ClearAllSDESFlags(), Destroy(), FillInSDES(), and Init().
|
private |
Definition at line 282 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and FillInReportBlocks().
|
private |
Definition at line 356 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 276 of file rtcppacketbuilder.h.
Referenced by BuildBYEPacket(), and BuildNextPacket().
|
private |
Definition at line 358 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().
|
private |
Definition at line 275 of file rtcppacketbuilder.h.
Referenced by BuildBYEPacket(), BuildNextPacket(), ClearAllSourceFlags(), and FillInReportBlocks().
|
private |
Definition at line 280 of file rtcppacketbuilder.h.
Referenced by BuildBYEPacket(), BuildNextPacket(), and Init().
|
private |
Definition at line 282 of file rtcppacketbuilder.h.
Referenced by BuildNextPacket(), and Init().