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

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed Aug 6 15:06:48 BST 2008


Author: soohyunc
Date: Wed Aug  6 15:06:47 2008
New Revision: 4242

Added:
   vic/branches/cc/cc/tfwc_rcvr.cpp   (contents, props changed)
   vic/branches/cc/cc/tfwc_rcvr.h   (contents, props changed)
Modified:
   vic/branches/cc/Makefile.in
   vic/branches/cc/cc/tfwc_sndr.cpp
   vic/branches/cc/rtp/session.cpp
   vic/branches/cc/rtp/session.h

Log:
o  added TfwcRcvr class (currently empty)
   (you will need to re-configure)
o  took out ackvec stuffs from rtp/session.cpp and trying to put it at TfwcRcvr


Modified: vic/branches/cc/Makefile.in
==============================================================================
--- vic/branches/cc/Makefile.in	(original)
+++ vic/branches/cc/Makefile.in	Wed Aug  6 15:06:47 2008
@@ -152,7 +152,7 @@
 	render/color-gray.o render/color-mono.o render/color-hist.o \
 	render/rgb-converter.o render/vw.o render/ppm.o \
 	@V_OBJ@ \
-	cc/tfwc_sndr.o
+	cc/tfwc_sndr.o cc/tfwc_rcvr.o
 
 
 OBJ3 =	cm0.o cm1.o huffcode.o version.o bv.o codec/pvh-huff.o \

Added: vic/branches/cc/cc/tfwc_rcvr.cpp
==============================================================================
--- (empty file)
+++ vic/branches/cc/cc/tfwc_rcvr.cpp	Wed Aug  6 15:06:47 2008
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008 University College London
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *  This product includes software developed by the MASH Research
+ *  Group at the University of California Berkeley.
+ * 4. Neither the name of the University nor of the Research Group may be
+ *    used to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#include "assert.h"
+#include "config.h"
+#include "timer.h"
+#include "rtp.h"
+#include "inet.h"
+#include "pktbuf-rtp.h"
+#include "vic_tcl.h"
+#include "module.h"
+#include "transmitter.h"
+#include "tfwc_rcvr.h"
+
+TfwcRcvr::TfwcRcvr() :
+	seqno_(0) 
+{}
+

Added: vic/branches/cc/cc/tfwc_rcvr.h
==============================================================================
--- (empty file)
+++ vic/branches/cc/cc/tfwc_rcvr.h	Wed Aug  6 15:06:47 2008
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2008 University College London
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *  This product includes software developed by the MASH Research
+ *  Group at the University of California Berkeley.
+ * 4. Neither the name of the University nor of the Research Group may be
+ *    used to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#ifndef vic_tfwc_rcvr_h
+#define vic_tfwc_rcvr_h
+
+#include "tfwc_sndr.h"
+
+// set AckVec bitmap
+#define SET_BIT_VEC(ackvec_, bit) (ackvec_ = ((ackvec_ << 1) | bit))
+
+// see AckVec bitmap
+#define SEE_BIT_VEC(ackvec_, ix, seqno) ((1 << (seqno - ix)) & ackvec_)
+
+class TfwcRcvr {
+public:
+	TfwcRcvr();
+
+protected:
+	u_int16_t seqno_;
+private:
+};
+
+#endif

Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp	(original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp	Wed Aug  6 15:06:47 2008
@@ -45,7 +45,7 @@
 #include "tfwc_sndr.h"
 
 TfwcSndr::TfwcSndr() :
-	seqno_(-1) 
+	seqno_(0) 
 {}
 
 void TfwcSndr::tfwc_sndr_parse_buf(pktbuf* pb) {

Modified: vic/branches/cc/rtp/session.cpp
==============================================================================
--- vic/branches/cc/rtp/session.cpp	(original)
+++ vic/branches/cc/rtp/session.cpp	Wed Aug  6 15:06:47 2008
@@ -597,8 +597,6 @@
 /*
 * Send an RTPv2 report packet.
 */
-//void SessionManager::send_report(int bye)
-
 void SessionManager::send_report(CtrlHandler* ch, int bye, int app)
 {
 	UNUSED(app); //SV-XXX: unused
@@ -636,17 +634,18 @@
 		sr->sr_np = htonl(sl.np());
 		sr->sr_nb = htonl(sl.nb());
 		rr = (rtcp_rr*)(sr + 1);
-		//xr = (rtcp_xr*)(rr + 1);	// extended report
 	} else {
 		flags |= RTCP_PT_RR;
 		rr = (rtcp_rr*)(rh + 1);
-		//xr = (rtcp_xr*)(rr + 1);	// extended report
 	}
 
 	// if CC is turned on, we need XR report
 	if (is_cc_on()) {
-		flags |= RTCP_PT_XR;
+		flags |= RTCP_PT_XR;		// setting flags to XR
 		xr = (rtcp_xr*)(rh + 1);	// extended report
+		xr->xr_begin_seq = lastseq_;// this will be used for ackofack
+		xr->xr_end_seq = seqno_ + 1;
+		xr->xr_ackvec = ackvec_;	// ackvec
 	}
 
 	int nrr = 0;
@@ -776,7 +775,7 @@
 }
 
 /*
- * receive an RTP packet
+ * receive an RTP data packet
  */
 void SessionManager::recv(DataHandler* dh)
 {
@@ -809,7 +808,7 @@
 			return;
 		}
 	} // now, loopback packets ignored (if disabled) 
-
+/*
 	// set bit vector
 	for (int i = lastseq_+1; i <= seqno_; i++) {
 			SET_BIT_VEC (ackvec_, 1);
@@ -824,7 +823,7 @@
 	}
 	printf("\n");
 	lastseq_ = seqno_;
-
+*/
 	int version = pb->data[0] >> 6;
 	//int version = *(u_char*)rh >> 6;
 	if (version != 2) {

Modified: vic/branches/cc/rtp/session.h
==============================================================================
--- vic/branches/cc/rtp/session.h	(original)
+++ vic/branches/cc/rtp/session.h	Wed Aug  6 15:06:47 2008
@@ -110,10 +110,10 @@
 };
 
 // set AckVec bitmap
-#define SET_BIT_VEC(ackvec_, bit) (ackvec_ = ((ackvec_ << 1) | bit))
+//#define SET_BIT_VEC(ackvec_, bit) (ackvec_ = ((ackvec_ << 1) | bit))
 
 // see AckVec bitmap
-#define SEE_BIT_VEC(ackvec_, ix, seqno) ((1 << (seqno - ix)) & ackvec_)
+//#define SEE_BIT_VEC(ackvec_, ix, seqno) ((1 << (seqno - ix)) & ackvec_)
 
 class SessionManager : public Transmitter, public MtuAlloc {
 public:



More information about the Sumover-dev mailing list