chromium/third_party/webrtc/modules/audio_coding/neteq/packet_buffer.cc

/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

// This is the implementation of the PacketBuffer class. It is mostly based on
// an STL list. The list is kept sorted at all times so that the next packet to
// decode is at the beginning of the list.

#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 {
// Predicate used when inserting packets in the buffer list.
// Operator() returns true when `packet` goes before `new_packet`.
class NewTimestampIsLarger {};

}  // namespace

PacketBuffer::PacketBuffer(size_t max_number_of_packets,
                           const TickTimer* tick_timer,
                           StatisticsCalculator* stats)
    :{}

// Destructor. All packets in the buffer will be destroyed.
PacketBuffer::~PacketBuffer() {}

// Flush the buffer. All packets in the buffer will be destroyed.
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) {}

}  // namespace webrtc