diff --git a/qrtplib/rtpconfig.h b/qrtplib/rtpconfig.h index a37c58702..f0195e60a 100644 --- a/qrtplib/rtpconfig.h +++ b/qrtplib/rtpconfig.h @@ -57,7 +57,7 @@ #define RTP_SUPPORT_SDESPRIV -#define RTP_SUPPORT_PROBATION +// No #define RTP_SUPPORT_PROBATION #define RTP_SUPPORT_GETLOGINR diff --git a/qrtplib/rtpinternalsourcedata.cpp b/qrtplib/rtpinternalsourcedata.cpp index 7854d09f1..075b6bcb1 100644 --- a/qrtplib/rtpinternalsourcedata.cpp +++ b/qrtplib/rtpinternalsourcedata.cpp @@ -39,13 +39,9 @@ namespace qrtplib { -RTPInternalSourceData::RTPInternalSourceData(uint32_t ssrc, RTPSources::ProbationType probtype) : +RTPInternalSourceData::RTPInternalSourceData(uint32_t ssrc) : RTPSourceData(ssrc) { - JRTPLIB_UNUSED(probtype); // possibly unused -#ifdef RTP_SUPPORT_PROBATION - probationtype = probtype; -#endif // RTP_SUPPORT_PROBATION } RTPInternalSourceData::~RTPInternalSourceData() @@ -65,45 +61,13 @@ int RTPInternalSourceData::ProcessRTPPacket(RTPPacket *rtppack, const RTPTime &r else tsunit = timestampunit; -#ifdef RTP_SUPPORT_PROBATION - if (validated) // If the source is our own process, we can already be validated. No - applyprobation = false; // probation should be applied in that case. - else - { - if (probationtype == RTPSources::NoProbation) - applyprobation = false; - else - applyprobation = true; - } -#else applyprobation = false; -#endif // RTP_SUPPORT_PROBATION stats.ProcessPacket(rtppack, receivetime, tsunit, ownssrc, &accept, applyprobation, &onprobation); -#ifdef RTP_SUPPORT_PROBATION - switch (probationtype) - { - case RTPSources::ProbationStore: - if (!(onprobation || accept)) - return 0; - if (accept) - validated = true; - break; - case RTPSources::ProbationDiscard: - case RTPSources::NoProbation: - if (!accept) - return 0; - validated = true; - break; - default: - return ERR_RTP_INTERNALSOURCEDATA_INVALIDPROBATIONTYPE; - } -#else if (!accept) - return 0; + return 0; validated = true; -#endif // RTP_SUPPORT_PROBATION; if (validated && !ownssrc) // for own ssrc these variables depend on the outgoing packets, not on the incoming issender = true; diff --git a/qrtplib/rtpinternalsourcedata.h b/qrtplib/rtpinternalsourcedata.h index f4ae5af49..9702d4fc7 100644 --- a/qrtplib/rtpinternalsourcedata.h +++ b/qrtplib/rtpinternalsourcedata.h @@ -50,7 +50,7 @@ namespace qrtplib class RTPInternalSourceData: public RTPSourceData { public: - RTPInternalSourceData(uint32_t ssrc, RTPSources::ProbationType probtype); + RTPInternalSourceData(uint32_t ssrc); ~RTPInternalSourceData(); int ProcessRTPPacket(RTPPacket *rtppack, const RTPTime &receivetime, bool *stored, RTPSources *sources); @@ -107,10 +107,6 @@ public: SDESinf.SetNote(0, 0); } -#ifdef RTP_SUPPORT_PROBATION -private: - RTPSources::ProbationType probationtype; -#endif // RTP_SUPPORT_PROBATION }; inline int RTPInternalSourceData::SetRTPDataAddress(const RTPAddress *a) diff --git a/qrtplib/rtpsession.cpp b/qrtplib/rtpsession.cpp index 485c1db2c..7f4522331 100644 --- a/qrtplib/rtpsession.cpp +++ b/qrtplib/rtpsession.cpp @@ -193,13 +193,6 @@ int RTPSession::InternalCreate(const RTPSessionParams &sessparams) if (sessparams.GetUsePredefinedSSRC()) packetbuilder.AdjustSSRC(sessparams.GetPredefinedSSRC()); -#ifdef RTP_SUPPORT_PROBATION - - // Set probation type - sources.SetProbationType(sessparams.GetProbationType()); - -#endif // RTP_SUPPORT_PROBATION - // Add our own ssrc to the source table if ((status = sources.CreateOwnSSRC(packetbuilder.GetSSRC())) < 0) diff --git a/qrtplib/rtpsessionparams.cpp b/qrtplib/rtpsessionparams.cpp index 407e20ed6..78f2bfea5 100644 --- a/qrtplib/rtpsessionparams.cpp +++ b/qrtplib/rtpsessionparams.cpp @@ -48,9 +48,6 @@ RTPSessionParams::RTPSessionParams() : acceptown = false; owntsunit = -1; // The user will have to set it to the correct value himself resolvehostname = false; -#ifdef RTP_SUPPORT_PROBATION - probationtype = RTPSources::ProbationStore; -#endif // RTP_SUPPORT_PROBATION mininterval = RTPTime(RTCP_DEFAULTMININTERVAL); sessionbandwidth = RTP_DEFAULTSESSIONBANDWIDTH; diff --git a/qrtplib/rtpsessionparams.h b/qrtplib/rtpsessionparams.h index 198c225b0..e4208dc96 100644 --- a/qrtplib/rtpsessionparams.h +++ b/qrtplib/rtpsessionparams.h @@ -143,19 +143,6 @@ public: { return resolvehostname; } -#ifdef RTP_SUPPORT_PROBATION - /** If probation support is enabled, this function sets the probation type to be used. */ - void SetProbationType(RTPSources::ProbationType probtype) - { - probationtype = probtype; - } - - /** Returns the probation type which will be used (default is RTPSources::ProbationStore). */ - RTPSources::ProbationType GetProbationType() const - { - return probationtype; - } -#endif // RTP_SUPPORT_PROBATION /** Sets the session bandwidth in bytes per second. */ void SetSessionBandwidth(double sessbw) @@ -357,9 +344,6 @@ private: double owntsunit; RTPTransmitter::ReceiveMode receivemode; bool resolvehostname; -#ifdef RTP_SUPPORT_PROBATION - RTPSources::ProbationType probationtype; -#endif // RTP_SUPPORT_PROBATION double sessionbandwidth; double controlfrac; diff --git a/qrtplib/rtpsourcedata.cpp b/qrtplib/rtpsourcedata.cpp index 46a798e62..185b7d8b1 100644 --- a/qrtplib/rtpsourcedata.cpp +++ b/qrtplib/rtpsourcedata.cpp @@ -75,61 +75,7 @@ void RTPSourceStats::ProcessPacket(RTPPacket *pack, const RTPTime &receivetime, if (!sentdata) // no valid packets received yet { -#ifdef RTP_SUPPORT_PROBATION - if (applyprobation) - { - bool acceptpack = false; - - if (probation) - { - uint16_t pseq; - uint32_t pseq2; - - pseq = prevseqnr; - pseq++; - pseq2 = (uint32_t) pseq; - if (pseq2 == pack->GetExtendedSequenceNumber()) // ok, its the next expected packet - { - prevseqnr = (uint16_t) pack->GetExtendedSequenceNumber(); - probation--; - if (probation == 0) // probation over - acceptpack = true; - else - *onprobation = true; - } - else // not next packet - { - probation = RTP_PROBATIONCOUNT; - prevseqnr = (uint16_t) pack->GetExtendedSequenceNumber(); - *onprobation = true; - } - } - else // first packet received with this SSRC ID, start probation - { - probation = RTP_PROBATIONCOUNT; - prevseqnr = (uint16_t) pack->GetExtendedSequenceNumber(); - *onprobation = true; - } - - if (acceptpack) - { - ACCEPTPACKETCODE - } - else - { - *accept = false; - lastmsgtime = receivetime; - } - } - else // No probation - { - ACCEPTPACKETCODE - } -#else // No compiled-in probation support - ACCEPTPACKETCODE - -#endif // RTP_SUPPORT_PROBATION } else // already got packets { diff --git a/qrtplib/rtpsourcedata.h b/qrtplib/rtpsourcedata.h index 0c4075c8c..a5861f921 100644 --- a/qrtplib/rtpsourcedata.h +++ b/qrtplib/rtpsourcedata.h @@ -254,10 +254,6 @@ private: RTPTime lastnotetime; uint32_t numnewpackets; uint32_t savedextseqnr; -#ifdef RTP_SUPPORT_PROBATION - uint16_t prevseqnr; - int probation; -#endif // RTP_SUPPORT_PROBATION }; inline RTPSourceStats::RTPSourceStats() : @@ -274,10 +270,6 @@ inline RTPSourceStats::RTPSourceStats() : prevtimestamp = 0; djitter = 0; savedextseqnr = 0; -#ifdef RTP_SUPPORT_PROBATION - probation = 0; - prevseqnr = 0; -#endif // RTP_SUPPORT_PROBATION } /** Describes an entry in the RTPSources source table. */ diff --git a/qrtplib/rtpsources.cpp b/qrtplib/rtpsources.cpp index f5ea3c504..d4ebea9d8 100644 --- a/qrtplib/rtpsources.cpp +++ b/qrtplib/rtpsources.cpp @@ -56,9 +56,6 @@ RTPSources::RTPSources(ProbationType probtype) sendercount = 0; activecount = 0; owndata = 0; -#ifdef RTP_SUPPORT_PROBATION - probationtype = probtype; -#endif // RTP_SUPPORT_PROBATION } RTPSources::~RTPSources() @@ -812,11 +809,7 @@ int RTPSources::ObtainSourceDataInstance(uint32_t ssrc, RTPInternalSourceData ** if (sourcelist.GotoElement(ssrc) < 0) // No entry for this source { -#ifdef RTP_SUPPORT_PROBATION - srcdat2 = new RTPInternalSourceData(ssrc, probationtype); -#else - srcdat2 = new RTPInternalSourceData(ssrc,RTPSources::NoProbation); -#endif // RTP_SUPPORT_PROBATION + srcdat2 = new RTPInternalSourceData(ssrc); if (srcdat2 == 0) return ERR_RTP_OUTOFMEM; if ((status = sourcelist.AddElement(ssrc, srcdat2)) < 0) diff --git a/qrtplib/rtpsources.h b/qrtplib/rtpsources.h index 61d477506..62c789812 100644 --- a/qrtplib/rtpsources.h +++ b/qrtplib/rtpsources.h @@ -90,13 +90,6 @@ public: /** Clears the source table. */ void Clear(); -#ifdef RTP_SUPPORT_PROBATION - /** Changes the current probation type. */ - void SetProbationType(ProbationType probtype) - { - probationtype = probtype; - } -#endif // RTP_SUPPORT_PROBATION /** Creates an entry for our own SSRC identifier. */ int CreateOwnSSRC(uint32_t ssrc); @@ -370,10 +363,6 @@ private: int totalcount; int activecount; -#ifdef RTP_SUPPORT_PROBATION - ProbationType probationtype; -#endif // RTP_SUPPORT_PROBATION - RTPInternalSourceData *owndata; friend class RTPInternalSourceData;