37 #ifndef RTCPPACKETBUILDER_H
39 #define RTCPPACKETBUILDER_H
41 #include "rtpconfig.h"
77 int Init(
size_t maxpacksize,
double timestampunit,
const void *cname,
size_t cnamelen);
87 int SetTimestampUnit(
double tsunit) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
if (tsunit < 0)
return ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT; timestampunit = tsunit;
return 0; }
90 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; }
159 int SetLocalName(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetName((
const uint8_t *)s,len); }
162 int SetLocalEMail(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetEMail((
const uint8_t *)s,len); }
165 int SetLocalLocation(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetLocation((
const uint8_t *)s,len); }
168 int SetLocalPhone(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetPhone((
const uint8_t *)s,len); }
171 int SetLocalTool(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetTool((
const uint8_t *)s,len); }
174 int SetLocalNote(
const void *s,
size_t len) {
if (!init)
return ERR_RTP_RTCPPACKETBUILDER_NOTINIT;
return ownsdesinfo.SetNote((
const uint8_t *)s,len); }
177 uint8_t *
GetLocalCNAME(
size_t *len)
const {
if (!init)
return 0;
return ownsdesinfo.GetCNAME(len); }
179 void ClearAllSourceFlags();
182 void ClearAllSDESFlags();
188 size_t maxpacketsize;
189 double timestampunit;
191 RTPTime prevbuildtime,transmissiondelay;
197 void ClearFlags() { pname =
false; pemail =
false; plocation =
false; pphone =
false; ptool =
false; pnote =
false; }
198 bool ProcessedName()
const {
return pname; }
199 bool ProcessedEMail()
const {
return pemail; }
200 bool ProcessedLocation()
const {
return plocation; }
201 bool ProcessedPhone()
const {
return pphone; }
202 bool ProcessedTool()
const {
return ptool; }
203 bool ProcessedNote()
const {
return pnote; }
204 void SetProcessedName(
bool v) { pname = v; }
205 void SetProcessedEMail(
bool v) { pemail = v; }
206 void SetProcessedLocation(
bool v) { plocation = v; }
207 void SetProcessedPhone(
bool v) { pphone = v; }
208 void SetProcessedTool(
bool v) { ptool = v; }
209 void SetProcessedNote(
bool v) { pnote = v; }
211 bool pname,pemail,plocation,pphone,ptool,pnote;
214 RTCPSDESInfoInternal ownsdesinfo;
215 int interval_name,interval_email,interval_location;
216 int interval_phone,interval_tool,interval_note;
217 bool doname,doemail,doloc,dophone,dotool,donote;
223 #endif // RTCPPACKETBUILDER_H