37 #ifndef RTCPCOMPOUNDPACKETBUILDER_H 39 #define RTCPCOMPOUNDPACKETBUILDER_H 73 int InitBuild(std::size_t maxpacketsize);
79 int InitBuild(
void *externalbuffer, std::size_t buffersize);
93 int StartReceiverReport(
uint32_t senderssrc);
109 #ifdef RTP_SUPPORT_SDESPRIV 111 int AddSDESPrivateItem(
const void *prefixdata,
uint8_t prefixlength,
const void *valuedata,
uint8_t valuelength);
112 #endif // RTP_SUPPORT_SDESPRIV 125 int AddAPPPacket(
uint8_t subtype,
uint32_t ssrc,
const uint8_t name[4],
const void *appdata, std::size_t appdatalen);
138 packetdata(0), packetlength(0)
142 packetdata(data), packetlength(len)
155 headerdata = (
uint8_t *) headerdata32;
167 std::list<Buffer>::const_iterator it;
168 for (it = reportblocks.begin(); it != reportblocks.end(); it++)
170 if ((*it).packetdata)
171 delete[] (*it).packetdata;
173 reportblocks.clear();
180 std::size_t x, n, d, r;
181 n = reportblocks.size();
184 if (headerlength == 0)
204 std::size_t x, n, d, r;
205 n = reportblocks.size() + 1;
229 ssrc(s), totalitemsize(0)
234 std::list<Buffer>::const_iterator it;
235 for (it = items.begin(); it != items.end(); it++)
237 if ((*it).packetdata)
238 delete[] (*it).packetdata;
246 x = totalitemsize + 1;
257 x = totalitemsize +
sizeof(
RTCPSDESHeader) + (std::size_t) itemdatalength + 1;
268 totalitemsize += len;
283 sdesit = sdessources.end();
292 std::list<SDESSource *>::const_iterator it;
294 for (it = sdessources.begin(); it != sdessources.end(); it++)
302 sdessources.push_back(s);
303 sdesit = sdessources.end();
310 if (sdessources.empty())
312 (*sdesit)->AddItem(buf, len);
318 std::list<SDESSource *>::const_iterator it;
322 if (sdessources.empty())
325 for (it = sdessources.begin(); it != sdessources.end(); it++)
326 x += (*it)->NeededBytes();
327 n = sdessources.size();
338 std::list<SDESSource *>::const_iterator it;
342 if (sdessources.empty())
345 for (it = sdessources.begin(); it != sdesit; it++)
346 x += (*it)->NeededBytes();
347 x += (*sdesit)->NeededBytesWithExtraItem(itemdatalength);
348 n = sdessources.size();
359 std::list<SDESSource *>::const_iterator it;
363 if (sdessources.empty())
366 for (it = sdessources.begin(); it != sdessources.end(); it++)
367 x += (*it)->NeededBytes();
372 n = sdessources.size() + 1;
383 std::list<SDESSource *>::const_iterator
sdesit;
401 void ClearBuildBuffers();
406 #endif // RTCPCOMPOUNDPACKETBUILDER_H std::size_t NeededBytesWithExtraReportBlock()
std::size_t NeededBytes()
std::list< SDESSource * > sdessources
std::size_t NeededBytesWithExtraItem(uint8_t itemdatalength)
Buffer(uint8_t *data, std::size_t len)
std::size_t NeededBytes()
void AddItem(uint8_t *buf, std::size_t len)
std::size_t NeededBytesWithExtraSource()
std::list< Buffer > apppackets
std::list< Buffer > reportblocks
std::size_t NeededBytesWithExtraItem(uint8_t itemdatalength)
std::size_t maximumpacketsize
int AddItem(uint8_t *buf, std::size_t len)
std::list< Buffer > items
std::size_t totalitemsize
std::size_t NeededBytes()
std::list< Buffer > byepackets
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOCURRENTSOURCE
std::list< SDESSource * >::const_iterator sdesit
int AddSSRC(uint32_t ssrc)