| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |