summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2011-12-12 08:06:58 +0000
committerBenny Prijono <bennylp@teluu.com>2011-12-12 08:06:58 +0000
commitd95570a3f0b389a9385d0215e8b415c6fabc4da7 (patch)
tree42bbd9333f5e9852bd319d58fe74f19a1abb7a50 /pjmedia
parent53f86de5d3872bcbe7e9d11b427a03f8dfb12695 (diff)
Fixed #1422: Option to configure or disable RTCP RTT normalization (thanks Lars Helgeson for the patch)
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3907 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/include/pjmedia/config.h13
-rw-r--r--pjmedia/src/pjmedia/rtcp.c16
2 files changed, 22 insertions, 7 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h
index c3ba7052..31ae2bfa 100644
--- a/pjmedia/include/pjmedia/config.h
+++ b/pjmedia/include/pjmedia/config.h
@@ -453,6 +453,19 @@
# define PJMEDIA_RTCP_STAT_HAS_RAW_JITTER 0
#endif
+/**
+ * Specify the factor with wich RTCP RTT statistics should be normalized
+ * if exceptionally high. For e.g. mobile networks with potentially large
+ * fluctuations, this might be unwanted.
+ *
+ * Use (0) to disable this feature.
+ *
+ * Default: 3.
+ */
+#ifndef PJMEDIA_RTCP_NORMALIZE_FACTOR
+# define PJMEDIA_RTCP_NORMALIZE_FACTOR 3
+#endif
+
/**
* Specify whether RTCP statistics includes IP Delay Variation statistics.
diff --git a/pjmedia/src/pjmedia/rtcp.c b/pjmedia/src/pjmedia/rtcp.c
index cb048302..7832771c 100644
--- a/pjmedia/src/pjmedia/rtcp.c
+++ b/pjmedia/src/pjmedia/rtcp.c
@@ -615,19 +615,21 @@ PJ_DEF(void) pjmedia_rtcp_rx_rtcp( pjmedia_rtcp_session *sess,
goto end_rtt_calc;
}
- /* "Normalize" rtt value that is exceptionally high.
- * For such values, "normalize" the rtt to be three times
- * the average value.
+#if defined(PJMEDIA_RTCP_NORMALIZE_FACTOR) && PJMEDIA_RTCP_NORMALIZE_FACTOR!=0
+ /* "Normalize" rtt value that is exceptionally high. For such
+ * values, "normalize" the rtt to be PJMEDIA_RTCP_NORMALIZE_FACTOR
+ * times the average value.
*/
- if (rtt > ((unsigned)sess->stat.rtt.mean*3) && sess->stat.rtt.n!=0)
+ if (rtt > ((unsigned)sess->stat.rtt.mean *
+ PJMEDIA_RTCP_NORMALIZE_FACTOR) && sess->stat.rtt.n!=0)
{
unsigned orig_rtt = rtt;
- rtt = sess->stat.rtt.mean*3;
- PJ_LOG(5,(sess->name,
+ rtt = sess->stat.rtt.mean * PJMEDIA_RTCP_NORMALIZE_FACTOR;
+ PJ_LOG(5,(sess->name,
"RTT value %d usec is normalized to %d usec",
orig_rtt, rtt));
}
-
+#endif
TRACE_((sess->name, "RTCP RTT is set to %d usec", rtt));
/* Update RTT stat */