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

Side by Side Diff: webrtc/test/fake_network_pipe.cc

Issue 1333483002: Wire up PacketTime to ReceiveStreams. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
« no previous file with comments | « webrtc/stream.h ('k') | webrtc/test/fake_network_pipe_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // to NetworkProcess being called too late. For stats, use the time it 193 // to NetworkProcess being called too late. For stats, use the time it
194 // should have been on the link. 194 // should have been on the link.
195 total_packet_delay_ += packet->arrival_time() - packet->send_time(); 195 total_packet_delay_ += packet->arrival_time() - packet->send_time();
196 } 196 }
197 sent_packets_ += packets_to_deliver.size(); 197 sent_packets_ += packets_to_deliver.size();
198 } 198 }
199 while (!packets_to_deliver.empty()) { 199 while (!packets_to_deliver.empty()) {
200 NetworkPacket* packet = packets_to_deliver.front(); 200 NetworkPacket* packet = packets_to_deliver.front();
201 packets_to_deliver.pop(); 201 packets_to_deliver.pop();
202 packet_receiver_->DeliverPacket(MediaType::ANY, packet->data(), 202 packet_receiver_->DeliverPacket(MediaType::ANY, packet->data(),
203 packet->data_length()); 203 packet->data_length(), PacketTime());
204 delete packet; 204 delete packet;
205 } 205 }
206 } 206 }
207 207
208 int64_t FakeNetworkPipe::TimeUntilNextProcess() const { 208 int64_t FakeNetworkPipe::TimeUntilNextProcess() const {
209 rtc::CritScope crit(&lock_); 209 rtc::CritScope crit(&lock_);
210 const int64_t kDefaultProcessIntervalMs = 30; 210 const int64_t kDefaultProcessIntervalMs = 30;
211 if (capacity_link_.size() == 0 || delay_link_.size() == 0) 211 if (capacity_link_.size() == 0 || delay_link_.size() == 0)
212 return kDefaultProcessIntervalMs; 212 return kDefaultProcessIntervalMs;
213 return std::max<int64_t>( 213 return std::max<int64_t>(
214 next_process_time_ - TickTime::MillisecondTimestamp(), 0); 214 next_process_time_ - TickTime::MillisecondTimestamp(), 0);
215 } 215 }
216 216
217 } // namespace webrtc 217 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/stream.h ('k') | webrtc/test/fake_network_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698