rtt_tracker.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef MODULES_CONGESTION_CONTROLLER_PCC_RTT_TRACKER_H_
  11. #define MODULES_CONGESTION_CONTROLLER_PCC_RTT_TRACKER_H_
  12. #include <vector>
  13. #include "api/transport/network_types.h"
  14. #include "api/units/time_delta.h"
  15. #include "api/units/timestamp.h"
  16. namespace webrtc {
  17. namespace pcc {
  18. class RttTracker {
  19. public:
  20. RttTracker(TimeDelta initial_rtt, double alpha);
  21. // Updates RTT estimate.
  22. void OnPacketsFeedback(const std::vector<PacketResult>& packet_feedbacks,
  23. Timestamp feedback_received_time);
  24. TimeDelta GetRtt() const;
  25. private:
  26. TimeDelta rtt_estimate_;
  27. double alpha_;
  28. };
  29. } // namespace pcc
  30. } // namespace webrtc
  31. #endif // MODULES_CONGESTION_CONTROLLER_PCC_RTT_TRACKER_H_