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

Side by Side Diff: webrtc/modules/pacing/paced_sender.cc

Issue 2156063004: Always take retransmissions into account when deciding pacing order (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add unit test 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
« no previous file with comments | « no previous file | webrtc/modules/pacing/paced_sender_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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 }; 69 };
70 70
71 // Used by priority queue to sort packets. 71 // Used by priority queue to sort packets.
72 struct Comparator { 72 struct Comparator {
73 bool operator()(const Packet* first, const Packet* second) { 73 bool operator()(const Packet* first, const Packet* second) {
74 // Highest prio = 0. 74 // Highest prio = 0.
75 if (first->priority != second->priority) 75 if (first->priority != second->priority)
76 return first->priority > second->priority; 76 return first->priority > second->priority;
77 77
78 // Retransmissions go first. 78 // Retransmissions go first.
79 if (second->retransmission && !first->retransmission) 79 if (second->retransmission != first->retransmission)
80 return true; 80 return second->retransmission;
81 81
82 // Older frames have higher prio. 82 // Older frames have higher prio.
83 if (first->capture_time_ms != second->capture_time_ms) 83 if (first->capture_time_ms != second->capture_time_ms)
84 return first->capture_time_ms > second->capture_time_ms; 84 return first->capture_time_ms > second->capture_time_ms;
85 85
86 return first->enqueue_order > second->enqueue_order; 86 return first->enqueue_order > second->enqueue_order;
87 } 87 }
88 }; 88 };
89 89
90 // Class encapsulating a priority queue with some extensions. 90 // Class encapsulating a priority queue with some extensions.
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 media_budget_->UseBudget(bytes_sent); 471 media_budget_->UseBudget(bytes_sent);
472 padding_budget_->UseBudget(bytes_sent); 472 padding_budget_->UseBudget(bytes_sent);
473 } 473 }
474 } 474 }
475 475
476 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { 476 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) {
477 media_budget_->IncreaseBudget(delta_time_ms); 477 media_budget_->IncreaseBudget(delta_time_ms);
478 padding_budget_->IncreaseBudget(delta_time_ms); 478 padding_budget_->IncreaseBudget(delta_time_ms);
479 } 479 }
480 } // namespace webrtc 480 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/pacing/paced_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698