webrtc/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h
Sebastian Jansson 79f0d4d0c7 Enables feature to account for unacknowledged data.
By enabling this trial, we can also remove reporting of packet
feedback status from send streams that was used before.

Bug: webrtc:9718
Change-Id: I3e7c4656b0ac6592a834617e044f23a072454181
Reviewed-on: https://webrtc-review.googlesource.com/c/118281
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26363}
2019-01-23 10:00:52 +00:00

52 lines
1.7 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 "api/transport/webrtc_key_value_config.h"
#include "api/units/data_rate.h"
#include "modules/congestion_controller/goog_cc/bitrate_estimator.h"
namespace webrtc {
struct PacketFeedback;
class AcknowledgedBitrateEstimator {
public:
AcknowledgedBitrateEstimator(
const WebRtcKeyValueConfig* key_value_config,
std::unique_ptr<BitrateEstimator> bitrate_estimator);
explicit AcknowledgedBitrateEstimator(
const WebRtcKeyValueConfig* key_value_config);
~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);
private:
void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms);
absl::optional<int64_t> alr_ended_time_ms_;
std::unique_ptr<BitrateEstimator> bitrate_estimator_;
};
} // namespace webrtc
#endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_