git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@658 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-02-23 21:57:57 +00:00
parent 26d698de34
commit 4c9d54d474
4 changed files with 19 additions and 7 deletions

View File

@ -208,6 +208,14 @@ int RTPPacketBuilder::BuildPacket(const void *data,size_t len,
return PrivateBuildPacket(data,len,pt,mark,timestampinc,false);
}
int RTPPacketBuilder::BuildPacket(const void *data,size_t len,
u_int8_t pt,bool mark,u_int32_t timestampinc, u_int32_t mseq)
{
if (!init)
return ERR_RTP_PACKBUILD_NOTINIT;
return PrivateBuildPacket(data,len,pt,mark,timestampinc,false,0,0,0,mseq);
}
int RTPPacketBuilder::BuildPacketEx(const void *data,size_t len,
u_int16_t hdrextID,const void *hdrextdata,size_t numhdrextwords)
{
@ -234,9 +242,9 @@ int RTPPacketBuilder::BuildPacketEx(const void *data,size_t len,
int RTPPacketBuilder::PrivateBuildPacket(const void *data,size_t len,
u_int8_t pt,bool mark,u_int32_t timestampinc,bool gotextension,
u_int16_t hdrextID,const void *hdrextdata,size_t numhdrextwords)
u_int16_t hdrextID,const void *hdrextdata,size_t numhdrextwords, u_int32_t mseq)
{
RTPPacket p(pt,data,len,seqnr,timestamp,ssrc,mark,numcsrcs,csrcs,gotextension,hdrextID,
RTPPacket p(pt,data,len, mseq ? mseq : seqnr,timestamp,ssrc,mark,numcsrcs,csrcs,gotextension,hdrextID,
(u_int16_t)numhdrextwords,hdrextdata,buffer,maxpacksize);
int status = p.GetCreationError();
@ -260,7 +268,9 @@ int RTPPacketBuilder::PrivateBuildPacket(const void *data,size_t len,
numpayloadbytes += (u_int32_t)p.GetPayloadLength();
numpackets++;
timestamp += timestampinc;
seqnr++;
if (mseq) {
seqnr++;
}
return 0;

View File

@ -61,6 +61,8 @@ public:
int BuildPacket(const void *data,size_t len);
int BuildPacket(const void *data,size_t len,
u_int8_t pt,bool mark,u_int32_t timestampinc);
int BuildPacket(const void *data,size_t len,
u_int8_t pt,bool mark,u_int32_t timestampinc, u_int32_t mseq);
int BuildPacketEx(const void *data,size_t len,
u_int16_t hdrextID,const void *hdrextdata,size_t numhdrextwords);
int BuildPacketEx(const void *data,size_t len,
@ -87,7 +89,7 @@ public:
private:
int PrivateBuildPacket(const void *data,size_t len,
u_int8_t pt,bool mark,u_int32_t timestampinc,bool gotextension,
u_int16_t hdrextID = 0,const void *hdrextdata = 0,size_t numhdrextwords = 0);
u_int16_t hdrextID = 0,const void *hdrextdata = 0,size_t numhdrextwords = 0, u_int32_t mseq = 0);
RTPRandom rtprnd;
size_t maxpacksize;

View File

@ -508,7 +508,7 @@ int RTPSession::SendPacket(const void *data,size_t len)
}
int RTPSession::SendPacket(const void *data,size_t len,
u_int8_t pt,bool mark,u_int32_t timestampinc)
u_int8_t pt,bool mark,u_int32_t timestampinc, u_int32_t mseq)
{
int status;
@ -516,7 +516,7 @@ int RTPSession::SendPacket(const void *data,size_t len,
return ERR_RTP_SESSION_NOTCREATED;
BUILDER_LOCK
if ((status = packetbuilder.BuildPacket(data,len,pt,mark,timestampinc)) < 0)
if ((status = packetbuilder.BuildPacket(data,len,pt,mark,timestampinc, mseq)) < 0)
{
BUILDER_UNLOCK
return status;

View File

@ -85,7 +85,7 @@ public:
int SendPacket(const void *data,size_t len);
int SendPacket(const void *data,size_t len,
u_int8_t pt,bool mark,u_int32_t timestampinc);
u_int8_t pt,bool mark,u_int32_t timestampinc, u_int32_t mseq = 0);
int SendPacketEx(const void *data,size_t len,
u_int16_t hdrextID,const void *hdrextdata,size_t numhdrextwords);
int SendPacketEx(const void *data,size_t len,