• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #ifndef MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
12 #define MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
13 
14 #include <memory>
15 #include <vector>
16 
17 #include "absl/types/optional.h"
18 #include "api/transport/network_types.h"
19 #include "api/transport/webrtc_key_value_config.h"
20 #include "api/units/data_rate.h"
21 #include "modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator_interface.h"
22 #include "modules/congestion_controller/goog_cc/bitrate_estimator.h"
23 
24 namespace webrtc {
25 
26 class AcknowledgedBitrateEstimator
27     : public AcknowledgedBitrateEstimatorInterface {
28  public:
29   AcknowledgedBitrateEstimator(
30       const WebRtcKeyValueConfig* key_value_config,
31       std::unique_ptr<BitrateEstimator> bitrate_estimator);
32 
33   explicit AcknowledgedBitrateEstimator(
34       const WebRtcKeyValueConfig* key_value_config);
35   ~AcknowledgedBitrateEstimator() override;
36 
37   void IncomingPacketFeedbackVector(
38       const std::vector<PacketResult>& packet_feedback_vector) override;
39   absl::optional<DataRate> bitrate() const override;
40   absl::optional<DataRate> PeekRate() const override;
41   void SetAlr(bool in_alr) override;
42   void SetAlrEndedTime(Timestamp alr_ended_time) override;
43 
44  private:
45   absl::optional<Timestamp> alr_ended_time_;
46   bool in_alr_;
47   std::unique_ptr<BitrateEstimator> bitrate_estimator_;
48 };
49 
50 }  // namespace webrtc
51 
52 #endif  // MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
53