blob: faa6b4840f51cde637b3ebbe2bfe6910605154c8 [file] [log] [blame]
Sebastian Jansson6bcd7f62018-02-27 17:07:02 +01001/*
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
Sebastian Janssonfc7ec8e2018-02-28 16:48:00 +010011#ifndef MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
12#define MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
Sebastian Jansson6bcd7f62018-02-27 17:07:02 +010013
14#include <memory>
15#include <vector>
16
Danil Chapovalov0040b662018-06-18 10:48:16 +020017#include "absl/types/optional.h"
Sebastian Janssonfc7ec8e2018-02-28 16:48:00 +010018#include "modules/congestion_controller/goog_cc/bitrate_estimator.h"
Sebastian Jansson6bcd7f62018-02-27 17:07:02 +010019
20namespace webrtc {
21
22struct PacketFeedback;
23
24class AcknowledgedBitrateEstimator {
25 public:
26 explicit AcknowledgedBitrateEstimator(
27 std::unique_ptr<BitrateEstimator> bitrate_estimator);
28
29 AcknowledgedBitrateEstimator();
30 ~AcknowledgedBitrateEstimator();
31
32 void IncomingPacketFeedbackVector(
33 const std::vector<PacketFeedback>& packet_feedback_vector);
Danil Chapovalov0040b662018-06-18 10:48:16 +020034 absl::optional<uint32_t> bitrate_bps() const;
Sebastian Jansson6bcd7f62018-02-27 17:07:02 +010035 void SetAlrEndedTimeMs(int64_t alr_ended_time_ms);
36
37 private:
38 void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms);
Danil Chapovalov0040b662018-06-18 10:48:16 +020039 absl::optional<int64_t> alr_ended_time_ms_;
Sebastian Jansson6bcd7f62018-02-27 17:07:02 +010040 std::unique_ptr<BitrateEstimator> bitrate_estimator_;
41};
42
Sebastian Jansson6bcd7f62018-02-27 17:07:02 +010043} // namespace webrtc
44
Sebastian Janssonfc7ec8e2018-02-28 16:48:00 +010045#endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_