Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNTFRCSend.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 00025 #ifndef MN_TFRCSEND_H 00026 #define MN_TFRCSEND_H 00027 00028 #include <sys/types.h> 00029 #include "var_type.h" 00030 #include "MNRTPNetTypes.h" 00031 #include "MNTimeval.h" 00032 #include "MNTimerCall.h" 00033 #include "lcrtp/MNLCRTPdefs.h" 00034 00035 #define M_INITRTT 0 /* different modes of operation */ 00036 #define M_SLOWSTART 1 00037 #define M_NORMAL 2 00038 #define M_NO_INCREASE 3 /* only in receiver */ 00039 00040 00041 class MNTFRCSend 00042 { 00043 u_int32 _packets_sent; 00044 u_int32 _reports_recv; 00045 u_int32 _rtt_cur; 00046 u_int32 _round; 00047 int64 _start; 00048 int64 _end; 00049 int64 _rep_ts; 00050 int64 _adj_ts; 00051 int64 _delay; 00052 int64 _delay_diff; 00053 double _rtt; 00054 double _sqrt_rtt; 00055 double _b_rep; 00056 double _b_act; 00057 double _b_exp; 00058 double _min_bitrate; 00059 double _max_bitrate; 00060 double _max_increase; 00061 double _rate_delta; 00062 int _mode; 00063 int _force_n_mode; 00064 int _cbr; 00065 bool _nready; 00066 bool _first; 00067 Timeval _start_time; 00068 Timeval _old_time; 00069 MNTimer _timer; 00070 MNMutex _timer_mutex; 00071 00076 MNDebugMutex _lock; 00077 00078 TimerCall<MNTFRCSend> _cb; 00079 // stuff is only needed to do some meassurements - MZ 00080 static int _counter; 00081 int _local_counter; 00082 public: 00083 MNTFRCSend( MNSelector& sel ); 00084 virtual ~MNTFRCSend( ); 00085 00086 int init(double minb, double maxb); 00087 u_int32 tfrc_prep( rtp_hdr_ext_tfrc* packet, 00088 Timeval& next_playtime_packet ); 00089 void feedback_received( LCfeedb_tfrc_t* rep ); 00090 private: 00091 void update_mode( u_int32 b_exp ); 00092 void update_bexp( u_int32 b_exp ); 00093 void set_timeout( ); 00094 void init_time( ); 00095 00096 00097 void prepare_packet(rtp_hdr_ext_tfrc* packet); 00098 void prepare_packet(MNRope*& packet); 00099 void not_sent( ); 00100 void set_cbr( int cbr ); 00101 void wait(); 00102 int get_cbr( ); 00103 int64 get_time(); 00104 00109 inline int64 get_time( int64 buffered_get_time ) const { 00110 return buffered_get_time; 00111 } 00112 00114 virtual void timer_callback ( void* ref_data, TimerCallBase* ptr ); 00115 }; 00116 00117 #endif /* MN_TFRCSEND_H */

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8