blob: 72c1023044cbcfb703d5896d694313b209f3efbb [file] [log] [blame]
tschumim9d117642017-07-17 01:41:41 -07001/*
2 * Copyright (c) 2017 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_CONGESTION_CONTROLLER_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
12#define MODULES_CONGESTION_CONTROLLER_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
tschumim9d117642017-07-17 01:41:41 -070013
14#include <memory>
15#include <vector>
16
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "api/optional.h"
18#include "modules/congestion_controller/bitrate_estimator.h"
tschumim9d117642017-07-17 01:41:41 -070019
20namespace webrtc {
21
22struct PacketFeedback;
23
24class AcknowledgedBitrateEstimator {
25 public:
26 explicit AcknowledgedBitrateEstimator(
27 std::unique_ptr<BitrateEstimator> bitrate_estimator);
28
29 AcknowledgedBitrateEstimator();
30
31 void IncomingPacketFeedbackVector(
32 const std::vector<PacketFeedback>& packet_feedback_vector);
33 rtc::Optional<uint32_t> bitrate_bps() const;
34 void SetAlrEndedTimeMs(int64_t alr_ended_time_ms);
35
36 private:
37 void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms);
38 rtc::Optional<int64_t> alr_ended_time_ms_;
39 std::unique_ptr<BitrateEstimator> bitrate_estimator_;
40};
41
42} // namespace webrtc
43
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020044#endif // MODULES_CONGESTION_CONTROLLER_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_