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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 private: | 37 private: |
38 const Packet& new_packet_; | 38 const Packet& new_packet_; |
39 }; | 39 }; |
40 | 40 |
41 // Returns true if both payload types are known to the decoder database, and | 41 // Returns true if both payload types are known to the decoder database, and |
42 // have the same sample rate. | 42 // have the same sample rate. |
43 bool EqualSampleRates(uint8_t pt1, | 43 bool EqualSampleRates(uint8_t pt1, |
44 uint8_t pt2, | 44 uint8_t pt2, |
45 const DecoderDatabase& decoder_database) { | 45 const DecoderDatabase& decoder_database) { |
46 auto di1 = decoder_database.GetDecoderInfo(pt1); | 46 auto* di1 = decoder_database.GetDecoderInfo(pt1); |
47 auto di2 = decoder_database.GetDecoderInfo(pt2); | 47 auto* di2 = decoder_database.GetDecoderInfo(pt2); |
48 return di1 && di2 && di1->SampleRateHz() == di2->SampleRateHz(); | 48 return di1 && di2 && di1->SampleRateHz() == di2->SampleRateHz(); |
49 } | 49 } |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 PacketBuffer::PacketBuffer(size_t max_number_of_packets, | 52 PacketBuffer::PacketBuffer(size_t max_number_of_packets, |
53 const TickTimer* tick_timer) | 53 const TickTimer* tick_timer) |
54 : max_number_of_packets_(max_number_of_packets), tick_timer_(tick_timer) {} | 54 : max_number_of_packets_(max_number_of_packets), tick_timer_(tick_timer) {} |
55 | 55 |
56 // Destructor. All packets in the buffer will be destroyed. | 56 // Destructor. All packets in the buffer will be destroyed. |
57 PacketBuffer::~PacketBuffer() { | 57 PacketBuffer::~PacketBuffer() { |
(...skipping 208 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 |