Ticket #513: Support for RTCP XR (initial patch)

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1942 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/build.symbian/pjmedia.mmp b/build.symbian/pjmedia.mmp
index 934e4ba..2979d55 100644
--- a/build.symbian/pjmedia.mmp
+++ b/build.symbian/pjmedia.mmp
@@ -52,6 +52,7 @@
 SOURCE		resample_port.c
 SOURCE		resample_resample.c
 SOURCE		rtcp.c
+SOURCE		rtcp_xr.c
 SOURCE		rtp.c
 //SDP files are in pjsdp.mmp: sdp.c, sdp_cmp.c, sdp_neg.c
 SOURCE		session.c
diff --git a/pjmedia/build/Makefile b/pjmedia/build/Makefile
index e8a8d7a..b42b12a 100644
--- a/pjmedia/build/Makefile
+++ b/pjmedia/build/Makefile
@@ -51,7 +51,8 @@
 			g711.o jbuf.o master_port.o mem_capture.o mem_player.o \
 			null_port.o plc_common.o port.o splitcomb.o \
 			resample_resample.o resample_libsamplerate.o \
-			resample_port.o rtcp.o rtp.o sdp.o sdp_cmp.o sdp_neg.o \
+			resample_port.o rtcp.o rtcp_xr.o rtp.o \
+			sdp.o sdp_cmp.o sdp_neg.o \
 			session.o silencedet.o sound_port.o stereo_port.o \
 			stream.o tonegen.o transport_ice.o transport_srtp.o \
 			transport_udp.o \
diff --git a/pjmedia/build/pjmedia.dsp b/pjmedia/build/pjmedia.dsp
index d0df97e..3379223 100644
--- a/pjmedia/build/pjmedia.dsp
+++ b/pjmedia/build/pjmedia.dsp
@@ -205,6 +205,10 @@
 # End Source File

 # Begin Source File

 

+SOURCE=..\src\pjmedia\rtcp_xr.c

+# End Source File

+# Begin Source File

+

 SOURCE=..\src\pjmedia\rtp.c

 # End Source File

 # Begin Source File

@@ -373,6 +377,10 @@
 # End Source File

 # Begin Source File

 

+SOURCE=..\include\pjmedia\rtcp_xr.h

+# End Source File

+# Begin Source File

+

 SOURCE=..\include\pjmedia\rtp.h

 # End Source File

 # Begin Source File

diff --git a/pjmedia/build/pjmedia.vcproj b/pjmedia/build/pjmedia.vcproj
index 15905b9..d39bb02 100644
--- a/pjmedia/build/pjmedia.vcproj
+++ b/pjmedia/build/pjmedia.vcproj
@@ -742,6 +742,10 @@
 				</FileConfiguration>

 			</File>

 			<File

+				RelativePath="..\src\pjmedia\rtcp_xr.c"

+				>

+			</File>

+			<File

 				RelativePath="..\src\pjmedia\rtp.c"

 				>

 				<FileConfiguration

@@ -1181,6 +1185,10 @@
 				>

 			</File>

 			<File

+				RelativePath="..\include\pjmedia\rtcp_xr.h"

+				>

+			</File>

+			<File

 				RelativePath="..\include\pjmedia\rtp.h"

 				>

 			</File>

diff --git a/pjmedia/build/wince-evc4/pjmedia_wince.vcp b/pjmedia/build/wince-evc4/pjmedia_wince.vcp
index 684db9e..12681a4 100644
--- a/pjmedia/build/wince-evc4/pjmedia_wince.vcp
+++ b/pjmedia/build/wince-evc4/pjmedia_wince.vcp
@@ -687,6 +687,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -1341,6 +1342,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -1910,6 +1912,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -2430,6 +2433,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -2979,6 +2983,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -3593,6 +3598,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -3633,6 +3639,7 @@
 	"..\..\include\pjmedia\port.h"\

 	"..\..\include\pjmedia\resample.h"\

 	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

 	"..\..\include\pjmedia\rtp.h"\

 	"..\..\include\pjmedia\sdp.h"\

 	"..\..\include\pjmedia\silencedet.h"\

@@ -4293,6 +4300,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -4893,6 +4901,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -5408,6 +5417,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -5758,9 +5768,9 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_echo.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_preprocess.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_echo.h"\

+	"..\..\..\third_party\speex\include\speex\speex_preprocess.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\echo.h"\

@@ -5927,9 +5937,9 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_echo.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_preprocess.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_echo.h"\

+	"..\..\..\third_party\speex\include\speex\speex_preprocess.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\echo.h"\

@@ -5972,6 +5982,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -6001,9 +6012,9 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_echo.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_preprocess.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_echo.h"\

+	"..\..\..\third_party\speex\include\speex\speex_preprocess.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\echo.h"\

@@ -6217,9 +6228,9 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_echo.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_preprocess.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_echo.h"\

+	"..\..\..\third_party\speex\include\speex\speex_preprocess.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\echo.h"\

@@ -6531,6 +6542,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -7085,6 +7097,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -7443,7 +7456,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -7585,7 +7598,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -7625,6 +7638,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -7654,7 +7668,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -7832,7 +7846,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -8156,6 +8170,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -8702,6 +8717,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -9260,6 +9276,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -9823,6 +9840,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -10373,6 +10391,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -10928,6 +10947,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -11278,7 +11298,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -11423,7 +11443,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -11464,6 +11484,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -11493,7 +11514,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -11675,7 +11696,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\portaudio\include\portaudio.h"\

+	"..\..\..\third_party\portaudio\include\portaudio.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -11992,6 +12013,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -12544,6 +12566,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -13102,6 +13125,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -13406,7 +13430,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -13477,7 +13501,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -13540,7 +13564,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -13602,7 +13626,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -13673,7 +13697,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -13715,6 +13739,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -13744,7 +13769,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -13807,7 +13832,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -13869,7 +13894,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -13931,7 +13956,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -14002,7 +14027,7 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\resample\include\resamplesubs.h"\

+	"..\..\..\third_party\resample\include\resamplesubs.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -14072,8 +14097,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -14144,8 +14169,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -14208,8 +14233,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -14271,8 +14296,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -14343,8 +14368,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -14386,6 +14411,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -14415,8 +14441,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -14479,8 +14505,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -14542,8 +14568,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -14605,8 +14631,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

@@ -14677,8 +14703,8 @@
 	"..\..\..\pjlib\include\pj\types.h"\

 	"..\..\..\pjlib\include\pj\unicode.h"\

 	"..\..\..\pjlib\include\pjlib.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_resampler.h"\

-	"..\..\..\THIRD_PARTY\speex\include\speex\speex_types.h"\

+	"..\..\..\third_party\speex\include\speex\speex_resampler.h"\

+	"..\..\..\third_party\speex\include\speex\speex_types.h"\

 	"..\..\include\pjmedia\config.h"\

 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

@@ -14980,6 +15006,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -15013,6 +15040,7 @@
 	"..\..\include\pjmedia\config_auto.h"\

 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

 	"..\..\include\pjmedia\rtp.h"\

 	"..\..\include\pjmedia\types.h"\

 	

@@ -15204,6 +15232,733 @@
 # End Source File

 # Begin Source File

 

+SOURCE=..\..\src\pjmedia\rtcp_xr.c

+

+!IF  "$(CFG)" == "pjmedia_wince - Win32 (WCE emulator) Release"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE emulator) Debug"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE ARMV4I) Release"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE ARMV4I) Debug"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE ARMV4) Release"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE ARMV4) Debug"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE ARMV4T) Release"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE ARMV4T) Debug"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE x86) Release"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ELSEIF  "$(CFG)" == "pjmedia_wince - Win32 (WCE x86) Debug"

+

+DEP_CPP_RTCP_X=\

+	"..\..\..\pjlib\include\pj\addr_resolv.h"\

+	"..\..\..\pjlib\include\pj\array.h"\

+	"..\..\..\pjlib\include\pj\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\assert.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\

+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\

+	"..\..\..\pjlib\include\pj\compat\ctype.h"\

+	"..\..\..\pjlib\include\pj\compat\errno.h"\

+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\

+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\

+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\

+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\

+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\

+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\

+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\

+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\

+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\

+	"..\..\..\pjlib\include\pj\compat\size_t.h"\

+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\

+	"..\..\..\pjlib\include\pj\compat\string.h"\

+	"..\..\..\pjlib\include\pj\config.h"\

+	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

+	"..\..\..\pjlib\include\pj\ctype.h"\

+	"..\..\..\pjlib\include\pj\errno.h"\

+	"..\..\..\pjlib\include\pj\except.h"\

+	"..\..\..\pjlib\include\pj\fifobuf.h"\

+	"..\..\..\pjlib\include\pj\file_access.h"\

+	"..\..\..\pjlib\include\pj\file_io.h"\

+	"..\..\..\pjlib\include\pj\guid.h"\

+	"..\..\..\pjlib\include\pj\hash.h"\

+	"..\..\..\pjlib\include\pj\ioqueue.h"\

+	"..\..\..\pjlib\include\pj\ip_helper.h"\

+	"..\..\..\pjlib\include\pj\list.h"\

+	"..\..\..\pjlib\include\pj\list_i.h"\

+	"..\..\..\pjlib\include\pj\lock.h"\

+	"..\..\..\pjlib\include\pj\log.h"\

+	"..\..\..\pjlib\include\pj\os.h"\

+	"..\..\..\pjlib\include\pj\pool.h"\

+	"..\..\..\pjlib\include\pj\pool_alt.h"\

+	"..\..\..\pjlib\include\pj\pool_buf.h"\

+	"..\..\..\pjlib\include\pj\pool_i.h"\

+	"..\..\..\pjlib\include\pj\rand.h"\

+	"..\..\..\pjlib\include\pj\rbtree.h"\

+	"..\..\..\pjlib\include\pj\sock.h"\

+	"..\..\..\pjlib\include\pj\sock_select.h"\

+	"..\..\..\pjlib\include\pj\string.h"\

+	"..\..\..\pjlib\include\pj\string_i.h"\

+	"..\..\..\pjlib\include\pj\timer.h"\

+	"..\..\..\pjlib\include\pj\types.h"\

+	"..\..\..\pjlib\include\pj\unicode.h"\

+	"..\..\..\pjlib\include\pjlib.h"\

+	"..\..\include\pjmedia\config.h"\

+	"..\..\include\pjmedia\config_auto.h"\

+	"..\..\include\pjmedia\errno.h"\

+	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

+	"..\..\include\pjmedia\rtp.h"\

+	"..\..\include\pjmedia\types.h"\

+	

+

+!ENDIF 

+

+# End Source File

+# Begin Source File

+

 SOURCE=..\..\src\pjmedia\rtp.c

 

 !IF  "$(CFG)" == "pjmedia_wince - Win32 (WCE emulator) Release"

@@ -15496,6 +16251,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -16067,6 +16823,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -16634,6 +17391,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -17180,6 +17938,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -17771,6 +18530,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -17807,6 +18567,7 @@
 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

 	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

 	"..\..\include\pjmedia\rtp.h"\

 	"..\..\include\pjmedia\sdp.h"\

 	"..\..\include\pjmedia\session.h"\

@@ -18359,6 +19120,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -18940,6 +19702,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -19523,6 +20286,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -20161,6 +20925,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -20830,6 +21595,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -20867,6 +21633,7 @@
 	"..\..\include\pjmedia\jbuf.h"\

 	"..\..\include\pjmedia\port.h"\

 	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

 	"..\..\include\pjmedia\rtp.h"\

 	"..\..\include\pjmedia\sdp.h"\

 	"..\..\include\pjmedia\sound.h"\

@@ -21502,6 +22269,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -22322,6 +23090,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -22368,6 +23137,7 @@
 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

 	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

 	"..\..\include\pjmedia\rtp.h"\

 	"..\..\include\pjmedia\sdp.h"\

 	"..\..\include\pjmedia\sound.h"\

@@ -23275,6 +24045,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -24096,6 +24867,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -24132,6 +24904,7 @@
 	"..\..\include\pjmedia\errno.h"\

 	"..\..\include\pjmedia\port.h"\

 	"..\..\include\pjmedia\rtcp.h"\

+	"..\..\include\pjmedia\rtcp_xr.h"\

 	"..\..\include\pjmedia\rtp.h"\

 	"..\..\include\pjmedia\sdp.h"\

 	"..\..\include\pjmedia\sound.h"\

@@ -24716,6 +25489,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -25348,6 +26122,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -25980,6 +26755,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -26529,6 +27305,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -27137,6 +27914,7 @@
 	"..\..\..\pjlib\include\pj\compat\string.h"\

 	"..\..\..\pjlib\include\pj\config.h"\

 	"..\..\..\pjlib\include\pj\config_site.h"\

+	"..\..\..\pjlib\include\pj\config_site_sample.h"\

 	"..\..\..\pjlib\include\pj\ctype.h"\

 	"..\..\..\pjlib\include\pj\errno.h"\

 	"..\..\..\pjlib\include\pj\except.h"\

@@ -27554,6 +28332,10 @@
 # End Source File

 # Begin Source File

 

+SOURCE=..\..\include\pjmedia\rtcp_xr.h

+# End Source File

+# Begin Source File

+

 SOURCE=..\..\include\pjmedia\rtp.h

 # End Source File

 # Begin Source File

diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h
index 240432e..587055e 100644
--- a/pjmedia/include/pjmedia/config.h
+++ b/pjmedia/include/pjmedia/config.h
@@ -339,6 +339,30 @@
 #   define  PJMEDIA_RTCP_IGNORE_FIRST_PACKETS	25
 #endif
 
+/**
+ * Specify whether RTCP XR support should be built into PJMEDIA. Disabling
+ * this feature will reduce footprint slightly. Note that even when this 
+ * setting is enabled, RTCP XR processing will only be performed in stream 
+ * if it is enabled on run-time on per stream basis. See  
+ * PJMEDIA_STREAM_ENABLE_XR setting for more info.
+ *
+ * Default: 1 (yes).
+ */
+#ifndef PJMEDIA_HAS_RTCP_XR
+#   define PJMEDIA_HAS_RTCP_XR			0
+#endif
+
+
+/**
+ * The RTCP XR feature is activated and used by stream if \a enable_rtcp_xr
+ * field of \a pjmedia_stream_info structure is non-zero. This setting 
+ * controls the default value of this field.
+ *
+ * Default: 0 (disabled)
+ */
+#ifndef PJMEDIA_STREAM_ENABLE_XR
+#   define PJMEDIA_STREAM_ENABLE_XR		0
+#endif
 
 /**
  * Specify how long (in miliseconds) the stream should suspend the
diff --git a/pjmedia/include/pjmedia/jbuf.h b/pjmedia/include/pjmedia/jbuf.h
index 8a06a64..a527d57 100644
--- a/pjmedia/include/pjmedia/jbuf.h
+++ b/pjmedia/include/pjmedia/jbuf.h
@@ -76,6 +76,7 @@
     unsigned	min_prefetch;	    /**< Minimum allowed prefetch, in frms. */
     unsigned	max_prefetch;	    /**< Maximum allowed prefetch, in frms. */
     unsigned	size;		    /**< Current buffer size, in frames.    */
+    unsigned	max_size;	    /**< Maximum size ever.		    */
 };
 
 
@@ -184,6 +185,24 @@
  */
 PJ_DECL(pj_status_t) pjmedia_jbuf_reset(pjmedia_jbuf *jb);
 
+/**
+ * Put a frame to the jitter buffer. If the frame can be accepted (based
+ * on the sequence number), the jitter buffer will copy the frame and put
+ * it in the appropriate position in the buffer.
+ *
+ * Application MUST manage it's own synchronization when multiple threads
+ * are accessing the jitter buffer at the same time.
+ *
+ * @param jb		The jitter buffer.
+ * @param frame		Pointer to frame buffer to be stored in the jitter
+ *			buffer.
+ * @param size		The frame size.
+ * @param frame_seq	The frame sequence number.
+ */
+PJ_DECL(void) pjmedia_jbuf_put_frame( pjmedia_jbuf *jb, 
+				      const void *frame, 
+				      pj_size_t size, 
+				      int frame_seq);
 
 /**
  * Put a frame to the jitter buffer. If the frame can be accepted (based
@@ -198,13 +217,13 @@
  *			buffer.
  * @param size		The frame size.
  * @param frame_seq	The frame sequence number.
- *
- * @return		PJ_SUCCESS on success.
+ * @param discarded	Flag whether the frame is discarded by jitter buffer.
  */
-PJ_DECL(void) pjmedia_jbuf_put_frame( pjmedia_jbuf *jb, 
-				      const void *frame, 
-				      pj_size_t size, 
-				      int frame_seq);
+PJ_DECL(void) pjmedia_jbuf_put_frame2( pjmedia_jbuf *jb, 
+				       const void *frame, 
+				       pj_size_t size, 
+				       int frame_seq,
+				       pj_bool_t *discarded);
 
 /**
  * Get a frame from the jitter buffer. The jitter buffer will return the
diff --git a/pjmedia/include/pjmedia/rtcp.h b/pjmedia/include/pjmedia/rtcp.h
index 4c02e8b..2633224 100644
--- a/pjmedia/include/pjmedia/rtcp.h
+++ b/pjmedia/include/pjmedia/rtcp.h
@@ -25,6 +25,7 @@
  */
 
 #include <pjmedia/types.h>
+#include <pjmedia/rtcp_xr.h>
 #include <pjmedia/rtp.h>
 
 
@@ -246,7 +247,6 @@
   typedef pj_uint32_t PJMEDIA_AVG_JITTER_TYPE;
 #endif
 
-
 /**
  * RTCP session is used to monitor the RTP session of one endpoint. There
  * should only be one RTCP session for a bidirectional RTP streams.
@@ -254,7 +254,7 @@
 struct pjmedia_rtcp_session
 {
     char		   *name;	/**< Name identification.	    */
-    pjmedia_rtcp_sr_pkt	    rtcp_sr_pkt;/**< Cached RTCP packet.	    */
+    pjmedia_rtcp_sr_pkt	    rtcp_sr_pkt;/**< Cached RTCP SR packet.	    */
     pjmedia_rtcp_rr_pkt	    rtcp_rr_pkt;/**< Cached RTCP RR packet.	    */
     
     pjmedia_rtp_seq_session seq_ctrl;	/**< RTCP sequence number control.  */
@@ -281,6 +281,19 @@
      * from being rounded-down to nearest integer.
      */
     PJMEDIA_AVG_JITTER_TYPE avg_jitter;	/**< Average RX jitter.		    */
+
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+    /**
+     * Specify whether RTCP XR processing is enabled on this session.
+     */
+    pj_bool_t		    xr_enabled;
+
+    /**
+     * RTCP XR session, only valid if RTCP XR processing is enabled
+     * on this session.
+     */
+    pjmedia_rtcp_xr_session xr_session;
+#endif
 };
 
 /**
@@ -342,6 +355,23 @@
 
 
 /**
+ * Call this function everytime an RTP packet is received to let the RTCP
+ * session do its internal calculations.
+ *
+ * @param session   The session.
+ * @param seq	    The RTP packet sequence number, in host byte order.
+ * @param ts	    The RTP packet timestamp, in host byte order.
+ * @param payload   Size of the payload.
+ * @param discarded Flag to specify whether the packet is discarded.
+ */
+PJ_DECL(void) pjmedia_rtcp_rx_rtp2(pjmedia_rtcp_session *session, 
+				   unsigned seq, 
+				   unsigned ts,
+				   unsigned payload,
+				   pj_bool_t discarded);
+
+
+/**
  * Call this function everytime an RTP packet is sent to let the RTCP session
  * do its internal calculations.
  *
@@ -385,6 +415,19 @@
 
 
 /**
+ * Call this function if RTCP XR needs to be enabled/disabled in the 
+ * RTCP session.
+ *
+ * @param session   The RTCP session.
+ * @param enable    Enable/disable RTCP XR.
+ *
+ * @return	    PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_rtcp_enable_xr( pjmedia_rtcp_session *session, 
+					     pj_bool_t enable);
+
+
+/**
  * @}
  */
 
diff --git a/pjmedia/include/pjmedia/rtcp_xr.h b/pjmedia/include/pjmedia/rtcp_xr.h
new file mode 100644
index 0000000..d483366
--- /dev/null
+++ b/pjmedia/include/pjmedia/rtcp_xr.h
@@ -0,0 +1,480 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJMEDIA_RTCP_XR_H__
+#define __PJMEDIA_RTCP_XR_H__
+
+/**
+ * @file rtcp_xr.h
+ * @brief RTCP XR implementation.
+ */
+
+#include <pjmedia/types.h>
+
+
+PJ_BEGIN_DECL
+
+
+/**
+ * @defgroup PJMED_RTCP_XR RTCP Extended Report (XR) - RFC 3611
+ * @ingroup PJMEDIA_TRANSPORT
+ * @{
+ * PJMEDIA implements subsets of RTCP XR specification (RFC 3611) to monitor
+ * the quality of the real-time media (audio/video) transmission.
+ */
+
+/**
+ * Enumeration of report types of RTCP XR. Useful for user to enable varying
+ * combinations of RTCP XR report blocks.
+ */
+typedef enum {
+    PJMEDIA_RTCP_XR_LOSS_RLE	    = (1 << 0),
+    PJMEDIA_RTCP_XR_DUP_RLE	    = (1 << 1),
+    PJMEDIA_RTCP_XR_RCPT_TIMES	    = (1 << 2),
+    PJMEDIA_RTCP_XR_RR_TIME	    = (1 << 3),
+    PJMEDIA_RTCP_XR_DLRR	    = (1 << 4),
+    PJMEDIA_RTCP_XR_STATS	    = (1 << 5),
+    PJMEDIA_RTCP_XR_VOIP_METRICS    = (1 << 6)
+} pjmedia_rtcp_xr_type;
+
+/**
+ * Enumeration of info need to be updated manually to RTCP XR. Most info
+ * could be updated automatically each time RTP received.
+ */
+typedef enum {
+    PJMEDIA_RTCP_XR_INFO_SIGNAL_LVL = 1,
+    PJMEDIA_RTCP_XR_INFO_NOISE_LVL  = 2,
+    PJMEDIA_RTCP_XR_INFO_RERL	    = 3,
+    PJMEDIA_RTCP_XR_INFO_R_FACTOR   = 4,
+    PJMEDIA_RTCP_XR_INFO_MOS_LQ	    = 5,
+    PJMEDIA_RTCP_XR_INFO_MOS_CQ	    = 6,
+    PJMEDIA_RTCP_XR_INFO_CONF_PLC   = 7,
+    PJMEDIA_RTCP_XR_INFO_CONF_JBA   = 8,
+    PJMEDIA_RTCP_XR_INFO_CONF_JBR   = 9,
+    PJMEDIA_RTCP_XR_INFO_JB_NOM	    = 10,
+    PJMEDIA_RTCP_XR_INFO_JB_MAX	    = 11,
+    PJMEDIA_RTCP_XR_INFO_JB_ABS_MAX = 12
+} pjmedia_rtcp_xr_info;
+
+/**
+ * Enumeration of PLC types definitions for RTCP XR report.
+ */
+typedef enum {
+    PJMEDIA_RTCP_XR_PLC_UNK	    = 0,
+    PJMEDIA_RTCP_XR_PLC_DIS	    = 1,
+    PJMEDIA_RTCP_XR_PLC_ENH	    = 2,
+    PJMEDIA_RTCP_XR_PLC_STD	    = 3
+} pjmedia_rtcp_xr_plc_type;
+
+/**
+ * Enumeration of jitter buffer types definitions for RTCP XR report.
+ */
+typedef enum {
+    PJMEDIA_RTCP_XR_JB_UNKNOWN      = 0,
+    PJMEDIA_RTCP_XR_JB_FIXED        = 2,
+    PJMEDIA_RTCP_XR_JB_ADAPTIVE     = 3
+} pjmedia_rtcp_xr_jb_type;
+
+
+#pragma pack(1)
+
+/**
+ * This type declares RTCP XR Report Header.
+ */
+typedef struct pjmedia_rtcp_xr_rb_header
+{
+    pj_uint8_t		 bt;		/**< Block type.		*/
+    pj_uint8_t		 specific;	/**< Block specific data.	*/
+    pj_uint16_t		 length;	/**< Block length.		*/
+} pjmedia_rtcp_xr_rb_header;
+
+/**
+ * This type declares RTCP XR Receiver Reference Time Report Block.
+ */
+typedef struct pjmedia_rtcp_xr_rb_rr_time
+{
+    pjmedia_rtcp_xr_rb_header header;	/**< Block header.		*/
+    pj_uint32_t		 ntp_sec;	/**< NTP time, seconds part.	*/
+    pj_uint32_t		 ntp_frac;	/**< NTP time, fractions part.	*/
+} pjmedia_rtcp_xr_rb_rr_time;
+
+
+/**
+ * This type declares RTCP XR DLRR Report Sub-block
+ */
+typedef struct pjmedia_rtcp_xr_rb_dlrr_item
+{
+    pj_uint32_t		 ssrc;		/**< receiver SSRC		*/
+    pj_uint32_t		 lrr;		/**< last receiver report	*/
+    pj_uint32_t		 dlrr;		/**< delay since last receiver
+					     report			*/
+} pjmedia_rtcp_xr_rb_dlrr_item;
+
+/**
+ * This type declares RTCP XR DLRR Report Block
+ */
+typedef struct pjmedia_rtcp_xr_rb_dlrr
+{
+    pjmedia_rtcp_xr_rb_header header;	/**< Block header.		*/
+    pjmedia_rtcp_xr_rb_dlrr_item item;	/**< Block contents, 
+					     variable length list	*/
+} pjmedia_rtcp_xr_rb_dlrr;
+
+/**
+ * This type declares RTCP XR Statistics Summary Report Block
+ */
+typedef struct pjmedia_rtcp_xr_rb_stats
+{
+    pjmedia_rtcp_xr_rb_header header;	/**< Block header.		     */
+    pj_uint32_t		 ssrc;		/**< Receiver SSRC		     */
+    pj_uint16_t		 begin_seq;	/**< Begin RTP sequence reported     */
+    pj_uint16_t		 end_seq;	/**< End RTP sequence reported       */
+    pj_uint32_t		 lost;		/**< Number of packet lost in this 
+					     interval  */
+    pj_uint32_t		 dup;		/**< Number of duplicated packet in 
+					     this interval */
+    pj_uint32_t		 jitter_min;	/**< Minimum jitter in this interval */
+    pj_uint32_t		 jitter_max;	/**< Maximum jitter in this interval */
+    pj_uint32_t		 jitter_mean;	/**< Average jitter in this interval */
+    pj_uint32_t		 jitter_dev;	/**< Jitter deviation in this 
+					     interval */
+    pj_uint32_t		 toh_min:8;	/**< Minimum ToH in this interval    */
+    pj_uint32_t		 toh_max:8;	/**< Maximum ToH in this interval    */
+    pj_uint32_t		 toh_mean:8;	/**< Average ToH in this interval    */
+    pj_uint32_t		 toh_dev:8;	/**< ToH deviation in this interval  */
+} pjmedia_rtcp_xr_rb_stats;
+
+/**
+ * This type declares RTCP XR VoIP Metrics Report Block
+ */
+typedef struct pjmedia_rtcp_xr_rb_voip_mtc
+{
+    pjmedia_rtcp_xr_rb_header header;	/**< Block header.		*/
+    pj_uint32_t		 ssrc;		/**< Receiver SSRC		*/
+    pj_uint8_t		 loss_rate;	/**< Packet loss rate		*/
+    pj_uint8_t		 discard_rate;	/**< Packet discarded rate	*/
+    pj_uint8_t		 burst_den;	/**< Burst density		*/
+    pj_uint8_t		 gap_den;	/**< Gap density		*/
+    pj_uint16_t		 burst_dur;	/**< Burst duration		*/
+    pj_uint16_t		 gap_dur;	/**< Gap duration		*/
+    pj_uint16_t		 rnd_trip_delay;/**< Round trip delay		*/
+    pj_uint16_t		 end_sys_delay; /**< End system delay		*/
+    pj_uint8_t		 signal_lvl;	/**< Signal level		*/
+    pj_uint8_t		 noise_lvl;	/**< Noise level		*/
+    pj_uint8_t		 rerl;		/**< Residual Echo Return Loss	*/
+    pj_uint8_t		 gmin;		/**< The gap threshold		*/
+    pj_uint8_t		 r_factor;	/**< Voice quality metric carried
+					     over this RTP session	*/
+    pj_uint8_t		 ext_r_factor;  /**< Voice quality metric carried 
+					     outside of this RTP session*/
+    pj_uint8_t		 mos_lq;	/**< Mean Opinion Score for 
+					     Listening Quality          */
+    pj_uint8_t		 mos_cq;	/**< Mean Opinion Score for 
+					     Conversation Quality       */
+    pj_uint8_t		 rx_config;	/**< Receiver configuration	*/
+    pj_uint8_t		 reserved2;	/**< Not used			*/
+    pj_uint16_t		 jb_nom;	/**< Current delay by jitter
+					     buffer			*/
+    pj_uint16_t		 jb_max;	/**< Maximum delay by jitter
+					     buffer			*/
+    pj_uint16_t		 jb_abs_max;	/**< Maximum possible delay by
+					     jitter buffer		*/
+} pjmedia_rtcp_xr_rb_voip_mtc;
+
+/**
+ * This structure declares RTCP XR (Extended Report) packet.
+ */
+typedef struct pjmedia_rtcp_xr_pkt
+{
+    struct {
+#if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0
+	unsigned	 version:2;	/**< packet type            */
+	unsigned	 p:1;		/**< padding flag           */
+	unsigned	 count:5;	/**< varies by payload type */
+	unsigned	 pt:8;		/**< payload type           */
+#else
+	unsigned	 count:5;	/**< varies by payload type */
+	unsigned	 p:1;		/**< padding flag           */
+	unsigned	 version:2;	/**< packet type            */
+	unsigned	 pt:8;		/**< payload type           */
+#endif
+	unsigned	 length:16;	/**< packet length          */
+	pj_uint32_t	 ssrc;		/**< SSRC identification    */
+    } common;
+
+    pj_int8_t		 buf[PJMEDIA_MAX_MTU];/**< Content buffer   */
+} pjmedia_rtcp_xr_pkt;
+
+#pragma pack()
+
+
+/**
+ * This structure describes RTCP XR statitic.
+ */
+typedef struct pjmedia_rtcp_xr_stream_stat
+{
+    struct {
+	pj_uint32_t	    begin_seq;
+	pj_uint32_t	    end_seq;
+	unsigned	    count;	/**< Number of packets.		    */
+
+	/**
+	 * Flags represent whether the such report is valid/updated
+	 */
+	unsigned	    l:1;	/**< Lost flag			    */
+	unsigned	    d:1;	/**< Duplicated flag		    */
+	unsigned	    j:1;	/**< Jitter flag		    */
+	unsigned	    t:2;	/**< TTL or Hop Limit, 
+					     0=none, 1=TTL, 2=HL	    */
+
+	unsigned	    lost;	/**< Number of packets lost	    */
+	unsigned	    dup;	/**< Number of duplicated packets   */
+	
+	struct {
+	    unsigned	    min;	/**< Minimum jitter (in usec)	    */
+	    unsigned	    max;	/**< Maximum jitter (in usec)	    */
+	    unsigned	    dev;	/**< Jitter deviation (in usec)	    */
+	    unsigned	    mean;	/**< Average jitter (in usec)	    */
+	    unsigned	    count;	/**< Update count		    */
+	} jitter;			/**< Jitter history.		    */
+
+	struct {
+	    unsigned	    min;	/**< Minimum ToH		    */
+	    unsigned	    max;	/**< Maximum ToH		    */
+	    unsigned	    dev;	/**< ToH deviation		    */
+	    unsigned	    mean;	/**< Average ToH		    */
+	    unsigned	    count;	/**< Update count		    */
+	} toh;				/**< TTL of hop limit history.	    */
+    } stat_sum;
+
+    struct {
+	pj_uint8_t	    loss_rate;	    /**< Packet loss rate	    */
+	pj_uint8_t	    discard_rate;   /**< Packet discarded rate	    */
+	pj_uint8_t	    burst_den;	    /**< Burst density		    */
+	pj_uint8_t	    gap_den;	    /**< Gap density		    */
+	pj_uint16_t	    burst_dur;	    /**< Burst duration		    */
+	pj_uint16_t	    gap_dur;	    /**< Gap duration		    */
+	pj_uint16_t	    rnd_trip_delay; /**< Round trip delay	    */
+	pj_uint16_t	    end_sys_delay;  /**< End system delay	    */
+	pj_uint8_t	    signal_lvl;	    /**< Signal level		    */
+	pj_uint8_t	    noise_lvl;	    /**< Noise level		    */
+	pj_uint8_t	    rerl;	    /**< Residual Echo Return Loss  */
+	pj_uint8_t	    gmin;	    /**< The gap threshold	    */
+	pj_uint8_t	    r_factor;	    /**< Voice quality metric carried
+						 over this RTP session	    */
+	pj_uint8_t	    ext_r_factor;   /**< Voice quality metric carried 
+						 outside of this RTP session*/
+	pj_uint8_t	    mos_lq;	    /**< Mean Opinion Score for 
+						 Listening Quality          */
+	pj_uint8_t	    mos_cq;	    /**< Mean Opinion Score for 
+						 Conversation Quality       */
+	pj_uint8_t	    rx_config;	    /**< Receiver configuration	    */
+	pj_uint16_t	    jb_nom;	    /**< Current delay by jitter
+						 buffer			    */
+	pj_uint16_t	    jb_max;	    /**< Maximum delay by jitter
+						 buffer			    */
+	pj_uint16_t	    jb_abs_max;	    /**< Maximum possible delay by
+						 jitter buffer		    */
+    } voip_mtc;
+
+} pjmedia_rtcp_xr_stream_stat;
+
+typedef struct pjmedia_rtcp_xr_stat
+{
+    pjmedia_rtcp_xr_stream_stat	 rx;
+    pjmedia_rtcp_xr_stream_stat	 tx;
+
+    /* RTT calculated from receiver side */
+    struct {
+	unsigned    min;	    /**< Minimum round-trip delay (in usec) */
+	unsigned    avg;	    /**< Average round-trip delay (in usec) */
+	unsigned    max;	    /**< Maximum round-trip delay (in usec) */
+	unsigned    last;	    /**< Last round-trip delay (in usec)    */
+	unsigned    update_cnt;	    /**< Nb of times rtt is updated.	    */
+    } rtt;			    /**< Round trip delay history.	    */
+
+} pjmedia_rtcp_xr_stat;
+
+/**
+ * Forward declaration of RTCP session
+ */
+struct pjmedia_rtcp_session;
+
+/**
+ * RTCP session is used to monitor the RTP session of one endpoint. There
+ * should only be one RTCP session for a bidirectional RTP streams.
+ */
+struct pjmedia_rtcp_xr_session
+{
+    char		   *name;	/**< Name identification.	    */
+    pjmedia_rtcp_xr_pkt	    pkt;	/**< Cached RTCP XR packet.	    */
+
+    pj_uint32_t		    rx_lrr;	/**< NTP ts in last RR received.    */
+    pj_timestamp	    rx_lrr_time;/**< Time when last RR is received. */
+    pj_uint32_t		    rx_last_rr; /**< # pkt received since last 
+				             sending RR time.		    */
+
+    pjmedia_rtcp_xr_stat    stat;	/**< RTCP XR statistics.	    */
+
+    /* The reference sequence number is an extended sequence number
+     * that serves as the basis for determining whether a new 16 bit
+     * sequence number comes earlier or later in the 32 bit sequence
+     * space.
+     */
+    pj_uint32_t		    src_ref_seq;
+    pj_bool_t		    uninitialized_src_ref_seq;
+
+    /* This structure contains variables needed for calculating 
+     * burst metrics.
+     */
+    struct {
+	pj_uint32_t	    pkt;
+	pj_uint32_t	    lost;
+	pj_uint32_t	    loss_count;
+	pj_uint32_t	    discard_count;
+	pj_uint32_t	    c11;
+	pj_uint32_t	    c13;
+	pj_uint32_t	    c14;
+	pj_uint32_t	    c22;
+	pj_uint32_t	    c23;
+	pj_uint32_t	    c33;
+    } voip_mtc_stat;
+
+    unsigned ptime;			/**< Packet time.		    */
+    unsigned frames_per_packet;		/**< # frames per packet.	    */
+
+    struct pjmedia_rtcp_session *rtcp_session;
+					/**< Parent/RTCP session.	    */
+};
+
+typedef struct pjmedia_rtcp_xr_session pjmedia_rtcp_xr_session;
+
+/**
+ * Build an RTCP XR packet which contains one or more RTCP XR report blocks.
+ * There are seven report types as defined in RFC 3611.
+ *
+ * @param session   The RTCP XR session.
+ * @param rpt_types Report types to be included in the packet, report types
+ *		    are defined in pjmedia_rtcp_xr_type, set this to zero
+ *		    will make this function build all reports appropriately.
+ * @param rtcp_pkt  Upon return, it will contain pointer to the RTCP XR packet.
+ * @param len	    Upon return, it will indicate the size of the generated 
+ *		    RTCP XR packet.
+ */
+PJ_DECL(void) pjmedia_rtcp_build_rtcp_xr( pjmedia_rtcp_xr_session *session,
+					  unsigned rpt_types,
+					  void **rtcp_pkt, int *len);
+
+/**
+ * Call this function to manually update some info needed by RTCP XR to 
+ * generate report which could not be populated directly when receiving
+ * RTP.
+ *
+ * @param session   The RTCP XR session.
+ * @param info	    Info type to be updated, @see pjmedia_rtcp_xr_info.
+ * @param val	    Value.
+ */
+PJ_DECL(pj_status_t) pjmedia_rtcp_xr_update_info(
+					  pjmedia_rtcp_xr_session *session,
+					  unsigned info,
+					  pj_int32_t val);
+
+/*
+ * Private APIs:
+ */
+
+/**
+ * This function is called internally by RTCP session when RTCP XR is enabled
+ * to initialize the RTCP XR session.
+ *
+ * @param session   RTCP XR session.
+ * @param r_session RTCP session.
+ * @param gmin      Gmin value (defined in RFC 3611), set to 0 for default (16).
+ * @param ptime	    Packet time.
+ * @param frames_per_packet
+		    Number of frames per packet.
+ */
+void pjmedia_rtcp_xr_init( pjmedia_rtcp_xr_session *session, 
+			   struct pjmedia_rtcp_session *r_session,
+			   pj_uint8_t gmin,
+			   unsigned frames_per_packet);
+
+/**
+ * This function is called internally by RTCP session to destroy 
+ * the RTCP XR session.
+ *
+ * @param session   RTCP XR session.
+ */
+void pjmedia_rtcp_xr_fini( pjmedia_rtcp_xr_session *session );
+
+/**
+ * This function is called internally by RTCP session when it receives 
+ * incoming RTCP XR packets.
+ *
+ * @param session   RTCP XR session.
+ * @param rtcp_pkt  The received RTCP XR packet.
+ * @param size	    Size of the incoming packet.
+ */
+void pjmedia_rtcp_xr_rx_rtcp_xr( pjmedia_rtcp_xr_session *session,
+				 const void *rtcp_xr_pkt,
+				 pj_size_t size);
+
+/**
+ * This function is called internally by RTCP session whenever an RTP packet
+ * is received or lost to let the RTCP XR session update its statistics.
+ * Data passed to this function is a result of analyzation by RTCP and the
+ * jitter buffer. Whenever some info is available, the value should be zero
+ * or more (no negative info), otherwise if info is not available the info
+ * should be -1 so no update will be done for this info in the RTCP XR session.
+ *
+ * @param session   RTCP XR session.
+ * @param seq	    Sequence number of RTP packet.
+ * @param lost	    Info if this packet is lost. 
+ * @param dup	    Info if this packet is a duplication. 
+ * @param discarded Info if this packet is discarded 
+ *		    (not because of duplication).
+ * @param jitter    Info jitter of this packet.
+ * @param toh	    Info Time To Live or Hops Limit of this packet.
+ * @param toh_ipv4  Set PJ_TRUE if packet is transported over IPv4.
+ */
+void pjmedia_rtcp_xr_rx_rtp( pjmedia_rtcp_xr_session *session,
+			     unsigned seq, 
+			     int lost,
+			     int dup,
+			     int discarded,
+			     int jitter,
+			     int toh, pj_bool_t toh_ipv4);
+
+/**
+ * This function is called internally by RTCP session whenever an RTP 
+ * packet is sent to let the RTCP XR session do its internal calculations.
+ *
+ * @param session   RTCP XR session.
+ * @param ptsize    Size of RTP payload being sent.
+ */
+void pjmedia_rtcp_xr_tx_rtp( pjmedia_rtcp_xr_session *session, 
+			     unsigned ptsize );
+
+/**
+ * @}
+ */
+
+PJ_END_DECL
+
+
+#endif	/* __PJMEDIA_RTCP_XR_H__ */
diff --git a/pjmedia/src/pjmedia/jbuf.c b/pjmedia/src/pjmedia/jbuf.c
index a1e2311..4ae3b30 100644
--- a/pjmedia/src/pjmedia/jbuf.c
+++ b/pjmedia/src/pjmedia/jbuf.c
@@ -67,7 +67,7 @@
     int		    jb_max_prefetch;	  // Maximum allowable prefetch
     int		    jb_status;		  // status is 'init' until the	first 'put' operation
 
-
+    int		    jb_max_size;	  // Maximum frames buffered ever
 };
 
 
@@ -368,6 +368,7 @@
     jb->jb_stable_hist	 = 0;
     jb->jb_status	 = JB_STATUS_INITIALIZING;
     jb->jb_max_hist_level = 0;
+    jb->jb_max_size	 = 0;
 
     jb_framelist_remove_head(&jb->jb_framelist, 
 			     jb_framelist_size(&jb->jb_framelist));
@@ -383,7 +384,12 @@
 
 static void jbuf_calculate_jitter(pjmedia_jbuf *jb)
 {
-    int diff;
+    int diff, cur_size;
+
+    /* Update jb_max_size */
+    cur_size = jb_framelist_size(&jb->jb_framelist);
+    if (cur_size > jb->jb_max_size)
+	jb->jb_max_size = cur_size;
 
     /* Only apply burst-level calculation on PUT operation since if VAD is 
      * active the burst-level may not be accurate.
@@ -413,7 +419,7 @@
 		    jb->jb_prefetch = jb->jb_min_prefetch;
 
 		TRACE__((jb->name.ptr,"jb updated(1), prefetch=%d, size=%d", 
-			 jb->jb_prefetch, jb_framelist_size(&jb->jb_framelist)));
+			 jb->jb_prefetch, cur_size));
 
 		jb->jb_stable_hist = 0;
 		jb->jb_max_hist_level = 0;
@@ -432,7 +438,7 @@
 	    jb->jb_max_hist_level = 0;
 
 	    TRACE__((jb->name.ptr,"jb updated(2), prefetch=%d, size=%d", 
-		     jb->jb_prefetch, jb_framelist_size(&jb->jb_framelist)));
+		     jb->jb_prefetch, cur_size));
 	}
 
 	/* Level is unchanged */
@@ -442,7 +448,7 @@
     }
 
     /* These code is used for shortening the delay in the jitter buffer. */
-    diff = jb_framelist_size(&jb->jb_framelist) - jb->jb_prefetch;
+    diff = cur_size - jb->jb_prefetch;
     if (diff > SAFE_SHRINKING_DIFF) {
 	/* Shrink slowly */
 	diff = 1;
@@ -471,6 +477,15 @@
 				     pj_size_t frame_size, 
 				     int frame_seq)
 {
+    pjmedia_jbuf_put_frame2(jb, frame, frame_size, frame_seq, NULL);
+}
+
+PJ_DEF(void) pjmedia_jbuf_put_frame2(pjmedia_jbuf *jb, 
+				     const void *frame, 
+				     pj_size_t frame_size, 
+				     int frame_seq,
+				     pj_bool_t *discarded)
+{
     pj_size_t min_frame_size;
     int seq_diff;
 
@@ -493,7 +508,7 @@
     if (seq_diff > 0) {
 
 	while (jb_framelist_put_at(&jb->jb_framelist,
-				   frame_seq,frame,min_frame_size) ==PJ_FALSE)
+				   frame_seq,frame,min_frame_size) == PJ_FALSE)
 	{
 	    jb_framelist_remove_head(&jb->jb_framelist,
 				     PJ_MAX(jb->jb_max_count/4,1) );
@@ -502,10 +517,16 @@
 	if (jb->jb_prefetch_cnt < jb->jb_prefetch)	
 	    jb->jb_prefetch_cnt += seq_diff;
 
+	if (discarded)
+	    *discarded = PJ_FALSE;
     }
     else
     {
-	jb_framelist_put_at(&jb->jb_framelist,frame_seq,frame,min_frame_size);
+	pj_bool_t res;
+	res = jb_framelist_put_at(&jb->jb_framelist,frame_seq,frame,
+				  min_frame_size);
+	if (discarded)
+	    *discarded = !res;
     }
 }
 
@@ -590,6 +611,7 @@
     state->min_prefetch = jb->jb_min_prefetch;
     state->max_prefetch = jb->jb_max_prefetch;
     state->size = jb_framelist_size(&jb->jb_framelist);
+    state->max_size = jb->jb_max_size;
 
     return PJ_SUCCESS;
 }
diff --git a/pjmedia/src/pjmedia/rtcp.c b/pjmedia/src/pjmedia/rtcp.c
index 540affd..5dc7623 100644
--- a/pjmedia/src/pjmedia/rtcp.c
+++ b/pjmedia/src/pjmedia/rtcp.c
@@ -28,7 +28,7 @@
 
 #define RTCP_SR   200
 #define RTCP_RR   201
-
+#define RTCP_XR   207
 
 #if PJ_HAS_HIGH_RES_TIMER==0
 #   error "High resolution timer needs to be enabled"
@@ -172,8 +172,12 @@
 
 PJ_DEF(void) pjmedia_rtcp_fini(pjmedia_rtcp_session *sess)
 {
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+    pjmedia_rtcp_xr_fini(&sess->xr_session);
+#else
     /* Nothing to do. */
     PJ_UNUSED_ARG(sess);
+#endif
 }
 
 static void rtcp_init_seq(pjmedia_rtcp_session *sess)
@@ -185,10 +189,19 @@
     sess->jitter = 0;
 }
 
-PJ_DEF(void) pjmedia_rtcp_rx_rtp(pjmedia_rtcp_session *sess, 
-				 unsigned seq, 
-				 unsigned rtp_ts,
-				 unsigned payload)
+PJ_DEF(void) pjmedia_rtcp_rx_rtp( pjmedia_rtcp_session *sess, 
+				  unsigned seq, 
+				  unsigned rtp_ts,
+				  unsigned payload)
+{
+    pjmedia_rtcp_rx_rtp2(sess, seq, rtp_ts, payload, PJ_FALSE);
+}
+
+PJ_DEF(void) pjmedia_rtcp_rx_rtp2(pjmedia_rtcp_session *sess, 
+				  unsigned seq, 
+				  unsigned rtp_ts,
+				  unsigned payload,
+				  pj_bool_t discarded)
 {   
     pj_timestamp ts;
     pj_uint32_t arrival;
@@ -196,6 +209,10 @@
     pjmedia_rtp_status seq_st;
     unsigned last_seq;
 
+#if !defined(PJMEDIA_HAS_RTCP_XR) || (PJMEDIA_HAS_RTCP_XR == 0)
+    PJ_UNUSED_ARG(discarded);
+#endif
+
     if (sess->stat.rx.pkt == 0) {
 	/* Init sequence for the first time. */
 	pjmedia_rtp_seq_init(&sess->seq_ctrl, (pj_uint16_t)seq);
@@ -224,6 +241,16 @@
 
     if (seq_st.status.flag.bad) {
 	sess->stat.rx.discard++;
+
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+	pjmedia_rtcp_xr_rx_rtp(&sess->xr_session, seq, 
+			       -1,				 /* lost    */
+			       (seq_st.status.flag.dup? 1:0),	 /* dup     */
+			       (!seq_st.status.flag.dup? 1:-1),  /* discard */
+			       -1,				 /* jitter  */
+			       -1, 0);				 /* toh	    */
+#endif
+
 	TRACE_((sess->name, "Bad packet discarded"));
 	return;
     }
@@ -316,7 +343,38 @@
 		sess->stat.rx.jitter.max = jitter;
 
 	    sess->stat.rx.jitter.last = jitter;
+
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+	    pjmedia_rtcp_xr_rx_rtp(&sess->xr_session, seq, 
+				   0,			    /* lost    */
+				   0,			    /* dup     */
+				   discarded,		    /* discard */
+				   (sess->jitter >> 4),	    /* jitter  */
+				   -1, 0);		    /* toh     */
+#endif
 	}
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+    } else if (seq_st.diff > 1) {
+	int i;
+
+	/* Report RTCP XR about packet losses */
+	for (i=seq_st.diff-1; i>0; --i) {
+	    pjmedia_rtcp_xr_rx_rtp(&sess->xr_session, seq - i, 
+				   1,			    /* lost    */
+				   0,			    /* dup     */
+				   0,			    /* discard */
+				   -1,			    /* jitter  */
+				   -1, 0);		    /* toh     */
+	}
+
+	/* Report RTCP XR this packet */
+	pjmedia_rtcp_xr_rx_rtp(&sess->xr_session, seq, 
+			       0,			    /* lost    */
+			       0,			    /* dup     */
+			       discarded,		    /* discard */
+			       -1,			    /* jitter  */
+			       -1, 0);			    /* toh     */
+#endif
     }
 
     /* Update timestamp of last RX RTP packet */
@@ -348,8 +406,16 @@
 	    rr = (pjmedia_rtcp_rr*)(((char*)pkt) + (sizeof(pjmedia_rtcp_common)
 				    + sizeof(pjmedia_rtcp_sr)));
 	}
-    } else if (common->pt == RTCP_RR && common->count > 0)
+    } else if (common->pt == RTCP_RR && common->count > 0) {
 	rr = (pjmedia_rtcp_rr*)(((char*)pkt) + sizeof(pjmedia_rtcp_common));
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+    } else if (common->pt == RTCP_XR) {
+	if (sess->xr_enabled)
+	    pjmedia_rtcp_xr_rx_rtcp_xr(&sess->xr_session, pkt, size);
+
+	return;
+#endif
+    }
 
 
     if (sr) {
@@ -674,4 +740,30 @@
     sess->stat.rx.update_cnt++;
 }
 
- 
+PJ_DEF(pj_status_t) pjmedia_rtcp_enable_xr( pjmedia_rtcp_session *sess, 
+					    pj_bool_t enable)
+{
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+
+    /* Check if request won't change anything */
+    if (!(enable ^ sess->xr_enabled))
+	return PJ_SUCCESS;
+
+    if (!enable) {
+	sess->xr_enabled = PJ_FALSE;
+	return PJ_SUCCESS;
+    }
+
+    pjmedia_rtcp_xr_init(&sess->xr_session, sess, 0, 1);
+    sess->xr_enabled = PJ_TRUE;
+
+    return PJ_SUCCESS;
+
+#else
+
+    PJ_UNUSED_ARG(sess);
+    PJ_UNUSED_ARG(enable);
+    return PJ_ENOTSUP;
+
+#endif
+}
diff --git a/pjmedia/src/pjmedia/rtcp_xr.c b/pjmedia/src/pjmedia/rtcp_xr.c
new file mode 100644
index 0000000..f8d5389
--- /dev/null
+++ b/pjmedia/src/pjmedia/rtcp_xr.c
@@ -0,0 +1,866 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+
+#include <pjmedia/rtcp_xr.h>
+#include <pjmedia/errno.h>
+#include <pjmedia/rtcp.h>
+#include <pj/assert.h>
+#include <pj/log.h>
+#include <pj/os.h>
+#include <pj/sock.h>
+#include <pj/string.h>
+
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+
+#define THIS_FILE "rtcp_xr.c"
+
+
+#if PJ_HAS_HIGH_RES_TIMER==0
+#   error "High resolution timer needs to be enabled"
+#endif
+
+
+/* RTCP XR payload type */
+#define RTCP_XR		    207
+
+/* RTCP XR block types */
+#define BT_LOSS_RLE	    1
+#define BT_DUP_RLE	    2
+#define BT_RCPT_TIMES	    3
+#define BT_RR_TIME	    4
+#define BT_DLRR		    5
+#define BT_STATS	    6
+#define BT_VOIP_METRICS	    7
+
+
+#define DEFAULT_GMIN	    16
+
+
+#if 0
+#   define TRACE_(x)	PJ_LOG(3,x)
+#else
+#   define TRACE_(x)	;
+#endif
+
+/* Integer square root for calculating standard deviation */
+static pj_uint32_t my_isqrt(pj_uint32_t i)
+{
+    pj_uint32_t res = 1, prev;
+    
+    /* Rough guess */
+    prev = i >> 2;
+    while (prev) {
+	prev >>= 2;
+	res <<= 1;
+    }
+
+    /* Babilonian method */
+    do {
+	prev = res;
+	res = (prev + i/prev) >> 1;
+    } while ((prev+res)>>1 != res);
+
+    return res;
+}
+
+void pjmedia_rtcp_xr_init( pjmedia_rtcp_xr_session *session, 
+			   struct pjmedia_rtcp_session *parent_session,
+			   pj_uint8_t gmin,
+			   unsigned frames_per_packet)
+{
+    pj_bzero(session, sizeof(pjmedia_rtcp_xr_session));
+
+    session->rtcp_session = parent_session;
+    pj_memcpy(&session->pkt.common, &session->rtcp_session->rtcp_sr_pkt.common,
+	      sizeof(pjmedia_rtcp_common));
+    session->pkt.common.pt = RTCP_XR;
+
+    /* Init config */
+    session->stat.tx.voip_mtc.gmin = (pj_uint8_t)(gmin? gmin : DEFAULT_GMIN);
+    session->ptime = session->rtcp_session->pkt_size * 1000 / 
+		     session->rtcp_session->clock_rate;
+    session->frames_per_packet = frames_per_packet;
+
+    /* Init Statistics Summary fields which have non-zero default */
+    session->stat.tx.stat_sum.jitter.min = (unsigned) -1;
+    session->stat.tx.stat_sum.toh.min = (unsigned) -1;
+
+    /* Init VoIP Metrics fields which have non-zero default */
+    session->stat.tx.voip_mtc.signal_lvl = 127;
+    session->stat.tx.voip_mtc.noise_lvl = 127;
+    session->stat.tx.voip_mtc.rerl = 127;
+    session->stat.tx.voip_mtc.r_factor = 127;
+    session->stat.tx.voip_mtc.ext_r_factor = 127;
+    session->stat.tx.voip_mtc.mos_lq = 127;
+    session->stat.tx.voip_mtc.mos_cq = 127;
+}
+
+void pjmedia_rtcp_xr_fini(pjmedia_rtcp_xr_session *session)
+{
+    PJ_UNUSED_ARG(session);
+}
+
+PJ_DEF(void) pjmedia_rtcp_build_rtcp_xr( pjmedia_rtcp_xr_session *sess, 
+					 unsigned rpt_types,
+					 void **rtcp_pkt, int *len)
+{
+    pj_uint16_t size = 0;
+
+    /* Receiver Reference Time Report Block */
+    /* Build this block if we have received packets since last build */
+    if ((rpt_types == 0 || (rpt_types & PJMEDIA_RTCP_XR_RR_TIME)) &&
+	sess->rx_last_rr != sess->rtcp_session->stat.rx.pkt)
+    {
+	pjmedia_rtcp_xr_rb_rr_time *r;
+	pjmedia_rtcp_ntp_rec ntp;
+
+	r = (pjmedia_rtcp_xr_rb_rr_time*) &sess->pkt.buf[size];
+	pj_bzero(r, sizeof(pjmedia_rtcp_xr_rb_rr_time));
+
+	/* Init block header */
+	r->header.bt = BT_RR_TIME;
+	r->header.specific = 0;
+	r->header.length = pj_htons(2);
+
+	/* Generate block contents */
+	pjmedia_rtcp_get_ntp_time(sess->rtcp_session, &ntp);
+	r->ntp_sec = pj_htonl(ntp.hi);
+	r->ntp_frac = pj_htonl(ntp.lo);
+
+	/* Finally */
+	size += sizeof(pjmedia_rtcp_xr_rb_rr_time);
+	sess->rx_last_rr = sess->rtcp_session->stat.rx.pkt;
+    }
+
+    /* DLRR Report Block */
+    /* Build this block if we have received RR NTP (rx_lrr) before */
+    if ((rpt_types == 0 || (rpt_types & PJMEDIA_RTCP_XR_DLRR)) && 
+	sess->rx_lrr)
+    {
+	pjmedia_rtcp_xr_rb_dlrr *r;
+	pjmedia_rtcp_xr_rb_dlrr_item *dlrr_item;
+	pj_timestamp ts;
+
+	r = (pjmedia_rtcp_xr_rb_dlrr*) &sess->pkt.buf[size];
+	pj_bzero(r, sizeof(pjmedia_rtcp_xr_rb_dlrr));
+
+	/* Init block header */
+	r->header.bt = BT_DLRR;
+	r->header.specific = 0;
+	r->header.length = pj_htons(sizeof(pjmedia_rtcp_xr_rb_dlrr)/4 - 1);
+
+	/* Generate block contents */
+	dlrr_item = &r->item;
+	dlrr_item->ssrc = pj_htonl(sess->rtcp_session->peer_ssrc);
+	dlrr_item->lrr = pj_htonl(sess->rx_lrr);
+
+	/* Calculate DLRR */
+	if (sess->rx_lrr != 0) {
+	    pj_get_timestamp(&ts);
+	    ts.u64 -= sess->rx_lrr_time.u64;
+	
+	    /* Convert DLRR time to 1/65536 seconds resolution */
+	    ts.u64 = (ts.u64 << 16) / sess->rtcp_session->ts_freq.u64;
+	    dlrr_item->dlrr = pj_htonl(ts.u32.lo);
+	} else {
+	    dlrr_item->dlrr = 0;
+	}
+
+	/* Finally */
+	size += sizeof(pjmedia_rtcp_xr_rb_dlrr);
+    }
+
+    /* Statistics Summary Block */
+    /* Build this block if we have received packets since last build */
+    if ((rpt_types == 0 || (rpt_types & PJMEDIA_RTCP_XR_STATS)) &&
+	sess->stat.tx.stat_sum.count > 0)
+    {
+	pjmedia_rtcp_xr_rb_stats *r;
+	pj_uint8_t specific = 0;
+
+	r = (pjmedia_rtcp_xr_rb_stats*) &sess->pkt.buf[size];
+	pj_bzero(r, sizeof(pjmedia_rtcp_xr_rb_stats));
+
+	/* Init block header */
+	specific |= sess->stat.tx.stat_sum.l ? (1 << 7) : 0;
+	specific |= sess->stat.tx.stat_sum.d ? (1 << 6) : 0;
+	specific |= sess->stat.tx.stat_sum.j ? (1 << 5) : 0;
+	specific |= (sess->stat.tx.stat_sum.t & 3) << 3;
+	r->header.bt = BT_STATS;
+	r->header.specific = specific;
+	r->header.length = pj_htons(9);
+
+	/* Generate block contents */
+	r->ssrc = pj_htonl(sess->rtcp_session->peer_ssrc);
+	r->begin_seq = pj_htons((pj_uint16_t)
+				(sess->stat.tx.stat_sum.begin_seq & 0xFFFF));
+	r->end_seq = pj_htons((pj_uint16_t)
+			      (sess->stat.tx.stat_sum.end_seq & 0xFFFF));
+	if (sess->stat.tx.stat_sum.l) {
+	    r->lost = pj_htonl(sess->stat.tx.stat_sum.lost);
+	}
+	if (sess->stat.tx.stat_sum.d) {
+	    r->dup = pj_htonl(sess->stat.tx.stat_sum.dup);
+	}
+	if (sess->stat.tx.stat_sum.j) {
+	    r->jitter_min = pj_htonl(sess->stat.tx.stat_sum.jitter.min);
+	    r->jitter_max = pj_htonl(sess->stat.tx.stat_sum.jitter.max);
+	    r->jitter_mean = pj_htonl(sess->stat.tx.stat_sum.jitter.mean);
+	    sess->stat.tx.stat_sum.jitter.dev = 
+				my_isqrt(sess->stat.tx.stat_sum.jitter.dev);
+	    r->jitter_dev = pj_htonl(sess->stat.tx.stat_sum.jitter.dev);
+	}
+	if (sess->stat.tx.stat_sum.t) {
+	    r->toh_min = sess->stat.tx.stat_sum.toh.min;
+	    r->toh_max = sess->stat.tx.stat_sum.toh.max;
+	    r->toh_mean = sess->stat.tx.stat_sum.toh.mean;
+	    sess->stat.tx.stat_sum.toh.dev = 
+				my_isqrt(sess->stat.tx.stat_sum.toh.dev);
+	    r->toh_dev = sess->stat.tx.stat_sum.toh.dev;
+	}
+
+	/* Reset TX statistics summary each time built */
+	pj_bzero(&sess->stat.tx.stat_sum, sizeof(sess->stat.tx.stat_sum));
+	sess->stat.tx.stat_sum.jitter.min = (unsigned) -1;
+	sess->stat.tx.stat_sum.toh.min = (unsigned) -1;
+
+	/* Finally */
+	size += sizeof(pjmedia_rtcp_xr_rb_stats);
+    }
+
+    /* Voip Metrics Block */
+    /* Build this block if we have received packets */
+    if ((rpt_types == 0 || (rpt_types & PJMEDIA_RTCP_XR_VOIP_METRICS)) &&
+	sess->rtcp_session->stat.rx.pkt)
+    {
+	pjmedia_rtcp_xr_rb_voip_mtc *r;
+	pj_uint32_t c11;
+	pj_uint32_t c13;
+	pj_uint32_t c14;
+	pj_uint32_t c22;
+	pj_uint32_t c23;
+	pj_uint32_t c31;
+	pj_uint32_t c32;
+	pj_uint32_t c33;
+	pj_uint32_t ctotal, p32, p23, m;
+
+	r = (pjmedia_rtcp_xr_rb_voip_mtc*) &sess->pkt.buf[size];
+	pj_bzero(r, sizeof(pjmedia_rtcp_xr_rb_voip_mtc));
+
+	/* Init block header */
+	r->header.bt = BT_VOIP_METRICS;
+	r->header.specific = 0;
+	r->header.length = pj_htons(8);
+
+	/* Calculate additional transition counts. */
+	c11 = sess->voip_mtc_stat.c11;
+	c13 = sess->voip_mtc_stat.c13;
+	c14 = sess->voip_mtc_stat.c14;
+	c22 = sess->voip_mtc_stat.c22;
+	c23 = sess->voip_mtc_stat.c23;
+	c33 = sess->voip_mtc_stat.c33;
+	c31 = c13;
+	c32 = c23;
+	ctotal = c11 + c14 + c13 + c22 + c23 + c31 + c32 + c33;
+	m = sess->ptime * sess->frames_per_packet;
+
+	/* Calculate burst and densities. */
+	if (ctotal) {
+	    p32 = c32 / (c31 + c32 + c33);
+	    if((c22 + c23) < 1) {
+		p23 = 1;
+	    } else {
+		p23 = 1 - c22/(c22 + c23);
+	    }
+	    sess->stat.tx.voip_mtc.burst_den = (pj_uint8_t)(256*p23/(p23 + p32));
+	    sess->stat.tx.voip_mtc.gap_den = (pj_uint8_t)(256*c14/(c11 + c14));
+
+	    /* Calculate burst and gap durations in ms */
+	    sess->stat.tx.voip_mtc.gap_dur = (pj_uint16_t)((c11+c14+c13)*m/c13);
+	    sess->stat.tx.voip_mtc.burst_dur = (pj_uint16_t)(ctotal*m/c13 - 
+					       sess->stat.tx.voip_mtc.gap_dur);
+	} else {
+	    /* No burst occurred yet until this time?
+	     * Just report full gap.
+	     */
+	    ctotal = sess->rtcp_session->stat.rx.pkt;
+
+	    sess->stat.tx.voip_mtc.burst_den = 0;
+	    sess->stat.tx.voip_mtc.gap_den = (pj_uint8_t)(256 * 
+					(sess->voip_mtc_stat.loss_count + 
+					sess->voip_mtc_stat.discard_count) / 
+					ctotal);
+
+	    /* Calculate burst and gap durations in ms */
+	    sess->stat.tx.voip_mtc.gap_dur = (pj_uint16_t)((m*ctotal) < 0xFFFF?
+					     (m*ctotal) : 0xFFFF);
+	    sess->stat.tx.voip_mtc.burst_dur = 0;
+	}
+
+	/* Calculate loss and discard rates */
+	sess->stat.tx.voip_mtc.loss_rate = (pj_uint8_t)
+			     (256 * sess->voip_mtc_stat.loss_count / ctotal);
+	sess->stat.tx.voip_mtc.discard_rate = (pj_uint8_t)
+			     (256 * sess->voip_mtc_stat.discard_count / ctotal);
+
+	/* Set round trip delay (in ms) to RTT calculated after receiving
+	 * DLRR or DLSR.
+	 */
+	if (sess->stat.rtt.last)
+	    sess->stat.tx.voip_mtc.rnd_trip_delay = (pj_uint16_t)
+				    (sess->stat.rtt.last / 1000);
+	else if (sess->rtcp_session->stat.rtt.last)
+	    sess->stat.tx.voip_mtc.rnd_trip_delay = (pj_uint16_t)
+				    (sess->rtcp_session->stat.rtt.last / 1000);
+	
+	/* End system delay estimation = RTT/2 + current jitter buffer size +
+	 *				 EXTRA
+	 * EXTRA will cover additional delay introduced by other components of
+	 * audio engine, e.g: sound device, codec, AEC, PLC, WSOLA.
+	 * Since it is difficult to get the exact value of EXTRA, estimation
+	 * is taken to be totally around 50 ms.
+	 */
+	sess->stat.tx.voip_mtc.end_sys_delay = (pj_uint16_t)
+				(sess->stat.tx.voip_mtc.rnd_trip_delay / 2 +
+				 sess->stat.tx.voip_mtc.jb_nom + 50);
+
+	/* Generate block contents */
+	r->ssrc		    = pj_htonl(sess->rtcp_session->peer_ssrc);
+	r->loss_rate	    = sess->stat.tx.voip_mtc.loss_rate;
+	r->discard_rate	    = sess->stat.tx.voip_mtc.discard_rate;
+	r->burst_den	    = sess->stat.tx.voip_mtc.burst_den;
+	r->gap_den	    = sess->stat.tx.voip_mtc.gap_den;
+	r->burst_dur	    = pj_htons(sess->stat.tx.voip_mtc.burst_dur);
+	r->gap_dur	    = pj_htons(sess->stat.tx.voip_mtc.gap_dur);
+	r->rnd_trip_delay   = pj_htons(sess->stat.tx.voip_mtc.rnd_trip_delay);
+	r->end_sys_delay    = pj_htons(sess->stat.tx.voip_mtc.end_sys_delay);
+	r->signal_lvl	    = sess->stat.tx.voip_mtc.signal_lvl;
+	r->noise_lvl	    = sess->stat.tx.voip_mtc.noise_lvl;
+	r->rerl		    = sess->stat.tx.voip_mtc.rerl;
+	r->gmin		    = sess->stat.tx.voip_mtc.gmin;
+	r->r_factor	    = sess->stat.tx.voip_mtc.r_factor;
+	r->ext_r_factor	    = sess->stat.tx.voip_mtc.ext_r_factor;
+	r->mos_lq	    = sess->stat.tx.voip_mtc.mos_lq;
+	r->mos_cq	    = sess->stat.tx.voip_mtc.mos_cq;
+	r->rx_config	    = sess->stat.tx.voip_mtc.rx_config;
+	r->jb_nom	    = pj_htons(sess->stat.tx.voip_mtc.jb_nom);
+	r->jb_max	    = pj_htons(sess->stat.tx.voip_mtc.jb_max);
+	r->jb_abs_max	    = pj_htons(sess->stat.tx.voip_mtc.jb_abs_max);
+
+	/* Finally */
+	size += sizeof(pjmedia_rtcp_xr_rb_voip_mtc);
+    }
+
+    /* Add RTCP XR header size */
+    size += sizeof(sess->pkt.common);
+
+    /* Set RTCP XR header 'length' to packet size in 32-bit unit minus one */
+    sess->pkt.common.length = pj_htons((pj_uint16_t)(size/4 - 1));
+
+    /* Set the return values */
+    *rtcp_pkt = (void*) &sess->pkt;
+    *len = size;
+}
+
+
+void pjmedia_rtcp_xr_rx_rtcp_xr( pjmedia_rtcp_xr_session *sess,
+				 const void *pkt,
+				 pj_size_t size)
+{
+    const pjmedia_rtcp_xr_pkt	      *rtcp_xr = (pjmedia_rtcp_xr_pkt*) pkt;
+    const pjmedia_rtcp_xr_rb_rr_time  *rb_rr_time = NULL;
+    const pjmedia_rtcp_xr_rb_dlrr     *rb_dlrr = NULL;
+    const pjmedia_rtcp_xr_rb_stats    *rb_stats = NULL;
+    const pjmedia_rtcp_xr_rb_voip_mtc *rb_voip_mtc = NULL;
+    const pjmedia_rtcp_xr_rb_header   *rb_hdr = (pjmedia_rtcp_xr_rb_header*) 
+						rtcp_xr->buf;
+    unsigned pkt_len, rb_len;
+
+    if (rtcp_xr->common.pt != RTCP_XR)
+	return;
+
+    pkt_len = pj_ntohs((pj_uint16_t)rtcp_xr->common.length);
+
+    pj_assert((pkt_len + 1) <= (size / 4));
+
+    /* Parse report rpt_types */
+    while ((pj_int32_t*)rb_hdr < (pj_int32_t*)pkt + pkt_len)
+    {	
+	rb_len = pj_ntohs((pj_uint16_t)rb_hdr->length);
+
+	/* Just skip any block with length == 0 (no report content) */
+	if (rb_len) {
+	    switch (rb_hdr->bt) {
+		case BT_RR_TIME:
+		    rb_rr_time = (pjmedia_rtcp_xr_rb_rr_time*) rb_hdr;
+		    break;
+		case BT_DLRR:
+		    rb_dlrr = (pjmedia_rtcp_xr_rb_dlrr*) rb_hdr;
+		    break;
+		case BT_STATS:
+		    rb_stats = (pjmedia_rtcp_xr_rb_stats*) rb_hdr;
+		    break;
+		case BT_VOIP_METRICS:
+		    rb_voip_mtc = (pjmedia_rtcp_xr_rb_voip_mtc*) rb_hdr;
+		    break;
+		default:
+		    break;
+	    }
+	}
+	rb_hdr = (pjmedia_rtcp_xr_rb_header*)
+		 ((pj_int32_t*)rb_hdr + rb_len + 1);
+    }
+
+    /* Receiving RR Time */
+    if (rb_rr_time) {
+	/* Save LRR from NTP timestamp of the RR time block report */
+	sess->rx_lrr = ((pj_ntohl(rb_rr_time->ntp_sec) & 0x0000FFFF) << 16) | 
+		       ((pj_ntohl(rb_rr_time->ntp_frac) >> 16) & 0xFFFF);
+
+	/* Calculate RR arrival time for DLRR */
+	pj_get_timestamp(&sess->rx_lrr_time);
+
+	TRACE_((sess->name, "Rx RTCP SR: ntp_ts=%p", sess->rx_lrr,
+	       (pj_uint32_t)(sess->rx_lrr_time.u64*65536/
+			     sess->rtcp_session->ts_freq.u64)));
+    }
+
+    /* Receiving DLRR */
+    if (rb_dlrr) {
+	pj_uint32_t lrr, now, dlrr;
+	pj_uint64_t eedelay;
+	pjmedia_rtcp_ntp_rec ntp;
+
+	/* LRR is the middle 32bit of NTP. It has 1/65536 second 
+	 * resolution 
+	 */
+	lrr = pj_ntohl(rb_dlrr->item.lrr);
+
+	/* DLRR is delay since LRR, also in 1/65536 resolution */
+	dlrr = pj_ntohl(rb_dlrr->item.dlrr);
+
+	/* Get current time, and convert to 1/65536 resolution */
+	pjmedia_rtcp_get_ntp_time(sess->rtcp_session, &ntp);
+	now = ((ntp.hi & 0xFFFF) << 16) + (ntp.lo >> 16);
+
+	/* End-to-end delay is (now-lrr-dlrr) */
+	eedelay = now - lrr - dlrr;
+
+	/* Convert end to end delay to usec (keeping the calculation in
+         * 64bit space)::
+	 *   sess->ee_delay = (eedelay * 1000) / 65536;
+	 */
+	if (eedelay < 4294) {
+	    eedelay = (eedelay * 1000000) >> 16;
+	} else {
+	    eedelay = (eedelay * 1000) >> 16;
+	    eedelay *= 1000;
+	}
+
+	TRACE_((sess->name, "Rx RTCP XR DLRR: lrr=%p, dlrr=%p (%d:%03dms), "
+			   "now=%p, rtt=%p",
+		lrr, dlrr, dlrr/65536, (dlrr%65536)*1000/65536,
+		now, (pj_uint32_t)eedelay));
+	
+	/* Only save calculation if "now" is greater than lrr, or
+	 * otherwise rtt will be invalid 
+	 */
+	if (now-dlrr >= lrr) {
+	    unsigned rtt = (pj_uint32_t)eedelay;
+	    
+	    /* Check that eedelay value really makes sense. 
+	     * We allow up to 30 seconds RTT!
+	     */
+	    if (eedelay <= 30 * 1000 * 1000UL) {
+		if (sess->stat.rtt.update_cnt == 0)
+		    sess->stat.rtt.min = rtt;
+
+		/* "Normalize" rtt value that is exceptionally high.
+		 * For such values, "normalize" the rtt to be three times
+		 * the average value.
+		 */
+		if (rtt>(sess->stat.rtt.avg*3) && sess->stat.rtt.update_cnt!=0)
+		{
+		    unsigned orig_rtt = rtt;
+		    rtt = sess->stat.rtt.avg*3;
+		    PJ_LOG(5,(sess->name, 
+			      "RTT value %d usec is normalized to %d usec",
+			      orig_rtt, rtt));
+		}
+    	
+		TRACE_((sess->name, "RTCP RTT is set to %d usec", rtt));
+
+		if (rtt < sess->stat.rtt.min && rtt)
+		    sess->stat.rtt.min = rtt;
+		if (rtt > sess->stat.rtt.max)
+		    sess->stat.rtt.max = rtt;
+
+		sess->stat.rtt.avg = 
+		    (sess->stat.rtt.avg * sess->stat.rtt.update_cnt + rtt) / 
+		    (sess->stat.rtt.update_cnt + 1);
+
+		sess->stat.rtt.last = rtt;
+		sess->stat.rtt.update_cnt++;
+	    }
+	} else {
+	    PJ_LOG(5, (sess->name, "Internal RTCP NTP clock skew detected: "
+				   "lrr=%p, now=%p, dlrr=%p (%d:%03dms), "
+				   "diff=%d",
+				   lrr, now, dlrr, dlrr/65536,
+				   (dlrr%65536)*1000/65536,
+				   dlrr-(now-lrr)));
+	}
+    }
+
+    /* Receiving Statistics Summary */
+    if (rb_stats) {
+	pj_uint8_t flags = rb_stats->header.specific;
+
+	pj_bzero(&sess->stat.rx.stat_sum, sizeof(sess->stat.rx.stat_sum));
+
+	/* Range of packets sequence reported in this blocks */
+	sess->stat.rx.stat_sum.begin_seq = pj_ntohs(rb_stats->begin_seq);
+	sess->stat.rx.stat_sum.end_seq   = pj_ntohs(rb_stats->end_seq);
+
+	/* Get flags of valid fields */
+	sess->stat.rx.stat_sum.l = (flags & (1 << 7)) != 0;
+	sess->stat.rx.stat_sum.d = (flags & (1 << 6)) != 0;
+	sess->stat.rx.stat_sum.j = (flags & (1 << 5)) != 0;
+	sess->stat.rx.stat_sum.t = (flags & (3 << 3)) != 0;
+
+	/* Fetch the reports info */
+	if (sess->stat.rx.stat_sum.l) {
+	    sess->stat.rx.stat_sum.lost = pj_ntohl(rb_stats->lost);
+	}
+
+	if (sess->stat.rx.stat_sum.d) {
+	    sess->stat.rx.stat_sum.dup = pj_ntohl(rb_stats->dup);
+	}
+
+	if (sess->stat.rx.stat_sum.j) {
+	    sess->stat.rx.stat_sum.jitter.min = pj_ntohl(rb_stats->jitter_min);
+	    sess->stat.rx.stat_sum.jitter.max = pj_ntohl(rb_stats->jitter_max);
+	    sess->stat.rx.stat_sum.jitter.mean = pj_ntohl(rb_stats->jitter_mean);
+	    sess->stat.rx.stat_sum.jitter.dev = pj_ntohl(rb_stats->jitter_dev);
+	}
+
+	if (sess->stat.rx.stat_sum.t) {
+	    sess->stat.rx.stat_sum.toh.min = rb_stats->toh_min;
+	    sess->stat.rx.stat_sum.toh.max = rb_stats->toh_max;
+	    sess->stat.rx.stat_sum.toh.mean = rb_stats->toh_mean;
+	    sess->stat.rx.stat_sum.toh.dev = rb_stats->toh_dev;
+	}
+    }
+
+    /* Receiving VoIP Metrics */
+    if (rb_voip_mtc) {
+	sess->stat.rx.voip_mtc.loss_rate = rb_voip_mtc->loss_rate;
+	sess->stat.rx.voip_mtc.discard_rate = rb_voip_mtc->discard_rate;
+	sess->stat.rx.voip_mtc.burst_den = rb_voip_mtc->burst_den;
+	sess->stat.rx.voip_mtc.gap_den = rb_voip_mtc->gap_den;
+	sess->stat.rx.voip_mtc.burst_dur = pj_ntohs(rb_voip_mtc->burst_dur);
+	sess->stat.rx.voip_mtc.gap_dur = pj_ntohs(rb_voip_mtc->gap_dur);
+	sess->stat.rx.voip_mtc.rnd_trip_delay = 
+					pj_ntohs(rb_voip_mtc->rnd_trip_delay);
+	sess->stat.rx.voip_mtc.end_sys_delay = 
+					pj_ntohs(rb_voip_mtc->end_sys_delay);
+	sess->stat.rx.voip_mtc.signal_lvl = rb_voip_mtc->signal_lvl;
+	sess->stat.rx.voip_mtc.noise_lvl = rb_voip_mtc->noise_lvl;
+	sess->stat.rx.voip_mtc.rerl = rb_voip_mtc->rerl;
+	sess->stat.rx.voip_mtc.gmin = rb_voip_mtc->gmin;
+	sess->stat.rx.voip_mtc.r_factor = rb_voip_mtc->r_factor;
+	sess->stat.rx.voip_mtc.ext_r_factor = rb_voip_mtc->ext_r_factor;
+	sess->stat.rx.voip_mtc.mos_lq = rb_voip_mtc->mos_lq;
+	sess->stat.rx.voip_mtc.mos_cq = rb_voip_mtc->mos_cq;
+	sess->stat.rx.voip_mtc.rx_config = rb_voip_mtc->rx_config;
+	sess->stat.rx.voip_mtc.jb_nom = pj_ntohs(rb_voip_mtc->jb_nom);
+	sess->stat.rx.voip_mtc.jb_max = pj_ntohs(rb_voip_mtc->jb_max);
+	sess->stat.rx.voip_mtc.jb_abs_max = pj_ntohs(rb_voip_mtc->jb_abs_max);
+    }
+}
+
+/* Place seq into a 32-bit sequence number space based upon a
+ * heuristic for its most likely location.
+ */
+static pj_uint32_t extend_seq(pjmedia_rtcp_xr_session *sess,
+			      const pj_uint16_t seq)
+{
+
+    pj_uint32_t extended_seq, seq_a, seq_b, diff_a, diff_b;
+    if(sess->uninitialized_src_ref_seq) {
+	/* This is the first sequence number received.  Place
+	 * it in the middle of the extended sequence number
+	 * space.
+	 */
+	sess->src_ref_seq = seq | 0x80000000u;
+	sess->uninitialized_src_ref_seq = PJ_FALSE;
+	extended_seq = sess->src_ref_seq;
+    } else {
+	/* Prior sequence numbers have been received.
+	 * Propose two candidates for the extended sequence
+	 * number: seq_a is without wraparound, seq_b with
+	 * wraparound.
+	 */
+	seq_a = seq | (sess->src_ref_seq & 0xFFFF0000u);
+	if(sess->src_ref_seq < seq_a) {
+	    seq_b  = seq_a - 0x00010000u;
+	    diff_a = seq_a - sess->src_ref_seq;
+	    diff_b = sess->src_ref_seq - seq_b;
+	} else {
+	    seq_b  = seq_a + 0x00010000u;
+	    diff_a = sess->src_ref_seq - seq_a;
+	    diff_b = seq_b - sess->src_ref_seq;
+	}
+
+	/* Choose the closer candidate.  If they are equally
+	 * close, the choice is somewhat arbitrary: we choose
+	 * the candidate for which no rollover is necessary.
+	 */
+	if(diff_a < diff_b) {
+	    extended_seq = seq_a;
+	} else {
+	    extended_seq = seq_b;
+	}
+
+	/* Set the reference sequence number to be this most
+	 * recently-received sequence number.
+	 */
+	sess->src_ref_seq = extended_seq;
+    }
+
+    /* Return our best guess for a 32-bit sequence number that
+     * corresponds to the 16-bit number we were given.
+     */
+    return extended_seq;
+}
+
+void pjmedia_rtcp_xr_rx_rtp( pjmedia_rtcp_xr_session *sess,
+			     unsigned seq, 
+			     int lost,
+			     int dup,
+			     int discarded,
+			     int jitter,
+			     int toh, pj_bool_t toh_ipv4)
+{
+    pj_uint32_t ext_seq;
+
+    /* Get 32 bit version of sequence */
+    ext_seq = extend_seq(sess, (pj_uint16_t)seq);
+
+    /* Update statistics summary */
+    sess->stat.tx.stat_sum.count++;
+
+    if (sess->stat.tx.stat_sum.begin_seq == 0 || 
+	sess->stat.tx.stat_sum.begin_seq > ext_seq)
+    {
+	sess->stat.tx.stat_sum.begin_seq = ext_seq;
+    }
+
+    if (sess->stat.tx.stat_sum.end_seq == 0 || 
+	sess->stat.tx.stat_sum.end_seq < ext_seq)
+    {
+	sess->stat.tx.stat_sum.end_seq = ext_seq;
+    }
+
+    if (lost >= 0) {
+	sess->stat.tx.stat_sum.l = PJ_TRUE;
+	if (lost > 0)
+	    sess->stat.tx.stat_sum.lost++;
+    }
+
+    if (dup >= 0) {
+	sess->stat.tx.stat_sum.d = PJ_TRUE;
+	if (dup > 0)
+	    sess->stat.tx.stat_sum.dup++;
+    }
+
+    if (jitter >= 0) {
+	pj_int32_t diff;
+
+	sess->stat.tx.stat_sum.j = PJ_TRUE;
+	if (sess->stat.tx.stat_sum.jitter.min > (pj_uint32_t)jitter)
+	    sess->stat.tx.stat_sum.jitter.min = jitter;
+	if (sess->stat.tx.stat_sum.jitter.max < (pj_uint32_t)jitter)
+	    sess->stat.tx.stat_sum.jitter.max = jitter;
+	sess->stat.tx.stat_sum.jitter.mean = 
+	    (jitter + sess->stat.tx.stat_sum.jitter.mean * 
+	     sess->stat.tx.stat_sum.jitter.count) /
+	    (sess->stat.tx.stat_sum.jitter.count + 1);
+
+	diff = sess->stat.tx.stat_sum.jitter.mean - jitter;
+	sess->stat.tx.stat_sum.jitter.dev =
+	    (diff * diff + sess->stat.tx.stat_sum.jitter.dev * 
+	     sess->stat.tx.stat_sum.jitter.count) /
+	    (sess->stat.tx.stat_sum.jitter.count + 1);
+
+	++sess->stat.tx.stat_sum.jitter.count;
+    }
+
+    if (toh >= 0) {
+	pj_int32_t diff;
+
+	sess->stat.tx.stat_sum.t = toh_ipv4? 1 : 2;
+
+	if (sess->stat.tx.stat_sum.toh.min > (pj_uint32_t)toh)
+	    sess->stat.tx.stat_sum.toh.min = toh;
+	if (sess->stat.tx.stat_sum.toh.max < (pj_uint32_t)toh)
+	    sess->stat.tx.stat_sum.toh.max = toh;
+	sess->stat.tx.stat_sum.toh.mean = 
+	    (toh + sess->stat.tx.stat_sum.toh.mean * 
+	     sess->stat.tx.stat_sum.toh.count) /
+	    (sess->stat.tx.stat_sum.toh.count + 1);
+
+	diff = sess->stat.tx.stat_sum.toh.mean - toh;
+	sess->stat.tx.stat_sum.toh.dev =
+	    (diff * diff + sess->stat.tx.stat_sum.toh.dev * 
+	     sess->stat.tx.stat_sum.toh.count) /
+	    (sess->stat.tx.stat_sum.toh.count + 1);
+
+	++sess->stat.tx.stat_sum.toh.count;
+    }
+
+    /* Update burst metrics.
+     * There are two terms introduced in the RFC 3611: gap & burst.
+     * Gap represents good stream condition, lost+discard rate <= 1/Gmin.
+     * Burst represents the opposite, lost+discard rate > 1/Gmin.
+     */
+    if (lost >= 0 && discarded >= 0) {
+	if(lost > 0) {
+	    sess->voip_mtc_stat.loss_count++;
+	}
+	if(discarded > 0) {
+	    sess->voip_mtc_stat.discard_count++;
+	}
+	if(!lost && !discarded) {
+	    /* Number of good packets since last lost/discarded */
+	    sess->voip_mtc_stat.pkt++;
+	}
+	else {
+	    if(sess->voip_mtc_stat.pkt >= sess->stat.tx.voip_mtc.gmin) {
+		/* Gap condition */
+		if(sess->voip_mtc_stat.lost == 1) {
+		    /* Gap -> Gap */
+		    sess->voip_mtc_stat.c14++;
+		}
+		else {
+		    /* Burst -> Gap */
+		    sess->voip_mtc_stat.c13++;
+		}
+		sess->voip_mtc_stat.lost = 1;
+		sess->voip_mtc_stat.c11 += sess->voip_mtc_stat.pkt;
+	    }
+	    else {
+		/* Burst condition */
+		sess->voip_mtc_stat.lost++;
+		if(sess->voip_mtc_stat.pkt == 0) {
+		    /* Consecutive losts */
+		    sess->voip_mtc_stat.c33++;
+		}
+		else {
+		    /* Any good packets, but still bursting */
+		    sess->voip_mtc_stat.c23++;
+		    sess->voip_mtc_stat.c22 += (sess->voip_mtc_stat.pkt - 1);
+		}
+	    }
+
+	    sess->voip_mtc_stat.pkt = 0;
+	}
+    }
+}
+
+void pjmedia_rtcp_xr_tx_rtp( pjmedia_rtcp_xr_session *session, 
+			     unsigned ptsize )
+{
+    PJ_UNUSED_ARG(session);
+    PJ_UNUSED_ARG(ptsize);
+}
+
+PJ_DEF(pj_status_t) pjmedia_rtcp_xr_update_info( 
+					 pjmedia_rtcp_xr_session *sess,
+					 unsigned info,
+					 pj_int32_t val)
+{
+    int v = val;
+
+    switch(info) {
+	case PJMEDIA_RTCP_XR_INFO_SIGNAL_LVL:
+	    sess->stat.tx.voip_mtc.signal_lvl = (pj_uint8_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_NOISE_LVL:
+	    sess->stat.tx.voip_mtc.noise_lvl = (pj_uint8_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_RERL:
+	    sess->stat.tx.voip_mtc.rerl = (pj_uint8_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_R_FACTOR:
+	    sess->stat.tx.voip_mtc.ext_r_factor = (pj_uint8_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_MOS_LQ:
+	    sess->stat.tx.voip_mtc.mos_lq = (pj_uint8_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_MOS_CQ:
+	    sess->stat.tx.voip_mtc.mos_cq = (pj_uint8_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_CONF_PLC:
+	    if (v >= 0 && v <= 3) {
+		sess->stat.tx.voip_mtc.rx_config &= 0x3F;
+		sess->stat.tx.voip_mtc.rx_config |= (pj_uint8_t) (v << 6);
+	    }
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_CONF_JBA:
+	    if (v >= 0 && v <= 3) {
+		sess->stat.tx.voip_mtc.rx_config &= 0xCF;
+		sess->stat.tx.voip_mtc.rx_config |= (pj_uint8_t) (v << 4);
+	    }
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_CONF_JBR:
+	    if (v >= 0 && v <= 15) {
+		sess->stat.tx.voip_mtc.rx_config &= 0xF0;
+		sess->stat.tx.voip_mtc.rx_config |= (pj_uint8_t) v;
+	    }
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_JB_NOM:
+	    sess->stat.tx.voip_mtc.jb_nom = (pj_uint16_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_JB_MAX:
+	    sess->stat.tx.voip_mtc.jb_max = (pj_uint16_t) v;
+	    break;
+
+	case PJMEDIA_RTCP_XR_INFO_JB_ABS_MAX:
+	    sess->stat.tx.voip_mtc.jb_abs_max = (pj_uint16_t) v;
+	    break;
+
+	default:
+	    return PJ_EINVAL;
+    }
+
+    return PJ_SUCCESS;
+}
+
+#endif
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c
index 5045c05..6673b83 100644
--- a/pjmedia/src/pjmedia/stream.c
+++ b/pjmedia/src/pjmedia/stream.c
@@ -470,9 +470,35 @@
 	(*stream->transport->op->send_rtcp)(stream->transport, 
 					    rtcp_pkt, len);
 
+#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
+	/* Temporarily always send RTCP XR after RTCP */
+	if (stream->rtcp.xr_enabled)
+	{
+	    int i;
+	    pjmedia_jb_state jb_state;
+
+	    pjmedia_jbuf_get_state(stream->jb, &jb_state);
+	    
+	    i = jb_state.size * stream->codec_param.info.frm_ptime;
+	    pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session, 
+					PJMEDIA_RTCP_XR_INFO_JB_NOM,
+					i);
+
+	    i = jb_state.max_size* stream->codec_param.info.frm_ptime;
+	    pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session, 
+					PJMEDIA_RTCP_XR_INFO_JB_MAX,
+					i);
+
+	    pjmedia_rtcp_build_rtcp_xr(&stream->rtcp.xr_session, 0, 
+				       &rtcp_pkt, &len);
+
+	    (*stream->transport->op->send_rtcp)(stream->transport, 
+						rtcp_pkt, len);
+	}
+#endif
+
 	stream->rtcp_last_tx = timestamp;
     }
-
 }
 
 
@@ -974,7 +1000,7 @@
     unsigned payloadlen;
     pjmedia_rtp_status seq_st;
     pj_status_t status;
-
+    pj_bool_t pkt_discarded = PJ_FALSE;
 
     /* Check for errors */
     if (bytes_read < 0) {
@@ -995,14 +1021,9 @@
 	return;
     }
 
-
-    /* Inform RTCP session */
-    pjmedia_rtcp_rx_rtp(&stream->rtcp, pj_ntohs(hdr->seq),
-			pj_ntohl(hdr->ts), payloadlen);
-
     /* Ignore the packet if decoder is paused */
     if (channel->paused)
-	return;
+	goto on_return;
 
     /* Update RTP session (also checks if RTP session can accept
      * the incoming packet.
@@ -1025,15 +1046,28 @@
 		      "Bad RTP pt %d (expecting %d)",
 		      hdr->pt, channel->rtp.out_pt));
 	}
+
+	if (seq_st.status.flag.badssrc) {
+	    PJ_LOG(4,(stream->port.info.name.ptr,
+		      "Changed RTP peer SSRC %d (previously %d)",
+		      channel->rtp.peer_ssrc, stream->rtcp.peer_ssrc));
+	    stream->rtcp.peer_ssrc = channel->rtp.peer_ssrc;
+	}
+
+
     }
 
     /* Skip bad RTP packet */
-    if (seq_st.status.flag.bad)
-	return;
+    if (seq_st.status.flag.bad) {
+	pkt_discarded = PJ_TRUE;
+	goto on_return;
+    }
 
     /* Ignore if payloadlen is zero */
-    if (payloadlen == 0)
-        return;
+    if (payloadlen == 0) {
+	pkt_discarded = PJ_TRUE;
+	goto on_return;
+    }
 
     /* Handle incoming DTMF. */
     if (hdr->pt == stream->rx_event_pt) {
@@ -1041,11 +1075,11 @@
 	 * digit. Also ignore duplicate packet as it serves no use.
 	 */
 	if (seq_st.status.flag.outorder || seq_st.status.flag.dup) {
-	    return;
+	    goto on_return;
 	}
 
 	handle_incoming_dtmf(stream, payload, payloadlen);
-	return;
+	goto on_return;
     }
 
     /* Put "good" packet to jitter buffer, or reset the jitter buffer
@@ -1151,11 +1185,13 @@
 	/* Put each frame to jitter buffer. */
 	for (i=0; i<count; ++i) {
 	    unsigned ext_seq;
+	    pj_bool_t discarded;
 
 	    ext_seq = (unsigned)(frames[i].timestamp.u64 / ts_span);
-	    pjmedia_jbuf_put_frame(stream->jb, frames[i].buf, 
-				   frames[i].size, ext_seq);
-
+	    pjmedia_jbuf_put_frame2(stream->jb, frames[i].buf, frames[i].size,
+				    ext_seq, &discarded);
+	    if (discarded)
+		pkt_discarded = PJ_TRUE;
 	}
     }
     pj_mutex_unlock( stream->jb_mutex );
@@ -1172,8 +1208,17 @@
     if (status != 0) {
 	LOGERR_((stream->port.info.name.ptr, "Jitter buffer put() error", 
 		status));
-	return;
+	pkt_discarded = PJ_TRUE;
+	goto on_return;
     }
+
+on_return:
+    /* Update RTCP session */
+    if (stream->rtcp.peer_ssrc == 0)
+	stream->rtcp.peer_ssrc = channel->rtp.peer_ssrc;
+
+    pjmedia_rtcp_rx_rtp2(&stream->rtcp, pj_ntohs(hdr->seq),
+			 pj_ntohl(hdr->ts), payloadlen, pkt_discarded);
 }
 
 
@@ -1512,11 +1557,50 @@
 
     stream->transport = tp;
 
+#if PJMEDIA_HAS_RTCP_XR && PJMEDIA_STREAM_ENABLE_XR
+    /* Enable RTCP XR and update some settings */
+    {
+	int i;
+	pjmedia_rtcp_enable_xr(&stream->rtcp, PJ_TRUE);
+
+	/* jitter buffer adaptive info */
+	i = PJMEDIA_RTCP_XR_JB_ADAPTIVE;
+	pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session, 
+				    PJMEDIA_RTCP_XR_INFO_CONF_JBA,
+				    i);
+
+	/* Jitter buffer aggressiveness info (estimated) */
+	i = 7;
+	pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session, 
+				    PJMEDIA_RTCP_XR_INFO_CONF_JBR,
+				    i);
+
+	/* Jitter buffer absolute maximum delay */
+	i = jb_max * stream->codec_param.info.frm_ptime;
+	pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session, 
+				    PJMEDIA_RTCP_XR_INFO_JB_ABS_MAX,
+				    i);
+
+	/* PLC info */
+	if (stream->codec_param.setting.plc == 0)
+	    i = PJMEDIA_RTCP_XR_PLC_DIS;
+	else
+#if PJMEDIA_WSOLA_IMP==PJMEDIA_WSOLA_IMP_WSOLA
+	    i = PJMEDIA_RTCP_XR_PLC_ENH;
+#else
+	    i = PJMEDIA_RTCP_XR_PLC_DIS;
+#endif
+	pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session, 
+				    PJMEDIA_RTCP_XR_INFO_CONF_PLC,
+				    i);
+    }
+#endif
 
     /* Success! */
     *p_stream = stream;
 
     PJ_LOG(5,(THIS_FILE, "Stream %s created", stream->port.info.name.ptr));
+
     return PJ_SUCCESS;