| Index: webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
|
| diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
|
| similarity index 66%
|
| rename from webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h
|
| rename to webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
|
| index 8d9cbb03f9cf590d7d7e235b25fdcc2213ca2af8..d3ddbd41a318df075b1aeb2f2b7876f48b286702 100644
|
| --- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h
|
| +++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
| + * 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
|
| @@ -8,44 +8,48 @@
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
|
|
| -#ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_H_
|
| -#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_H_
|
| +#ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_RPLR_BASED_H_
|
| +#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_RPLR_BASED_H_
|
|
|
| #include <memory>
|
|
|
| #include "webrtc/base/constructormagic.h"
|
| -#include "webrtc/common_audio/smoothing_filter.h"
|
| #include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h"
|
| +#include "webrtc/system_wrappers/include/clock.h"
|
|
|
| namespace webrtc {
|
|
|
| -class FecController final : public Controller {
|
| +class FecControllerRplrBased final : public Controller {
|
| public:
|
| struct Config {
|
| struct Threshold {
|
| // Threshold defines a curve in the bandwidth/packet-loss domain. The
|
| // curve is characterized by the two conjunction points: A and B.
|
| //
|
| - // packet ^ |
|
| - // loss | A|
|
| - // | \ A: (low_bandwidth_bps, low_bandwidth_packet_loss)
|
| - // | \ B: (high_bandwidth_bps, high_bandwidth_packet_loss)
|
| - // | B\________
|
| - // |---------------> bandwidth
|
| + // recoverable
|
| + // packet ^ |
|
| + // loss | A |
|
| + // | \ A: (low_bandwidth_bps,
|
| + // | \ low_bandwidth_recoverable_packet_loss)
|
| + // | \ B: (high_bandwidth_bps,
|
| + // | \ high_bandwidth_recoverable_packet_loss)
|
| + // | B \________
|
| + // |---------------> bandwidth
|
| Threshold(int low_bandwidth_bps,
|
| - float low_bandwidth_packet_loss,
|
| + float low_bandwidth_recoverable_packet_loss,
|
| int high_bandwidth_bps,
|
| - float high_bandwidth_packet_loss);
|
| + float high_bandwidth_recoverable_packet_loss);
|
| int low_bandwidth_bps;
|
| - float low_bandwidth_packet_loss;
|
| + float low_bandwidth_recoverable_packet_loss;
|
| int high_bandwidth_bps;
|
| - float high_bandwidth_packet_loss;
|
| + float high_bandwidth_recoverable_packet_loss;
|
| };
|
|
|
| // |fec_enabling_threshold| defines a curve, above which FEC should be
|
| // enabled. |fec_disabling_threshold| defines a curve, under which FEC
|
| // should be disabled. See below
|
| //
|
| + // recoverable
|
| // packet-loss ^ | |
|
| // | | | FEC
|
| // | \ \ ON
|
| @@ -64,20 +68,17 @@ class FecController final : public Controller {
|
| const Clock* clock;
|
| };
|
|
|
| - // Dependency injection for testing.
|
| - FecController(const Config& config,
|
| - std::unique_ptr<SmoothingFilter> smoothing_filter);
|
| + explicit FecControllerRplrBased(const Config& config);
|
|
|
| - explicit FecController(const Config& config);
|
| -
|
| - ~FecController() override;
|
| + ~FecControllerRplrBased() override;
|
|
|
| void UpdateNetworkMetrics(const NetworkMetrics& network_metrics) override;
|
|
|
| void MakeDecision(AudioNetworkAdaptor::EncoderRuntimeConfig* config) override;
|
|
|
| private:
|
| - // Characterize Threshold with packet_loss = slope * bandwidth + offset.
|
| + // Characterize Threshold with:
|
| + // recoverable_packet_loss = slope * bandwidth + offset.
|
| struct ThresholdInfo {
|
| explicit ThresholdInfo(const Config::Threshold& threshold);
|
| float slope;
|
| @@ -88,20 +89,20 @@ class FecController final : public Controller {
|
| const Config::Threshold& threshold,
|
| const ThresholdInfo& threshold_info) const;
|
|
|
| - bool FecEnablingDecision(const rtc::Optional<float>& packet_loss) const;
|
| - bool FecDisablingDecision(const rtc::Optional<float>& packet_loss) const;
|
| + bool FecEnablingDecision() const;
|
| + bool FecDisablingDecision() const;
|
|
|
| const Config config_;
|
| bool fec_enabled_;
|
| rtc::Optional<int> uplink_bandwidth_bps_;
|
| - const std::unique_ptr<SmoothingFilter> packet_loss_smoother_;
|
| + rtc::Optional<float> uplink_recoverable_packet_loss_;
|
|
|
| const ThresholdInfo fec_enabling_threshold_info_;
|
| const ThresholdInfo fec_disabling_threshold_info_;
|
|
|
| - RTC_DISALLOW_COPY_AND_ASSIGN(FecController);
|
| + RTC_DISALLOW_COPY_AND_ASSIGN(FecControllerRplrBased);
|
| };
|
|
|
| } // namespace webrtc
|
|
|
| -#endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_H_
|
| +#endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_RPLR_BASED_H_
|
|
|