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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc

Issue 1288033008: Update SendTimeHistory to store complete PacketInfo, not just send time (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years, 3 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 int Random::Exponential(float lambda) { 125 int Random::Exponential(float lambda) {
126 float uniform = Rand(); 126 float uniform = Rand();
127 return static_cast<int>(-log(uniform) / lambda); 127 return static_cast<int>(-log(uniform) / lambda);
128 } 128 }
129 129
130 Packet::Packet() 130 Packet::Packet()
131 : flow_id_(0), 131 : flow_id_(0),
132 creation_time_us_(-1), 132 creation_time_us_(-1),
133 send_time_us_(-1), 133 send_time_us_(-1),
134 sender_timestamp_us_(-1), 134 sender_timestamp_us_(-1),
135 payload_size_(0) { 135 payload_size_(0),
136 paced_(false) {
136 } 137 }
137 138
138 Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size) 139 Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size)
139 : flow_id_(flow_id), 140 : flow_id_(flow_id),
140 creation_time_us_(send_time_us), 141 creation_time_us_(send_time_us),
141 send_time_us_(send_time_us), 142 send_time_us_(send_time_us),
142 sender_timestamp_us_(send_time_us), 143 sender_timestamp_us_(send_time_us),
143 payload_size_(payload_size) { 144 payload_size_(payload_size),
145 paced_(false) {
144 } 146 }
145 147
146 Packet::~Packet() { 148 Packet::~Packet() {
147 } 149 }
148 150
149 bool Packet::operator<(const Packet& rhs) const { 151 bool Packet::operator<(const Packet& rhs) const {
150 return send_time_us_ < rhs.send_time_us_; 152 return send_time_us_ < rhs.send_time_us_;
151 } 153 }
152 154
153 void Packet::set_send_time_us(int64_t send_time_us) { 155 void Packet::set_send_time_us(int64_t send_time_us) {
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, 844 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size,
843 uint32_t remaining_payload) { 845 uint32_t remaining_payload) {
844 uint32_t fragments = 846 uint32_t fragments =
845 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; 847 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes;
846 uint32_t avg_size = (frame_size + fragments - 1) / fragments; 848 uint32_t avg_size = (frame_size + fragments - 1) / fragments;
847 return std::min(avg_size, remaining_payload); 849 return std::min(avg_size, remaining_payload);
848 } 850 }
849 } // namespace bwe 851 } // namespace bwe
850 } // namespace testing 852 } // namespace testing
851 } // namespace webrtc 853 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698