1 /* 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 16 #include "api/transport/network_types.h" 17 #include "api/units/time_delta.h" 18 #include "api/units/timestamp.h" 19 20 namespace webrtc { 21 namespace pcc { 22 23 class 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_ 40