#include "modules/audio_coding/acm2/acm_receiver.h"
#include <stdlib.h>
#include <string.h>
#include <cstdint>
#include <vector>
#include "absl/strings/match.h"
#include "api/audio/audio_frame.h"
#include "api/audio_codecs/audio_decoder.h"
#include "api/neteq/neteq.h"
#include "api/units/timestamp.h"
#include "modules/audio_coding/acm2/acm_resampler.h"
#include "modules/audio_coding/acm2/call_statistics.h"
#include "modules/audio_coding/neteq/default_neteq_factory.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/strings/audio_format_to_string.h"
#include "system_wrappers/include/clock.h"
namespace webrtc {
namespace acm2 {
namespace {
std::unique_ptr<NetEq> CreateNetEq(
NetEqFactory* neteq_factory,
const NetEq::Config& config,
const Environment& env,
scoped_refptr<AudioDecoderFactory> decoder_factory) { … }
}
AcmReceiver::Config::Config(
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory)
: … { … }
AcmReceiver::Config::Config(const Config&) = default;
AcmReceiver::Config::~Config() = default;
AcmReceiver::AcmReceiver(const Environment& env, Config config)
: … { … }
AcmReceiver::~AcmReceiver() = default;
int AcmReceiver::SetMinimumDelay(int delay_ms) { … }
int AcmReceiver::SetMaximumDelay(int delay_ms) { … }
bool AcmReceiver::SetBaseMinimumDelayMs(int delay_ms) { … }
int AcmReceiver::GetBaseMinimumDelayMs() const { … }
absl::optional<int> AcmReceiver::last_packet_sample_rate_hz() const { … }
int AcmReceiver::last_output_sample_rate_hz() const { … }
int AcmReceiver::InsertPacket(const RTPHeader& rtp_header,
rtc::ArrayView<const uint8_t> incoming_payload,
Timestamp receive_time) { … }
int AcmReceiver::GetAudio(int desired_freq_hz,
AudioFrame* audio_frame,
bool* muted) { … }
void AcmReceiver::SetCodecs(const std::map<int, SdpAudioFormat>& codecs) { … }
void AcmReceiver::FlushBuffers() { … }
absl::optional<uint32_t> AcmReceiver::GetPlayoutTimestamp() { … }
int AcmReceiver::FilteredCurrentDelayMs() const { … }
int AcmReceiver::TargetDelayMs() const { … }
absl::optional<std::pair<int, SdpAudioFormat>> AcmReceiver::LastDecoder()
const { … }
void AcmReceiver::GetNetworkStatistics(
NetworkStatistics* acm_stat,
bool get_and_clear_legacy_stats ) const { … }
int AcmReceiver::EnableNack(size_t max_nack_list_size) { … }
void AcmReceiver::DisableNack() { … }
std::vector<uint16_t> AcmReceiver::GetNackList(
int64_t round_trip_time_ms) const { … }
void AcmReceiver::ResetInitialDelay() { … }
uint32_t AcmReceiver::NowInTimestamp(int decoder_sampling_rate) const { … }
void AcmReceiver::GetDecodingCallStatistics(
AudioDecodingCallStats* stats) const { … }
}
}