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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc

Issue 2917873002: Refactored incoming bitrate estimator. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h" 11 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h"
12 12
13 #include <algorithm> 13 #include <algorithm>
14 14
15 #include "webrtc/base/logging.h" 15 #include "webrtc/base/logging.h"
16 #include "webrtc/base/ptr_util.h"
16 #include "webrtc/modules/congestion_controller/delay_based_bwe.h" 17 #include "webrtc/modules/congestion_controller/delay_based_bwe.h"
17 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" 18 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h"
18 19
19 namespace webrtc { 20 namespace webrtc {
20 namespace testing { 21 namespace testing {
21 namespace bwe { 22 namespace bwe {
22 23
23 const int kFeedbackIntervalMs = 50; 24 const int kFeedbackIntervalMs = 50;
24 25
25 SendSideBweSender::SendSideBweSender(int kbps, 26 SendSideBweSender::SendSideBweSender(int kbps,
26 BitrateObserver* observer, 27 BitrateObserver* observer,
27 Clock* clock) 28 Clock* clock)
28 : bitrate_controller_( 29 : bitrate_controller_(
29 BitrateController::CreateBitrateController(clock, 30 BitrateController::CreateBitrateController(clock,
30 observer, 31 observer,
31 &event_log_)), 32 &event_log_)),
32 bwe_(new DelayBasedBwe(nullptr, clock)), 33 incoming_bitrate_estimator_(rtc::MakeUnique<IncomingBitrateEstimator>()),
34 bwe_(
35 new DelayBasedBwe(nullptr, incoming_bitrate_estimator_.get(), clock)),
33 feedback_observer_(bitrate_controller_->CreateRtcpBandwidthObserver()), 36 feedback_observer_(bitrate_controller_->CreateRtcpBandwidthObserver()),
34 clock_(clock), 37 clock_(clock),
35 send_time_history_(clock_, 10000), 38 send_time_history_(clock_, 10000),
36 has_received_ack_(false), 39 has_received_ack_(false),
37 last_acked_seq_num_(0), 40 last_acked_seq_num_(0),
38 last_log_time_ms_(0) { 41 last_log_time_ms_(0) {
39 assert(kbps >= kMinBitrateKbps); 42 assert(kbps >= kMinBitrateKbps);
40 assert(kbps <= kMaxBitrateKbps); 43 assert(kbps <= kMaxBitrateKbps);
41 bitrate_controller_->SetStartBitrate(1000 * kbps); 44 bitrate_controller_->SetStartBitrate(1000 * kbps);
42 bitrate_controller_->SetMinMaxBitrate(1000 * kMinBitrateKbps, 45 bitrate_controller_->SetMinMaxBitrate(1000 * kMinBitrateKbps,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 packet_feedback_vector_.back().arrival_time_ms; 165 packet_feedback_vector_.back().arrival_time_ms;
163 FeedbackPacket* fb = new SendSideBweFeedback( 166 FeedbackPacket* fb = new SendSideBweFeedback(
164 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); 167 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_);
165 packet_feedback_vector_.clear(); 168 packet_feedback_vector_.clear();
166 return fb; 169 return fb;
167 } 170 }
168 171
169 } // namespace bwe 172 } // namespace bwe
170 } // namespace testing 173 } // namespace testing
171 } // namespace webrtc 174 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698