[Sumover-dev] [svn commit] r4258 - in vic/branches/cc: rtp

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Sat Aug 9 22:07:32 BST 2008


Author: soohyunc
Date: Sat Aug  9 22:07:30 2008
New Revision: 4258

Modified:
   vic/branches/cc/cc/tfwc_sndr.h
   vic/branches/cc/rtp/session.cpp
   vic/branches/cc/rtp/session.h

Log:

o  bug fixed: previously, the XR block type was not set correctly. 
o  inserted SSRC field into the XR report format (although it is not currently
   used anywhere.) 
o  XR block length is set to 3 (fixed value). But, according to RFC 3611, this 
   block length can vary. we can make this number elastic later. i.e., it is set
   to fixed value temporarily.

o  Todo: I found a problem when passing an RTP packet sequence number(s) from
Transmitter -> TfwcSndr -> SessionManager. TfwcSndr can parse the RTP data
packet sequence number(s) correctly, but there is a problem to hand this number
to SessionManager (rtp/session.ccpp). It is shown as the below (printouts on
console).

.  
.  
.  
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		24
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		24
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		25
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		25
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		26
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		26
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		27
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		27
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		28
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		29
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		30
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		31
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		32
[pid/28584 +63 cc/tfwc_sndr.cpp] sent seqno:		33
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		33
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		33
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		33
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		33
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		33
[pid/28584 +693 rtp/session.cpp] 	SeqNo:		33 
.  
.  
.

As we can see, when multiple packets are handed to TfwcSndr, it cannot give the
sequence numbers to SessionManager (rtp/session.cpp) correctly (but just
repeating the lastest sequence number).  We need to look into the problem in
more detail.



Modified: vic/branches/cc/cc/tfwc_sndr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.h	(original)
+++ vic/branches/cc/cc/tfwc_sndr.h	Sat Aug  9 22:07:30 2008
@@ -49,7 +49,7 @@
 		::gettimeofday(&tv, 0);
 		return ((u_int32_t) tv.tv_sec + tv.tv_usec);
 	}
-	inline u_int32_t tfwc_sndr_get_ts() { return ts_; }
+	inline u_int32_t tfwc_sndr_get_ts() { return tfwc_sndr_now(); }
 	void ackofack();	// set ack of ack
 	u_int16_t seqno_;	// packet sequence number
 

Modified: vic/branches/cc/rtp/session.cpp
==============================================================================
--- vic/branches/cc/rtp/session.cpp	(original)
+++ vic/branches/cc/rtp/session.cpp	Sat Aug  9 22:07:30 2008
@@ -648,8 +648,8 @@
 
 	int we_sent = 0;
 	rtcp_rr* rr;
-	rtcp_xr_hdr* xrh;   // extended report header
-	rtcp_xr_blk* xrb;   // extended report block
+	rtcp_xr_hdr* xrh = NULL;   // extended report header
+	rtcp_xr_blk* xrb = NULL;   // extended report block
 	Tcl& tcl = Tcl::instance();
 
 	MediaTimer* mt = MediaTimer::instance();
@@ -674,19 +674,33 @@
 	flags |= RTCP_PT_XR;
 	// access XR header 
 	xrh = (rtcp_xr_hdr*)(rh + 1);
-	// XR block length
-	int xrlen = (xrh->xr_flags << 16) >> 16;
-	xrb = (rtcp_xr_blk*)(xrh + xrlen + 1);
 
-	// this chunk is used for giving seqno and ackofack
-	if(xrh->xr_flags & (bt << 28) == XR_BT_1) {
+	int xrlen = 0x0003;	// XR packet length
+	int xr_ssrc = 0;	// SSRC of source (currently unused)
+
+	// this block is used for giving seqno and ackofack
+	if((bt << 24) == XR_BT_1) {
+		// set XR block flags (block type and length)
+		xrh->xr_flags |= XR_BT_1;	// block type
+		xrh->xr_flags |= xrlen; // block length
+
+		xrb = (rtcp_xr_blk*)(xrh + xrlen + 1);
+		xrb->ssrc = xr_ssrc;	// UNUSED
 		xrb->end_seq = htons(tfwc_sndr_get_seqno());
 		xrb->begin_seq = htons(tfwc_sndr_get_aoa());
 		xrb->chunk = NULL;
+
+		debug_msg("	SeqNo:		%d\n", tfwc_sndr_get_seqno());
 	} 
 	
-	// this chunk is used for giving timestamp
-	if(xrh->xr_flags & (bt << 28) == XR_BT_3) {
+	// this block is used for giving timestamp
+	if((bt << 24) == XR_BT_3) {
+		// set XR block flags (block type and length)
+		xrh->xr_flags |= XR_BT_3;	// block type
+		xrh->xr_flags |= xrlen; // block length
+
+		xrb = (rtcp_xr_blk*)(xrh + xrlen + 1);
+		xrb->ssrc = xr_ssrc;	// UNUSED
 		xrb->chunk = (u_int32_t *) htonl(tfwc_sndr_get_ts());
 	}
 

Modified: vic/branches/cc/rtp/session.h
==============================================================================
--- vic/branches/cc/rtp/session.h	(original)
+++ vic/branches/cc/rtp/session.h	Sat Aug  9 22:07:30 2008
@@ -202,7 +202,6 @@
 	u_char* pktbuf_;
 
 	SourceManager *sm_;
-	TfwcRcvr *tfwc_rcvr_;
 
 	// RTP packet sequence number (for the use of AckVec)
 	u_int16_t seqno_;		// RTP packet sequence number



More information about the Sumover-dev mailing list