66 std::list<Buffer>::const_iterator it;
70 delete[] (*it).packetdata;
75 delete[] (*it).packetdata;
135 if (neededsize > sizeleft)
144 *ssrc = qToBigEndian(senderssrc);
167 if (neededsize > sizeleft)
176 *ssrc = qToBigEndian(senderssrc);
200 rr->
ssrc = qToBigEndian(ssrc);
201 rr->fractionlost = fractionlost;
202 rr->packetslost[2] = (
uint8_t) (packlost2 & 0xFF);
203 rr->packetslost[1] = (
uint8_t) ((packlost2 >> 8) & 0xFF);
204 rr->packetslost[0] = (
uint8_t) ((packlost2 >> 16) & 0xFF);
205 rr->exthighseqnr = qToBigEndian(exthighestseq);
206 rr->jitter = qToBigEndian(jitter);
207 rr->lsr = qToBigEndian(lsr);
208 rr->dlsr = qToBigEndian(dlsr);
283 sdeshdr->
length = itemlength;
285 memcpy((buf +
sizeof(
RTCPSDESHeader)), itemdata, (std::size_t) itemlength);
291 #ifdef RTP_SUPPORT_SDESPRIV 299 std::size_t itemlength = ((std::size_t) prefixlength) + 1 + ((std::size_t) valuelength);
300 if (itemlength > 255)
318 sdeshdr->
length = itemlength;
321 if (prefixlength != 0)
322 memcpy((buf +
sizeof(
RTCPSDESHeader) + 1), prefixdata, (std::size_t) prefixlength);
323 if (valuelength != 0)
324 memcpy((buf +
sizeof(
RTCPSDESHeader) + 1 + (std::size_t) prefixlength), valuedata, (std::size_t) valuelength);
329 #endif // RTP_SUPPORT_SDESPRIV 340 std::size_t zerobytes = 0;
342 if (reasonlength > 0)
345 packsize += (std::size_t) reasonlength;
347 std::size_t r = (packsize & 0x03);
351 packsize += zerobytes;
361 std::size_t numwords;
369 hdr->
count = numssrcs;
371 numwords = packsize /
sizeof(
uint32_t);
378 for (srcindex = 0; srcindex < numssrcs; srcindex++)
379 sources[srcindex] = qToBigEndian(ssrcs[srcindex]);
381 if (reasonlength != 0)
385 buf[offset] = reasonlength;
386 memcpy((buf + offset + 1), reasondata, (std::size_t) reasonlength);
387 for (std::size_t
i = 0;
i < zerobytes;
i++)
388 buf[packsize - 1 -
i] = 0;
403 if ((appdatalen % 4) != 0)
406 std::size_t appdatawords = appdatalen / 4;
408 if ((appdatawords + 2) > 65535)
425 hdr->
count = subtype;
431 *source = qToBigEndian(ssrc);
472 bool firstpacket =
true;
501 memcpy(curbuf + offset, (*it).packetdata, (*it).packetlength);
502 offset += (*it).packetlength;
507 std::size_t numwords = offset /
sizeof(
uint32_t);
530 std::list<SDESSource *>::const_iterator sourceit =
sdes.
sdessources.begin();
546 *ssrc = qToBigEndian((*sourceit)->ssrc);
549 std::list<Buffer>::const_iterator itemit, itemend;
551 itemit = (*sourceit)->items.begin();
552 itemend = (*sourceit)->items.end();
553 while (itemit != itemend)
555 memcpy(curbuf + offset, (*itemit).packetdata, (*itemit).packetlength);
556 offset += (*itemit).packetlength;
563 std::size_t r = offset & 0x03;
566 std::size_t num = 4 - r;
569 for (i = 0; i < num; i++)
570 curbuf[offset + i] = 0;
578 std::size_t numwords = offset / 4;
580 hdr->
count = sourcecount;
595 std::list<Buffer>::const_iterator it;
599 memcpy(curbuf, (*it).packetdata, (*it).packetlength);
604 curbuf += (*it).packetlength;
611 std::list<Buffer>::const_iterator it;
615 memcpy(curbuf, (*it).packetdata, (*it).packetlength);
620 curbuf += (*it).packetlength;
#define RTCP_SDES_ID_EMAIL
std::size_t NeededBytesWithExtraReportBlock()
#define RTCP_SDES_ID_LOCATION
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT
std::size_t compoundpacketlength
std::list< SDESSource * > sdessources
int AddAPPPacket(uint8_t subtype, uint32_t ssrc, const uint8_t name[4], const void *appdata, std::size_t appdatalen)
int InitBuild(std::size_t maxpacketsize)
int AddSDESPrivateItem(const void *prefixdata, uint8_t prefixlength, const void *valuedata, uint8_t valuelength)
#define ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYBUILT
#define RTCP_SDES_ID_NOTE
std::size_t NeededBytesWithExtraItem(uint8_t itemdatalength)
#define ERR_RTP_RTCPCOMPPACKBUILDER_REPORTNOTSTARTED
~RTCPCompoundPacketBuilder()
int AddSDESSource(uint32_t ssrc)
#define ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYBUILDING
std::list< RTCPPacket * > rtcppacklist
#define RTP_MINPACKETSIZE
std::size_t NeededBytes()
#define ERR_RTP_RTCPCOMPPACKBUILDER_BUFFERSIZETOOSMALL
std::size_t NeededBytesWithExtraSource()
#define ERR_RTP_RTCPCOMPPACKBUILDER_ILLEGALSUBTYPE
#define ERR_RTP_RTCPCOMPPACKBUILDER_INVALIDITEMTYPE
RTCPCompoundPacketBuilder()
#define ERR_RTP_RTCPCOMPPACKBUILDER_ILLEGALAPPDATALENGTH
int AddReportBlock(uint32_t ssrc, uint8_t fractionlost, int32_t packetslost, uint32_t exthighestseq, uint32_t jitter, uint32_t lsr, uint32_t dlsr)
#define RTCP_SDES_ID_TOOL
std::list< Buffer > apppackets
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOREPORTPRESENT
std::list< Buffer > reportblocks
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOTBUILDING
#define RTCP_SDES_ID_CNAME
#define ERR_RTP_RTCPCOMPPACKBUILDER_TOOMANYSSRCS
std::size_t maximumpacketsize
int AddItem(uint8_t *buf, std::size_t len)
int AddBYEPacket(uint32_t *ssrcs, uint8_t numssrcs, const void *reasondata, uint8_t reasonlength)
int StartReceiverReport(uint32_t senderssrc)
#define RTCP_SDES_ID_NAME
std::size_t NeededBytes()
std::list< Buffer > byepackets
#define RTCP_SDES_ID_PHONE
#define ERR_RTP_RTCPCOMPPACKBUILDER_ALREADYGOTREPORT
#define RTP_RTCPTYPE_SDES
#define ERR_RTP_RTCPCOMPPACKBUILDER_TOTALITEMLENGTHTOOBIG
#define RTCP_SDES_ID_PRIVATE
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOCURRENTSOURCE
#define ERR_RTP_RTCPCOMPPACKBUILDER_APPDATALENTOOBIG
int StartSenderReport(uint32_t senderssrc, const RTPNTPTime &ntptimestamp, uint32_t rtptimestamp, uint32_t packetcount, uint32_t octetcount)
int AddSSRC(uint32_t ssrc)
#define ERR_RTP_RTCPCOMPPACKBUILDER_MAXPACKETSIZETOOSMALL
int AddSDESNormalItem(RTCPSDESPacket::ItemType t, const void *itemdata, uint8_t itemlength)