mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-16 15:20:42 +01:00

Bug: webrtc:9718 Change-Id: I1b6ed37afd7680dfad6267addfe46155c378525d Reviewed-on: https://webrtc-review.googlesource.com/c/110903 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25702}
53 lines
1.8 KiB
C++
53 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
|
|
#define MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "absl/types/optional.h"
|
|
#include "modules/congestion_controller/goog_cc/bitrate_estimator.h"
|
|
|
|
#include "api/units/data_rate.h"
|
|
|
|
namespace webrtc {
|
|
|
|
struct PacketFeedback;
|
|
|
|
class AcknowledgedBitrateEstimator {
|
|
public:
|
|
explicit AcknowledgedBitrateEstimator(
|
|
std::unique_ptr<BitrateEstimator> bitrate_estimator);
|
|
|
|
AcknowledgedBitrateEstimator();
|
|
~AcknowledgedBitrateEstimator();
|
|
|
|
void IncomingPacketFeedbackVector(
|
|
const std::vector<PacketFeedback>& packet_feedback_vector);
|
|
absl::optional<uint32_t> bitrate_bps() const;
|
|
absl::optional<uint32_t> PeekBps() const;
|
|
absl::optional<DataRate> bitrate() const;
|
|
absl::optional<DataRate> PeekRate() const;
|
|
void SetAlrEndedTimeMs(int64_t alr_ended_time_ms);
|
|
void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps);
|
|
|
|
private:
|
|
void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms);
|
|
const bool account_for_unacknowledged_traffic_;
|
|
absl::optional<int64_t> alr_ended_time_ms_;
|
|
std::unique_ptr<BitrateEstimator> bitrate_estimator_;
|
|
uint32_t allocated_bitrate_without_feedback_bps_ = 0;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_
|