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

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

Issue 2112643005: Remove audio/video distinction for probe packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@52
Patch Set: rebase errors Created 4 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
11 #include <assert.h> 11 #include <assert.h>
12 12
13 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" 13 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h"
14 14
15 namespace webrtc { 15 namespace webrtc {
16 16
17 SendTimeHistory::SendTimeHistory(Clock* clock, int64_t packet_age_limit) 17 SendTimeHistory::SendTimeHistory(Clock* clock, int64_t packet_age_limit)
18 : clock_(clock), 18 : clock_(clock),
19 packet_age_limit_(packet_age_limit), 19 packet_age_limit_(packet_age_limit),
20 oldest_sequence_number_(0) {} 20 oldest_sequence_number_(0) {}
21 21
22 SendTimeHistory::~SendTimeHistory() { 22 SendTimeHistory::~SendTimeHistory() {
23 } 23 }
24 24
25 void SendTimeHistory::Clear() { 25 void SendTimeHistory::Clear() {
26 history_.clear(); 26 history_.clear();
27 } 27 }
28 28
29 void SendTimeHistory::AddAndRemoveOld(uint16_t sequence_number, 29 void SendTimeHistory::AddAndRemoveOld(uint16_t sequence_number, size_t length) {
30 size_t length,
31 bool was_paced) {
32 EraseOld(); 30 EraseOld();
33 31
34 if (history_.empty()) 32 if (history_.empty())
35 oldest_sequence_number_ = sequence_number; 33 oldest_sequence_number_ = sequence_number;
36 34
37 history_.insert(std::pair<uint16_t, PacketInfo>( 35 history_.insert(std::pair<uint16_t, PacketInfo>(
38 sequence_number, PacketInfo(clock_->TimeInMilliseconds(), 0, -1, 36 sequence_number, PacketInfo(clock_->TimeInMilliseconds(), 0, -1,
39 sequence_number, length, was_paced))); 37 sequence_number, length)));
40 } 38 }
41 39
42 bool SendTimeHistory::OnSentPacket(uint16_t sequence_number, 40 bool SendTimeHistory::OnSentPacket(uint16_t sequence_number,
43 int64_t send_time_ms) { 41 int64_t send_time_ms) {
44 auto it = history_.find(sequence_number); 42 auto it = history_.find(sequence_number);
45 if (it == history_.end()) 43 if (it == history_.end())
46 return false; 44 return false;
47 it->second.send_time_ms = send_time_ms; 45 it->second.send_time_ms = send_time_ms;
48 return true; 46 return true;
49 } 47 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 packet->arrival_time_ms = receive_time; 90 packet->arrival_time_ms = receive_time;
93 if (remove) { 91 if (remove) {
94 history_.erase(it); 92 history_.erase(it);
95 if (packet->sequence_number == oldest_sequence_number_) 93 if (packet->sequence_number == oldest_sequence_number_)
96 UpdateOldestSequenceNumber(); 94 UpdateOldestSequenceNumber();
97 } 95 }
98 return true; 96 return true;
99 } 97 }
100 98
101 } // namespace webrtc 99 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698