diff --git a/src/libs/jrtplib/src/rtpsession.cpp b/src/libs/jrtplib/src/rtpsession.cpp index 155323d2..e40eb64b 100644 --- a/src/libs/jrtplib/src/rtpsession.cpp +++ b/src/libs/jrtplib/src/rtpsession.cpp @@ -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(); diff --git a/src/libs/jrtplib/src/rtpsessionparams.cpp b/src/libs/jrtplib/src/rtpsessionparams.cpp index db6584f6..732b0baf 100644 --- a/src/libs/jrtplib/src/rtpsessionparams.cpp +++ b/src/libs/jrtplib/src/rtpsessionparams.cpp @@ -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 diff --git a/src/libs/jrtplib/src/rtpsessionparams.h b/src/libs/jrtplib/src/rtpsessionparams.h index 6aa8a715..ce81b144 100644 --- a/src/libs/jrtplib/src/rtpsessionparams.h +++ b/src/libs/jrtplib/src/rtpsessionparams.h @@ -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; diff --git a/src/libs/jrtplib/src/rtpsources.cpp b/src/libs/jrtplib/src/rtpsources.cpp index 7559dc80..0d586eff 100644 --- a/src/libs/jrtplib/src/rtpsources.cpp +++ b/src/libs/jrtplib/src/rtpsources.cpp @@ -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), diff --git a/src/libs/jrtplib/src/rtpsources.h b/src/libs/jrtplib/src/rtpsources.h index d97b244b..5d0079f5 100644 --- a/src/libs/jrtplib/src/rtpsources.h +++ b/src/libs/jrtplib/src/rtpsources.h @@ -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 sourcelist; + bool acceptallssrc; int sendercount; int totalcount; int activecount;