#ifndef MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_
#define MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
namespace media {
namespace cast {
class CongestionControl {
public:
CongestionControl(base::TickClock* clock,
float congestion_control_back_off,
uint32 max_bitrate_configured,
uint32 min_bitrate_configured,
uint32 start_bitrate);
virtual ~CongestionControl();
bool OnAck(base::TimeDelta rtt_ms, uint32* new_bitrate);
bool OnNack(base::TimeDelta rtt_ms, uint32* new_bitrate);
private:
base::TickClock* const clock_;
const float congestion_control_back_off_;
const uint32 max_bitrate_configured_;
const uint32 min_bitrate_configured_;
uint32 bitrate_;
base::TimeTicks time_last_increase_;
base::TimeTicks time_last_decrease_;
DISALLOW_COPY_AND_ASSIGN(CongestionControl);
};
}
}
#endif