Added a ParsePayload method to AudioDecoder.

It allows the decoder to split the input up into usable chunks before
they are put into NetEq's PacketBuffer. Eventually, all packet splitting
will move into ParsePayload.

There's currently a base implementation of ParsePayload. It will
generate a single Frame that calls the underlying AudioDecoder for
getting Duration() and to Decode.

BUG=webrtc:5805
BUG=chromium:428099

Review-Url: https://codereview.webrtc.org/2326953003
Cr-Commit-Position: refs/heads/master@{#14300}
This commit is contained in:
ossu
2016-09-20 01:38:00 -07:00
committed by Commit bot
parent 02bd5125e9
commit 61a208b1b8
8 changed files with 268 additions and 115 deletions

View File

@ -109,14 +109,16 @@ class PacketBuffer {
// Discards all packets that are (strictly) older than timestamp_limit.
virtual int DiscardAllOldPackets(uint32_t timestamp_limit);
// Removes all packets with a specific payload type from the buffer.
virtual void DiscardPacketsWithPayloadType(uint8_t payload_type);
// Returns the number of packets in the buffer, including duplicates and
// redundant packets.
virtual size_t NumPacketsInBuffer() const;
// Returns the number of samples in the buffer, including samples carried in
// duplicate and redundant packets.
virtual size_t NumSamplesInBuffer(DecoderDatabase* decoder_database,
size_t last_decoded_length) const;
virtual size_t NumSamplesInBuffer(size_t last_decoded_length) const;
virtual void BufferStat(int* num_packets, int* max_num_packets) const;