#include "modules/audio_coding/neteq/packet_buffer.h"
#include <algorithm>
#include <list>
#include <memory>
#include <type_traits>
#include <utility>
#include "api/audio_codecs/audio_decoder.h"
#include "api/neteq/tick_timer.h"
#include "modules/audio_coding/neteq/decoder_database.h"
#include "modules/audio_coding/neteq/statistics_calculator.h"
#include "rtc_base/checks.h"
#include "rtc_base/experiments/struct_parameters_parser.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
namespace webrtc {
namespace {
class NewTimestampIsLarger { … };
}
PacketBuffer::PacketBuffer(size_t max_number_of_packets,
const TickTimer* tick_timer,
StatisticsCalculator* stats)
: … { … }
PacketBuffer::~PacketBuffer() { … }
void PacketBuffer::Flush() { … }
bool PacketBuffer::Empty() const { … }
int PacketBuffer::InsertPacket(Packet&& packet) { … }
int PacketBuffer::NextTimestamp(uint32_t* next_timestamp) const { … }
int PacketBuffer::NextHigherTimestamp(uint32_t timestamp,
uint32_t* next_timestamp) const { … }
const Packet* PacketBuffer::PeekNextPacket() const { … }
absl::optional<Packet> PacketBuffer::GetNextPacket() { … }
int PacketBuffer::DiscardNextPacket() { … }
void PacketBuffer::DiscardOldPackets(uint32_t timestamp_limit,
uint32_t horizon_samples) { … }
void PacketBuffer::DiscardAllOldPackets(uint32_t timestamp_limit) { … }
void PacketBuffer::DiscardPacketsWithPayloadType(uint8_t payload_type) { … }
size_t PacketBuffer::NumPacketsInBuffer() const { … }
size_t PacketBuffer::NumSamplesInBuffer(size_t last_decoded_length) const { … }
size_t PacketBuffer::GetSpanSamples(size_t last_decoded_length,
size_t sample_rate,
bool count_waiting_time) const { … }
bool PacketBuffer::ContainsDtxOrCngPacket(
const DecoderDatabase* decoder_database) const { … }
void PacketBuffer::LogPacketDiscarded(int codec_level) { … }
}