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 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_ |
13 | 13 |
14 #include "webrtc/base/constructormagic.h" | 14 #include "webrtc/base/constructormagic.h" |
15 #include "webrtc/base/optional.h" | 15 #include "webrtc/base/optional.h" |
16 #include "webrtc/modules/audio_coding/neteq/packet.h" | 16 #include "webrtc/modules/audio_coding/neteq/packet.h" |
17 #include "webrtc/modules/include/module_common_types.h" | |
ossu
2016/10/12 21:46:02
Needed because IsObsoleteTimestamp is defined inli
| |
17 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
18 | 19 |
19 namespace webrtc { | 20 namespace webrtc { |
20 | 21 |
21 class DecoderDatabase; | 22 class DecoderDatabase; |
22 class TickTimer; | 23 class TickTimer; |
23 | 24 |
24 // This is the actual buffer holding the packets before decoding. | 25 // This is the actual buffer holding the packets before decoding. |
25 class PacketBuffer { | 26 class PacketBuffer { |
26 public: | 27 public: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 virtual int NextTimestamp(uint32_t* next_timestamp) const; | 74 virtual int NextTimestamp(uint32_t* next_timestamp) const; |
74 | 75 |
75 // Gets the timestamp for the first packet in the buffer with a timestamp no | 76 // Gets the timestamp for the first packet in the buffer with a timestamp no |
76 // lower than the input limit |timestamp|. The result is written to the output | 77 // lower than the input limit |timestamp|. The result is written to the output |
77 // variable |next_timestamp|. | 78 // variable |next_timestamp|. |
78 // Returns PacketBuffer::kBufferEmpty if the buffer is empty, | 79 // Returns PacketBuffer::kBufferEmpty if the buffer is empty, |
79 // PacketBuffer::kOK otherwise. | 80 // PacketBuffer::kOK otherwise. |
80 virtual int NextHigherTimestamp(uint32_t timestamp, | 81 virtual int NextHigherTimestamp(uint32_t timestamp, |
81 uint32_t* next_timestamp) const; | 82 uint32_t* next_timestamp) const; |
82 | 83 |
83 // Returns a (constant) pointer the RTP header of the first packet in the | 84 // Returns a (constant) pointer to the first packet in the buffer. Returns |
84 // buffer. Returns NULL if the buffer is empty. | 85 // NULL if the buffer is empty. |
85 virtual const RTPHeader* NextRtpHeader() const; | 86 virtual const Packet* PeekNextPacket() const; |
86 | 87 |
87 // Extracts the first packet in the buffer and returns a pointer to it. | 88 // Extracts the first packet in the buffer and returns a pointer to it. |
88 // Returns NULL if the buffer is empty. The caller is responsible for deleting | 89 // Returns NULL if the buffer is empty. The caller is responsible for deleting |
89 // the packet. | 90 // the packet. |
90 // Subsequent packets with the same timestamp as the one extracted will be | 91 // Subsequent packets with the same timestamp as the one extracted will be |
91 // discarded and properly deleted. The number of discarded packets will be | 92 // discarded and properly deleted. The number of discarded packets will be |
92 // written to the output variable |discard_count|. | 93 // written to the output variable |discard_count|. |
93 virtual Packet* GetNextPacket(size_t* discard_count); | 94 virtual Packet* GetNextPacket(size_t* discard_count); |
94 | 95 |
95 // Discards the first packet in the buffer. The packet is deleted. | 96 // Discards the first packet in the buffer. The packet is deleted. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 148 |
148 private: | 149 private: |
149 size_t max_number_of_packets_; | 150 size_t max_number_of_packets_; |
150 PacketList buffer_; | 151 PacketList buffer_; |
151 const TickTimer* tick_timer_; | 152 const TickTimer* tick_timer_; |
152 RTC_DISALLOW_COPY_AND_ASSIGN(PacketBuffer); | 153 RTC_DISALLOW_COPY_AND_ASSIGN(PacketBuffer); |
153 }; | 154 }; |
154 | 155 |
155 } // namespace webrtc | 156 } // namespace webrtc |
156 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_ | 157 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_ |
OLD | NEW |