blob: 94033cd511cd59ad3ffb52496148970744607f2c [file] [log] [blame]
Anastasia Koloskovaac50c6a2018-08-21 14:11:501/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef MODULES_CONGESTION_CONTROLLER_PCC_RTT_TRACKER_H_
12#define MODULES_CONGESTION_CONTROLLER_PCC_RTT_TRACKER_H_
13
14#include <vector>
15
Anastasia Koloskovaac50c6a2018-08-21 14:11:5016#include "api/transport/network_types.h"
Yves Gerey3e707812018-11-28 15:47:4917#include "api/units/time_delta.h"
18#include "api/units/timestamp.h"
Anastasia Koloskovaac50c6a2018-08-21 14:11:5019
20namespace webrtc {
21namespace pcc {
22
23class RttTracker {
24 public:
25 RttTracker(TimeDelta initial_rtt, double alpha);
26 // Updates RTT estimate.
27 void OnPacketsFeedback(const std::vector<PacketResult>& packet_feedbacks,
28 Timestamp feedback_received_time);
29 TimeDelta GetRtt() const;
30
31 private:
32 TimeDelta rtt_estimate_;
33 double alpha_;
34};
35
36} // namespace pcc
37} // namespace webrtc
38
39#endif // MODULES_CONGESTION_CONTROLLER_PCC_RTT_TRACKER_H_