Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc

Issue 2687433004: TWCC-PLR -based FecController doesn’t need smoothing (Closed)
Patch Set: nit fixed Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc
index c3c27c6bed41c16093a2f4ee70cd2229c432d1e0..f2b0f5b460f1671ad5614417e2accdda9d522818 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc
@@ -17,6 +17,28 @@
namespace webrtc {
+namespace {
+// TODO(elad.alon): Subsequent CL experiments with PLR source.
+constexpr bool kUseTwccPlrForAna = false;
+
+class NullSmoothingFilter final : public SmoothingFilter {
+ public:
+ void AddSample(float sample) override {
+ last_sample_ = rtc::Optional<float>(sample);
+ }
+
+ rtc::Optional<float> GetAverage() override { return last_sample_; }
+
+ bool SetTimeConstantMs(int time_constant_ms) override {
+ RTC_NOTREACHED();
+ return false;
+ }
+
+ private:
+ rtc::Optional<float> last_sample_;
+};
+}
+
FecControllerPlrBased::Config::Threshold::Threshold(
int low_bandwidth_bps,
float low_bandwidth_packet_loss,
@@ -63,9 +85,11 @@ FecControllerPlrBased::FecControllerPlrBased(
FecControllerPlrBased::FecControllerPlrBased(const Config& config)
: FecControllerPlrBased(
config,
- std::unique_ptr<SmoothingFilter>(
- new SmoothingFilterImpl(config.time_constant_ms, config.clock))) {
-}
+ kUseTwccPlrForAna
+ ? std::unique_ptr<NullSmoothingFilter>(new NullSmoothingFilter())
+ : std::unique_ptr<SmoothingFilter>(
+ new SmoothingFilterImpl(config.time_constant_ms,
+ config.clock))) {}
FecControllerPlrBased::~FecControllerPlrBased() = default;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698