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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/send_time_history.cc

Issue 2997883002: Video/Screenshare loopback tool.
Patch Set: Rebase Created 3 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) 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 23 matching lines...) Expand all
34 34
35 // Add new. 35 // Add new.
36 int64_t unwrapped_seq_num = seq_num_unwrapper_.Unwrap(packet.sequence_number); 36 int64_t unwrapped_seq_num = seq_num_unwrapper_.Unwrap(packet.sequence_number);
37 history_.insert(std::make_pair(unwrapped_seq_num, packet)); 37 history_.insert(std::make_pair(unwrapped_seq_num, packet));
38 } 38 }
39 39
40 bool SendTimeHistory::OnSentPacket(uint16_t sequence_number, 40 bool SendTimeHistory::OnSentPacket(uint16_t sequence_number,
41 int64_t send_time_ms) { 41 int64_t send_time_ms) {
42 int64_t unwrapped_seq_num = seq_num_unwrapper_.Unwrap(sequence_number); 42 int64_t unwrapped_seq_num = seq_num_unwrapper_.Unwrap(sequence_number);
43 auto it = history_.find(unwrapped_seq_num); 43 auto it = history_.find(unwrapped_seq_num);
44 if (it == history_.end()) 44 if (it == history_.end()) {
45 Print("No history for %u", sequence_number);
45 return false; 46 return false;
47 }
46 it->second.send_time_ms = send_time_ms; 48 it->second.send_time_ms = send_time_ms;
49 int cluster_id = it->second.pacing_info.probe_cluster_id;
50 if (cluster_id > -1) {
51 Print("Sent packet %u of size %lu for probe cluster %d", sequence_number,
52 it->second.payload_size, cluster_id);
53 }
47 return true; 54 return true;
48 } 55 }
49 56
50 bool SendTimeHistory::GetFeedback(PacketFeedback* packet_feedback, 57 bool SendTimeHistory::GetFeedback(PacketFeedback* packet_feedback,
51 bool remove) { 58 bool remove) {
52 RTC_DCHECK(packet_feedback); 59 RTC_DCHECK(packet_feedback);
53 int64_t unwrapped_seq_num = 60 int64_t unwrapped_seq_num =
54 seq_num_unwrapper_.Unwrap(packet_feedback->sequence_number); 61 seq_num_unwrapper_.Unwrap(packet_feedback->sequence_number);
55 latest_acked_seq_num_.emplace( 62 latest_acked_seq_num_.emplace(
56 std::max(unwrapped_seq_num, latest_acked_seq_num_.value_or(0))); 63 std::max(unwrapped_seq_num, latest_acked_seq_num_.value_or(0)));
(...skipping 23 matching lines...) Expand all
80 if (unacked_it->second.local_net_id == local_net_id && 87 if (unacked_it->second.local_net_id == local_net_id &&
81 unacked_it->second.remote_net_id == remote_net_id && 88 unacked_it->second.remote_net_id == remote_net_id &&
82 unacked_it->second.send_time_ms >= 0) { 89 unacked_it->second.send_time_ms >= 0) {
83 outstanding_bytes += unacked_it->second.payload_size; 90 outstanding_bytes += unacked_it->second.payload_size;
84 } 91 }
85 } 92 }
86 return outstanding_bytes; 93 return outstanding_bytes;
87 } 94 }
88 95
89 } // namespace webrtc 96 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc ('k') | webrtc/rtc_tools/event_log_visualizer/analyzer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698