| OLD | NEW |
| 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 "webrtc/modules/rtp_rtcp/source/packet_loss_stats.h" | 11 #include "webrtc/modules/rtp_rtcp/source/packet_loss_stats.h" |
| 12 | 12 |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "webrtc/base/checks.h" | 15 #include "webrtc/rtc_base/checks.h" |
| 16 | 16 |
| 17 // After this many packets are added, adding additional packets will cause the | 17 // After this many packets are added, adding additional packets will cause the |
| 18 // oldest packets to be pruned from the buffer. | 18 // oldest packets to be pruned from the buffer. |
| 19 static const int kBufferSize = 100; | 19 static const int kBufferSize = 100; |
| 20 | 20 |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 | 22 |
| 23 PacketLossStats::PacketLossStats() | 23 PacketLossStats::PacketLossStats() |
| 24 : single_loss_historic_count_(0), | 24 : single_loss_historic_count_(0), |
| 25 multiple_loss_historic_event_count_(0), | 25 multiple_loss_historic_event_count_(0), |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 128 } |
| 129 // Continue pruning if the wrapped buffer is beyond a threshold and there are | 129 // Continue pruning if the wrapped buffer is beyond a threshold and there are |
| 130 // things left in the pre-wrapped buffer. | 130 // things left in the pre-wrapped buffer. |
| 131 if (!lost_packets_wrapped_buffer_.empty() && | 131 if (!lost_packets_wrapped_buffer_.empty() && |
| 132 *(lost_packets_wrapped_buffer_.rbegin()) > 0x4000) { | 132 *(lost_packets_wrapped_buffer_.rbegin()) > 0x4000) { |
| 133 PruneBuffer(); | 133 PruneBuffer(); |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace webrtc | 137 } // namespace webrtc |
| OLD | NEW |