Move NetEq headers to api/
This CL also introduces NetEqFactory and NetEqControllerFactory interfaces, as well as several convenience classes for working with them: DefaultNetEqFactory, DefaultNetEqControllerFactory and CustomNetEqFactory. Bug: webrtc:11005 Change-Id: I1e8fc5154636ac2aad1a856828f80a2a758ad392 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156945 Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29671}
This commit is contained in:
@ -15,6 +15,8 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "absl/flags/flag.h"
|
||||
#include "api/neteq/custom_neteq_factory.h"
|
||||
#include "api/neteq/default_neteq_controller_factory.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_quality_test.h"
|
||||
#include "modules/audio_coding/neteq/tools/output_audio_file.h"
|
||||
#include "modules/audio_coding/neteq/tools/output_wav_file.h"
|
||||
@ -87,6 +89,19 @@ ABSL_FLAG(std::string,
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
namespace {
|
||||
|
||||
std::unique_ptr<NetEq> CreateNetEq(
|
||||
const NetEq::Config& config,
|
||||
Clock* clock,
|
||||
const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) {
|
||||
CustomNetEqFactory neteq_factory(
|
||||
decoder_factory, std::make_unique<DefaultNetEqControllerFactory>());
|
||||
return neteq_factory.CreateNetEq(config, clock);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
const uint8_t kPayloadType = 95;
|
||||
const int kOutputSizeMs = 10;
|
||||
const int kInitSeed = 0x12345678;
|
||||
@ -228,8 +243,7 @@ NetEqQualityTest::NetEqQualityTest(
|
||||
|
||||
NetEq::Config config;
|
||||
config.sample_rate_hz = out_sampling_khz_ * 1000;
|
||||
neteq_.reset(
|
||||
NetEq::Create(config, Clock::GetRealTimeClock(), decoder_factory));
|
||||
neteq_ = CreateNetEq(config, Clock::GetRealTimeClock(), decoder_factory);
|
||||
max_payload_bytes_ = in_size_samples_ * channels_ * sizeof(int16_t);
|
||||
in_data_.reset(new int16_t[in_size_samples_ * channels_]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user