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

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: CR response 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..5445719ea6b8890b52ba32d69b4efd25b85972a7 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 USE_TWCC_PLR_FOR_ANA = false;
minyue-webrtc 2017/03/24 12:30:11 nit: kUseTwccPlrForAna because it is not a macro
elad.alon_webrtc.org 2017/03/24 12:41:32 Done.
+
+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))) {
-}
+ USE_TWCC_PLR_FOR_ANA
+ ? 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