- allow usage of jrtplib as network analyzer (accept alien SSRC packets as own ones when calculating the RTT delay)
This commit is contained in:
parent
bb48e1a777
commit
4f1486b257
|
|
@ -221,8 +221,9 @@ int RTPSession::InternalCreate(const RTPSessionParams &sessparams)
|
|||
return status;
|
||||
}
|
||||
|
||||
sources.AcceptAllSSRC(sessparams.GetAcceptAllSSRC());
|
||||
|
||||
// Set the initial receive mode
|
||||
|
||||
if ((status = rtptrans->SetReceiveMode(sessparams.GetReceiveMode())) < 0)
|
||||
{
|
||||
packetbuilder.Destroy();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ RTPSessionParams::RTPSessionParams() : mininterval(0,0)
|
|||
#else
|
||||
usepollthread = false;
|
||||
#endif // RTP_SUPPORT_THREAD
|
||||
maxpacksize = RTP_DEFAULTPACKETSIZE;
|
||||
acceptallssrc = false;
|
||||
maxpacksize = RTP_DEFAULTPACKETSIZE;
|
||||
receivemode = RTPTransmitter::AcceptAll;
|
||||
acceptown = false;
|
||||
owntsunit = -1; // The user will have to set it to the correct value himself
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ public:
|
|||
/** Returns the maximum allowed packet size (default is 1400 bytes). */
|
||||
size_t GetMaximumPacketSize() const { return maxpacksize; }
|
||||
|
||||
// Accept packets with any SSRC when using as delay calculator - for network analyzer project
|
||||
void SetAcceptAllSSRC(bool accept) { acceptallssrc = accept; }
|
||||
bool GetAcceptAllSSRC() const { return acceptallssrc; }
|
||||
|
||||
/** If the argument is \c true, the session should accept its own packets and store
|
||||
* them accordingly in the source table.
|
||||
*/
|
||||
|
|
@ -212,6 +216,7 @@ public:
|
|||
/** Returns the currently set CNAME, is blank when this will be generated automatically (the default). */
|
||||
std::string GetCNAME() const { return cname; }
|
||||
private:
|
||||
bool acceptallssrc;
|
||||
bool acceptown;
|
||||
bool usepollthread;
|
||||
size_t maxpacksize;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ RTPSources::RTPSources(ProbationType probtype,RTPMemoryManager *mgr) : RTPMemory
|
|||
sendercount = 0;
|
||||
activecount = 0;
|
||||
owndata = 0;
|
||||
acceptallssrc = false;
|
||||
|
||||
#ifdef RTP_SUPPORT_PROBATION
|
||||
probationtype = probtype;
|
||||
#endif // RTP_SUPPORT_PROBATION
|
||||
|
|
@ -109,7 +111,7 @@ int RTPSources::CreateOwnSSRC(uint32_t ssrc)
|
|||
owndata = 0; // just to make sure
|
||||
return status;
|
||||
}
|
||||
owndata->SetOwnSSRC();
|
||||
owndata->SetOwnSSRC();
|
||||
owndata->SetRTPDataAddress(0);
|
||||
owndata->SetRTCPDataAddress(0);
|
||||
|
||||
|
|
@ -393,7 +395,7 @@ int RTPSources::ProcessRTCPCompoundPacket(RTCPCompoundPacket *rtcpcomppack,const
|
|||
int num = p->GetReceptionReportCount();
|
||||
for (i = 0 ; i < num ; i++)
|
||||
{
|
||||
if (p->GetSSRC(i) == ownssrc) // data is meant for us
|
||||
if (p->GetSSRC(i) == ownssrc || acceptallssrc) // data is meant for us
|
||||
{
|
||||
gotinfo = true;
|
||||
status = ProcessRTCPReportBlock(senderssrc,p->GetFractionLost(i),p->GetLostPacketCount(i),
|
||||
|
|
@ -425,7 +427,7 @@ int RTPSources::ProcessRTCPCompoundPacket(RTCPCompoundPacket *rtcpcomppack,const
|
|||
int num = p->GetReceptionReportCount();
|
||||
for (i = 0 ; i < num ; i++)
|
||||
{
|
||||
if (p->GetSSRC(i) == ownssrc)
|
||||
if (p->GetSSRC(i) == ownssrc || acceptallssrc)
|
||||
{
|
||||
gotinfo = true;
|
||||
status = ProcessRTCPReportBlock(senderssrc,p->GetFractionLost(i),p->GetLostPacketCount(i),
|
||||
|
|
|
|||
|
|
@ -99,6 +99,9 @@ public:
|
|||
/** Deletes the entry for our own SSRC identifier. */
|
||||
int DeleteOwnSSRC();
|
||||
|
||||
/** This is needed to allow accept RR when running as delay calculator in network analyzer project **/
|
||||
void AcceptAllSSRC(bool accept) { acceptallssrc = accept; }
|
||||
|
||||
/** This function should be called if our own session has sent an RTP packet.
|
||||
* This function should be called if our own session has sent an RTP packet.
|
||||
* For our own SSRC entry, the sender flag is updated based upon outgoing packets instead of incoming packets.
|
||||
|
|
@ -352,6 +355,7 @@ private:
|
|||
|
||||
RTPKeyHashTable<const uint32_t,RTPInternalSourceData*,RTPSources_GetHashIndex,RTPSOURCES_HASHSIZE> sourcelist;
|
||||
|
||||
bool acceptallssrc;
|
||||
int sendercount;
|
||||
int totalcount;
|
||||
int activecount;
|
||||
|
|
|
|||
Loading…
Reference in New Issue