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

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

Issue 1202253003: More Simulation Framework features (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Using rtc::scoped_ptr on nada_unittest.cc Created 5 years, 5 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
(...skipping 15 matching lines...) Expand all
26 : BweReceiver(flow_id), 26 : BweReceiver(flow_id),
27 last_feedback_ms_(0), 27 last_feedback_ms_(0),
28 latest_owd_ms_(0) { 28 latest_owd_ms_(0) {
29 } 29 }
30 30
31 TcpBweReceiver::~TcpBweReceiver() { 31 TcpBweReceiver::~TcpBweReceiver() {
32 } 32 }
33 33
34 void TcpBweReceiver::ReceivePacket(int64_t arrival_time_ms, 34 void TcpBweReceiver::ReceivePacket(int64_t arrival_time_ms,
35 const MediaPacket& media_packet) { 35 const MediaPacket& media_packet) {
36 latest_owd_ms_ = arrival_time_ms - media_packet.sender_timestamp_us() / 1000; 36 latest_owd_ms_ = arrival_time_ms - media_packet.sender_timestamp_ms() / 1000;
37 acks_.push_back(media_packet.header().sequenceNumber); 37 acks_.push_back(media_packet.header().sequenceNumber);
38 38
39 received_packets_.Insert(media_packet.sequence_number(), 39 // Log received packet information.
40 media_packet.send_time_ms(), arrival_time_ms, 40 BweReceiver::ReceivePacket(arrival_time_ms, media_packet);
41 media_packet.payload_size());
42 } 41 }
43 42
44 FeedbackPacket* TcpBweReceiver::GetFeedback(int64_t now_ms) { 43 FeedbackPacket* TcpBweReceiver::GetFeedback(int64_t now_ms) {
45 int64_t corrected_send_time_ms = now_ms - latest_owd_ms_; 44 int64_t corrected_send_time_ms = now_ms - latest_owd_ms_;
46 FeedbackPacket* fb = 45 FeedbackPacket* fb =
47 new TcpFeedback(flow_id_, now_ms * 1000, corrected_send_time_ms, acks_); 46 new TcpFeedback(flow_id_, now_ms * 1000, corrected_send_time_ms, acks_);
48 last_feedback_ms_ = now_ms; 47 last_feedback_ms_ = now_ms;
49 acks_.clear(); 48 acks_.clear();
50 return fb; 49 return fb;
51 } 50 }
52 51
53 } // namespace bwe 52 } // namespace bwe
54 } // namespace testing 53 } // namespace testing
55 } // namespace webrtc 54 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698