Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: webrtc/modules/audio_coding/neteq/packet_buffer.h

Issue 2326953003: Added a ParsePayload method to AudioDecoder. (Closed)
Patch Set: Added some casts from size_t to int. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // to zero implies that the horizon is set to half the timestamp range. That 102 // to zero implies that the horizon is set to half the timestamp range. That
103 // is, if a packet is more than 2^31 timestamps into the future compared with 103 // is, if a packet is more than 2^31 timestamps into the future compared with
104 // timestamp_limit (including wrap-around), it is considered old. 104 // timestamp_limit (including wrap-around), it is considered old.
105 // Returns number of packets discarded. 105 // Returns number of packets discarded.
106 virtual int DiscardOldPackets(uint32_t timestamp_limit, 106 virtual int DiscardOldPackets(uint32_t timestamp_limit,
107 uint32_t horizon_samples); 107 uint32_t horizon_samples);
108 108
109 // Discards all packets that are (strictly) older than timestamp_limit. 109 // Discards all packets that are (strictly) older than timestamp_limit.
110 virtual int DiscardAllOldPackets(uint32_t timestamp_limit); 110 virtual int DiscardAllOldPackets(uint32_t timestamp_limit);
111 111
112 // Removes all packets with a specific payload type from the buffer.
113 virtual void DiscardPacketsWithPayloadType(uint8_t payload_type);
114
112 // Returns the number of packets in the buffer, including duplicates and 115 // Returns the number of packets in the buffer, including duplicates and
113 // redundant packets. 116 // redundant packets.
114 virtual size_t NumPacketsInBuffer() const; 117 virtual size_t NumPacketsInBuffer() const;
115 118
116 // Returns the number of samples in the buffer, including samples carried in 119 // Returns the number of samples in the buffer, including samples carried in
117 // duplicate and redundant packets. 120 // duplicate and redundant packets.
118 virtual size_t NumSamplesInBuffer(DecoderDatabase* decoder_database, 121 virtual size_t NumSamplesInBuffer(size_t last_decoded_length) const;
119 size_t last_decoded_length) const;
120 122
121 virtual void BufferStat(int* num_packets, int* max_num_packets) const; 123 virtual void BufferStat(int* num_packets, int* max_num_packets) const;
122 124
123 // Static method that properly deletes the first packet, and its payload 125 // Static method that properly deletes the first packet, and its payload
124 // array, in |packet_list|. Returns false if |packet_list| already was empty, 126 // array, in |packet_list|. Returns false if |packet_list| already was empty,
125 // otherwise true. 127 // otherwise true.
126 static bool DeleteFirstPacket(PacketList* packet_list); 128 static bool DeleteFirstPacket(PacketList* packet_list);
127 129
128 // Static method that properly deletes all packets, and their payload arrays, 130 // Static method that properly deletes all packets, and their payload arrays,
129 // in |packet_list|. 131 // in |packet_list|.
(...skipping 15 matching lines...) Expand all
145 147
146 private: 148 private:
147 size_t max_number_of_packets_; 149 size_t max_number_of_packets_;
148 PacketList buffer_; 150 PacketList buffer_;
149 const TickTimer* tick_timer_; 151 const TickTimer* tick_timer_;
150 RTC_DISALLOW_COPY_AND_ASSIGN(PacketBuffer); 152 RTC_DISALLOW_COPY_AND_ASSIGN(PacketBuffer);
151 }; 153 };
152 154
153 } // namespace webrtc 155 } // namespace webrtc
154 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_ 156 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_PACKET_BUFFER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/packet.h ('k') | webrtc/modules/audio_coding/neteq/packet_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698