MNTFRCRecv.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#ifndef MN_TFRCRECV_H
00026
#define MN_TFRCRECV_H
00027
00028
#include <sys/types.h>
00029
#include "var_type.h"
00030
#include "MNTimeval.h"
00031
#include "MNRTPPacket.h"
00032
#include "lcrtp/MNLCRTPdefs.h"
00033
00034
#define HIST_SIZE 100000
00035
#define MAX_WEIGHTS 32
00036
00037
00038 class MNTFRCRecv
00039 {
00040
protected:
00041 int _ppl_cur;
00042 int _ppl_hist[HIST_SIZE];
00043 int _ts_hist[HIST_SIZE];
00044 int _seq_hist[HIST_SIZE];
00045 int _ppl[MAX_WEIGHTS + 1];
00046 int _num_loss;
00047 int _weights;
00048 int _const_weights;
00049 int _data_per_report;
00050 u_int32 _round;
00051 u_int32 _mode;
00052 int32 _mseq_offs,
_high_offs;
00053 int32 _ppl_start,
_ppl_end;
00054 int64 _last_report;
00055 float _weight[MAX_WEIGHTS];
00056 float _new_mult;
00057 double _rtt_ema;
00058 Timeval _start_time;
00059 Timeval _old_time;
00060 bool _first;
00061 MNMutex _timer_mutex;
00062
00063
00064
00065
public:
00066
MNTFRCRecv( );
00067
virtual ~MNTFRCRecv( );
00068
00069
bool packet_received(
tfrc_payload* packet,
u_int16 seqnum,
u_int32 ts,
00070 size_t length,
LCfeedb_tfrc_t* reply );
00071
private:
00072
void init();
00073
void init_time( );
00074
void set_weights();
00075
void log_loss(
int64 arrival);
00076
void fake_history(
int ppl_est);
00077
double bitrate_eq(
double l,
double rtt,
double t0);
00078
double lossfraction_eq(
double bitrate,
double rtt,
double t0);
00079
double lossfraction( );
00080
int update_history(
u_int32 mseq,
int64 arrival,
double rtt,
double tzero,
double b_act);
00081
int64 get_time();
00082 };
00083
00084
#endif
Generated on Sun Mar 6 13:35:49 2005 for Komssys by
1.3.8