| 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 |
| 11 // This is the implementation of the PacketBuffer class. It is mostly based on | 11 // This is the implementation of the PacketBuffer class. It is mostly based on |
| 12 // an STL list. The list is kept sorted at all times so that the next packet to | 12 // an STL list. The list is kept sorted at all times so that the next packet to |
| 13 // decode is at the beginning of the list. | 13 // decode is at the beginning of the list. |
| 14 | 14 |
| 15 #include "webrtc/modules/audio_coding/neteq/packet_buffer.h" | 15 #include "webrtc/modules/audio_coding/neteq/packet_buffer.h" |
| 16 | 16 |
| 17 #include <algorithm> // find_if() | 17 #include <algorithm> // find_if() |
| 18 | 18 |
| 19 #include "webrtc/api/audio_codecs/audio_decoder.h" |
| 19 #include "webrtc/base/logging.h" | 20 #include "webrtc/base/logging.h" |
| 20 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" | |
| 21 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" | 21 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" |
| 22 #include "webrtc/modules/audio_coding/neteq/tick_timer.h" | 22 #include "webrtc/modules/audio_coding/neteq/tick_timer.h" |
| 23 | 23 |
| 24 namespace webrtc { | 24 namespace webrtc { |
| 25 namespace { | 25 namespace { |
| 26 // Predicate used when inserting packets in the buffer list. | 26 // Predicate used when inserting packets in the buffer list. |
| 27 // Operator() returns true when |packet| goes before |new_packet|. | 27 // Operator() returns true when |packet| goes before |new_packet|. |
| 28 class NewTimestampIsLarger { | 28 class NewTimestampIsLarger { |
| 29 public: | 29 public: |
| 30 explicit NewTimestampIsLarger(const Packet& new_packet) | 30 explicit NewTimestampIsLarger(const Packet& new_packet) |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } | 266 } |
| 267 return num_samples; | 267 return num_samples; |
| 268 } | 268 } |
| 269 | 269 |
| 270 void PacketBuffer::BufferStat(int* num_packets, int* max_num_packets) const { | 270 void PacketBuffer::BufferStat(int* num_packets, int* max_num_packets) const { |
| 271 *num_packets = static_cast<int>(buffer_.size()); | 271 *num_packets = static_cast<int>(buffer_.size()); |
| 272 *max_num_packets = static_cast<int>(max_number_of_packets_); | 272 *max_num_packets = static_cast<int>(max_number_of_packets_); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace webrtc | 275 } // namespace webrtc |
| OLD | NEW |