Sebastian Jansson | 6bcd7f6 | 2018-02-27 17:07:02 +0100 | [diff] [blame] | 1 | /* |
| 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 Jansson | fc7ec8e | 2018-02-28 16:48:00 +0100 | [diff] [blame] | 11 | #ifndef MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_ |
| 12 | #define MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_ |
Sebastian Jansson | 6bcd7f6 | 2018-02-27 17:07:02 +0100 | [diff] [blame] | 13 | |
| 14 | #include <memory> |
| 15 | #include <vector> |
| 16 | |
Danil Chapovalov | 0040b66 | 2018-06-18 10:48:16 +0200 | [diff] [blame^] | 17 | #include "absl/types/optional.h" |
Sebastian Jansson | fc7ec8e | 2018-02-28 16:48:00 +0100 | [diff] [blame] | 18 | #include "modules/congestion_controller/goog_cc/bitrate_estimator.h" |
Sebastian Jansson | 6bcd7f6 | 2018-02-27 17:07:02 +0100 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
| 22 | struct PacketFeedback; |
| 23 | |
| 24 | class 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 Chapovalov | 0040b66 | 2018-06-18 10:48:16 +0200 | [diff] [blame^] | 34 | absl::optional<uint32_t> bitrate_bps() const; |
Sebastian Jansson | 6bcd7f6 | 2018-02-27 17:07:02 +0100 | [diff] [blame] | 35 | void SetAlrEndedTimeMs(int64_t alr_ended_time_ms); |
| 36 | |
| 37 | private: |
| 38 | void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms); |
Danil Chapovalov | 0040b66 | 2018-06-18 10:48:16 +0200 | [diff] [blame^] | 39 | absl::optional<int64_t> alr_ended_time_ms_; |
Sebastian Jansson | 6bcd7f6 | 2018-02-27 17:07:02 +0100 | [diff] [blame] | 40 | std::unique_ptr<BitrateEstimator> bitrate_estimator_; |
| 41 | }; |
| 42 | |
Sebastian Jansson | 6bcd7f6 | 2018-02-27 17:07:02 +0100 | [diff] [blame] | 43 | } // namespace webrtc |
| 44 | |
Sebastian Jansson | fc7ec8e | 2018-02-28 16:48:00 +0100 | [diff] [blame] | 45 | #endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_ |