| Index: webrtc/modules/congestion_controller/delay_based_bwe.h
|
| diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h b/webrtc/modules/congestion_controller/delay_based_bwe.h
|
| similarity index 66%
|
| copy from webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
|
| copy to webrtc/modules/congestion_controller/delay_based_bwe.h
|
| index a6119091ce75f965c69e145dd53555aeafd58383..05fbbd8752a380da3a1c38247076ecc2520a52be 100644
|
| --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
|
| +++ b/webrtc/modules/congestion_controller/delay_based_bwe.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
|
| + * Copyright (c) 2016 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
|
| @@ -8,8 +8,8 @@
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
|
|
| -#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_H_
|
| -#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_H_
|
| +#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_
|
| +#define WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_
|
|
|
| #include <list>
|
| #include <map>
|
| @@ -30,46 +30,10 @@
|
|
|
| namespace webrtc {
|
|
|
| -struct Probe {
|
| - Probe(int64_t send_time_ms, int64_t recv_time_ms, size_t payload_size)
|
| - : send_time_ms(send_time_ms),
|
| - recv_time_ms(recv_time_ms),
|
| - payload_size(payload_size) {}
|
| - int64_t send_time_ms;
|
| - int64_t recv_time_ms;
|
| - size_t payload_size;
|
| -};
|
| -
|
| -struct Cluster {
|
| - Cluster()
|
| - : send_mean_ms(0.0f),
|
| - recv_mean_ms(0.0f),
|
| - mean_size(0),
|
| - count(0),
|
| - num_above_min_delta(0) {}
|
| -
|
| - int GetSendBitrateBps() const {
|
| - RTC_CHECK_GT(send_mean_ms, 0.0f);
|
| - return mean_size * 8 * 1000 / send_mean_ms;
|
| - }
|
| -
|
| - int GetRecvBitrateBps() const {
|
| - RTC_CHECK_GT(recv_mean_ms, 0.0f);
|
| - return mean_size * 8 * 1000 / recv_mean_ms;
|
| - }
|
| -
|
| - float send_mean_ms;
|
| - float recv_mean_ms;
|
| - // TODO(holmer): Add some variance metric as well?
|
| - size_t mean_size;
|
| - int count;
|
| - int num_above_min_delta;
|
| -};
|
| -
|
| -class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
|
| +class DelayBasedBwe : public RemoteBitrateEstimator {
|
| public:
|
| - explicit RemoteBitrateEstimatorAbsSendTime(RemoteBitrateObserver* observer);
|
| - virtual ~RemoteBitrateEstimatorAbsSendTime() {}
|
| + explicit DelayBasedBwe(RemoteBitrateObserver* observer);
|
| + virtual ~DelayBasedBwe() {}
|
|
|
| void IncomingPacketFeedbackVector(
|
| const std::vector<PacketInfo>& packet_feedback_vector) override;
|
| @@ -78,6 +42,13 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
|
| size_t payload_size,
|
| const RTPHeader& header,
|
| bool was_paced) override;
|
| +
|
| + void IncomingPacket(int64_t arrival_time_ms,
|
| + size_t payload_size,
|
| + const RTPHeader& header,
|
| + bool was_paced,
|
| + int probe_cluster_id);
|
| +
|
| // This class relies on Process() being called periodically (at least once
|
| // every other second) for streams to be timed out properly. Therefore it
|
| // shouldn't be detached from the ProcessThread except if it's about to be
|
| @@ -91,19 +62,58 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
|
| void SetMinBitrate(int min_bitrate_bps) override;
|
|
|
| private:
|
| + struct Probe {
|
| + Probe(int64_t send_time_ms,
|
| + int64_t recv_time_ms,
|
| + size_t payload_size,
|
| + int cluster_id)
|
| + : send_time_ms(send_time_ms),
|
| + recv_time_ms(recv_time_ms),
|
| + payload_size(payload_size),
|
| + cluster_id(cluster_id) {}
|
| + int64_t send_time_ms;
|
| + int64_t recv_time_ms;
|
| + size_t payload_size;
|
| + int cluster_id;
|
| + };
|
| +
|
| + struct Cluster {
|
| + Cluster()
|
| + : send_mean_ms(0.0f),
|
| + recv_mean_ms(0.0f),
|
| + mean_size(0),
|
| + count(0),
|
| + num_above_min_delta(0) {}
|
| +
|
| + int GetSendBitrateBps() const {
|
| + RTC_CHECK_GT(send_mean_ms, 0.0f);
|
| + return mean_size * 8 * 1000 / send_mean_ms;
|
| + }
|
| +
|
| + int GetRecvBitrateBps() const {
|
| + RTC_CHECK_GT(recv_mean_ms, 0.0f);
|
| + return mean_size * 8 * 1000 / recv_mean_ms;
|
| + }
|
| +
|
| + float send_mean_ms;
|
| + float recv_mean_ms;
|
| + // TODO(holmer): Add some variance metric as well?
|
| + size_t mean_size;
|
| + int count;
|
| + int num_above_min_delta;
|
| + };
|
| +
|
| typedef std::map<uint32_t, int64_t> Ssrcs;
|
| enum class ProbeResult { kBitrateUpdated, kNoUpdate };
|
|
|
| - static bool IsWithinClusterBounds(int send_delta_ms,
|
| - const Cluster& cluster_aggregate);
|
| -
|
| static void AddCluster(std::list<Cluster>* clusters, Cluster* cluster);
|
|
|
| void IncomingPacketInfo(int64_t arrival_time_ms,
|
| uint32_t send_time_24bits,
|
| size_t payload_size,
|
| uint32_t ssrc,
|
| - bool was_paced);
|
| + bool was_paced,
|
| + int probe_cluster_id);
|
|
|
| void ComputeClusters(std::list<Cluster>* clusters) const;
|
|
|
| @@ -135,9 +145,9 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
|
| Ssrcs ssrcs_ GUARDED_BY(&crit_);
|
| AimdRateControl remote_rate_ GUARDED_BY(&crit_);
|
|
|
| - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorAbsSendTime);
|
| + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe);
|
| };
|
|
|
| } // namespace webrtc
|
|
|
| -#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_BITRATE_ESTIMATOR_ABS_SEND_TIME_H_
|
| +#endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_
|
|
|