37 #ifndef RTCPPACKETBUILDER_H
39 #define RTCPPACKETBUILDER_H
41 #include "rtpconfig.h"
52 class RTPPacketBuilder;
54 class RTCPCompoundPacket;
55 class RTCPCompoundPacketBuilder;
80 int Init(
size_t maxpacksize,
double timestampunit,
const void *cname,
size_t cnamelen);
90 int SetTimestampUnit(
double tsunit) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
if (tsunit < 0)
return ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT; timestampunit = tsunit;
return 0; }
93 int SetMaximumPacketSize(
size_t maxpacksize) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
if (maxpacksize < RTP_MINPACKETSIZE)
return ERR_RTP_RTCPPACKETBUILDER_ILLEGALMAXPACKSIZE; maxpacketsize = maxpacksize;
return 0; }
162 int SetLocalName(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetName((
const uint8_t *)s,len); }
165 int SetLocalEMail(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetEMail((
const uint8_t *)s,len); }
168 int SetLocalLocation(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetLocation((
const uint8_t *)s,len); }
171 int SetLocalPhone(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetPhone((
const uint8_t *)s,len); }
174 int SetLocalTool(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetTool((
const uint8_t *)s,len); }
177 int SetLocalNote(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetNote((
const uint8_t *)s,len); }
180 uint8_t *
GetLocalCNAME(
size_t *len)
const {
if (!init)
return 0;
return ownsdesinfo.GetCNAME(len); }
182 void ClearAllSourceFlags();
185 void ClearAllSDESFlags();
191 size_t maxpacketsize;
192 double timestampunit;
194 RTPTime prevbuildtime,transmissiondelay;
200 void ClearFlags() { pname =
false; pemail =
false; plocation =
false; pphone =
false; ptool =
false; pnote =
false; }
201 bool ProcessedName()
const {
return pname; }
202 bool ProcessedEMail()
const {
return pemail; }
203 bool ProcessedLocation()
const {
return plocation; }
204 bool ProcessedPhone()
const {
return pphone; }
205 bool ProcessedTool()
const {
return ptool; }
206 bool ProcessedNote()
const {
return pnote; }
207 void SetProcessedName(
bool v) { pname = v; }
208 void SetProcessedEMail(
bool v) { pemail = v; }
209 void SetProcessedLocation(
bool v) { plocation = v; }
210 void SetProcessedPhone(
bool v) { pphone = v; }
211 void SetProcessedTool(
bool v) { ptool = v; }
212 void SetProcessedNote(
bool v) { pnote = v; }
214 bool pname,pemail,plocation,pphone,ptool,pnote;
217 RTCPSDESInfoInternal ownsdesinfo;
218 int interval_name,interval_email,interval_location;
219 int interval_phone,interval_tool,interval_note;
220 bool doname,doemail,doloc,dophone,dotool,donote;
228 #endif // RTCPPACKETBUILDER_H
int SetLocalName(const void *s, size_t len)
Sets the SDES name item for the local participant to the value s with length len. ...
Definition: rtcppacketbuilder.h:162
The class RTCPSDESInfo is a container for RTCP SDES information.
Definition: rtcpsdesinfo.h:53
This class can be used to build RTP packets and is a bit more high-level than the RTPPacket class: it...
Definition: rtppacketbuilder.h:57
void SetToolInterval(int count)
Sets the RTCP interval for the SDES tool item.
Definition: rtcppacketbuilder.h:151
int SetLocalPhone(const void *s, size_t len)
Sets the SDES phone item for the local participant to the value s with length len.
Definition: rtcppacketbuilder.h:171
int SetLocalTool(const void *s, size_t len)
Sets the SDES tool item for the local participant to the value s with length len. ...
Definition: rtcppacketbuilder.h:174
Represents an RTCP compound packet.
Definition: rtcpcompoundpacket.h:53
int SetTimestampUnit(double tsunit)
Sets the timestamp unit to be used to tsunit.
Definition: rtcppacketbuilder.h:90
int SetPreTransmissionDelay(const RTPTime &delay)
This function allows you to inform RTCP packet builder about the delay between sampling the first sam...
Definition: rtcppacketbuilder.h:101
uint8_t * GetLocalCNAME(size_t *len) const
Returns the own CNAME item with length len.
Definition: rtcppacketbuilder.h:180
void SetNameInterval(int count)
Sets the RTCP interval for the SDES name item.
Definition: rtcppacketbuilder.h:119
void SetPhoneInterval(int count)
Sets the RTCP interval for the SDES phone item.
Definition: rtcppacketbuilder.h:143
int SetMaximumPacketSize(size_t maxpacksize)
Sets the maximum size allowed size of an RTCP compound packet to maxpacksize.
Definition: rtcppacketbuilder.h:93
int BuildBYEPacket(RTCPCompoundPacket **pack, const void *reason, size_t reasonlength, bool useSRifpossible=true)
Builds a BYE packet with reason for leaving specified by reason and length reasonlength.
Represents a table in which information about the participating sources is kept.
Definition: rtpsources.h:74
RTCPPacketBuilder(RTPSources &sources, RTPPacketBuilder &rtppackbuilder, RTPMemoryManager *mgr=0)
Creates an RTCPPacketBuilder instance.
void SetNoteInterval(int count)
Sets the RTCP interval for the SDES note item.
Definition: rtcppacketbuilder.h:159
void SetLocationInterval(int count)
Sets the RTCP interval for the SDES location item.
Definition: rtcppacketbuilder.h:135
int BuildNextPacket(RTCPCompoundPacket **pack)
Builds the next RTCP compound packet which should be sent and stores it in pack.
void Destroy()
Cleans up the builder.
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:80
A memory manager.
Definition: rtpmemorymanager.h:147
This class can be used to build RTCP compound packets, on a higher level than the RTCPCompoundPacketB...
Definition: rtcppacketbuilder.h:63
void SetEMailInterval(int count)
Sets the RTCP interval for the SDES e-mail item.
Definition: rtcppacketbuilder.h:127
int SetLocalLocation(const void *s, size_t len)
Sets the SDES location item for the local participant to the value s with length len.
Definition: rtcppacketbuilder.h:168
This class can be used to construct an RTCP compound packet.
Definition: rtcpcompoundpacketbuilder.h:59
int Init(size_t maxpacksize, double timestampunit, const void *cname, size_t cnamelen)
Initializes the builder.
int SetLocalNote(const void *s, size_t len)
Sets the SDES note item for the local participant to the value s with length len. ...
Definition: rtcppacketbuilder.h:177
int SetLocalEMail(const void *s, size_t len)
Sets the SDES e-mail item for the local participant to the value s with length len.
Definition: rtcppacketbuilder.h:165