Removing AudioCoding duplicate tests
Reverting to using one version of ACM in ACM tests. BUG=2996 R=turaj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/12079004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5924 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
6cec07f6a7
commit
adaf809612
@ -56,8 +56,8 @@ void APITest::Wait(uint32_t waitLengthMs) {
|
||||
}
|
||||
|
||||
APITest::APITest(const Config& config)
|
||||
: _acmA(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
_acmB(config.Get<AudioCodingModuleFactory>().Create(2)),
|
||||
: _acmA(AudioCodingModule::Create(1)),
|
||||
_acmB(AudioCodingModule::Create(2)),
|
||||
_channel_A2B(NULL),
|
||||
_channel_B2A(NULL),
|
||||
_writeToFile(true),
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/utility.h"
|
||||
@ -242,16 +241,14 @@ void Receiver::Run() {
|
||||
}
|
||||
}
|
||||
|
||||
EncodeDecodeTest::EncodeDecodeTest(const Config& config)
|
||||
: config_(config) {
|
||||
EncodeDecodeTest::EncodeDecodeTest() {
|
||||
_testMode = 2;
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile(
|
||||
(webrtc::test::OutputPath() + "acm_encdec_trace.txt").c_str());
|
||||
}
|
||||
|
||||
EncodeDecodeTest::EncodeDecodeTest(int testMode, const Config& config)
|
||||
: config_(config) {
|
||||
EncodeDecodeTest::EncodeDecodeTest(int testMode) {
|
||||
//testMode == 0 for autotest
|
||||
//testMode == 1 for testing all codecs/parameters
|
||||
//testMode > 1 for specific user-input test (as it was used before)
|
||||
@ -273,8 +270,7 @@ void EncodeDecodeTest::Perform() {
|
||||
codePars[1] = 0;
|
||||
codePars[2] = 0;
|
||||
|
||||
scoped_ptr<AudioCodingModule> acm(
|
||||
config_.Get<AudioCodingModuleFactory>().Create(0));
|
||||
scoped_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0));
|
||||
struct CodecInst sendCodecTmp;
|
||||
numCodecs = acm->NumberOfCodecs();
|
||||
|
||||
@ -329,8 +325,7 @@ void EncodeDecodeTest::Perform() {
|
||||
|
||||
void EncodeDecodeTest::EncodeToFile(int fileType, int codeId, int* codePars,
|
||||
int testMode) {
|
||||
scoped_ptr<AudioCodingModule> acm(
|
||||
config_.Get<AudioCodingModuleFactory>().Create(1));
|
||||
scoped_ptr<AudioCodingModule> acm(AudioCodingModule::Create(1));
|
||||
RTPFile rtpFile;
|
||||
std::string fileName = webrtc::test::OutputPath() + "outFile.rtp";
|
||||
rtpFile.Open(fileName.c_str(), "wb+");
|
||||
|
@ -23,8 +23,6 @@ namespace webrtc {
|
||||
|
||||
#define MAX_INCOMING_PAYLOAD 8096
|
||||
|
||||
class Config;
|
||||
|
||||
// TestPacketization callback which writes the encoded payloads to file
|
||||
class TestPacketization : public AudioPacketizationCallback {
|
||||
public:
|
||||
@ -92,8 +90,8 @@ class Receiver {
|
||||
|
||||
class EncodeDecodeTest : public ACMTest {
|
||||
public:
|
||||
explicit EncodeDecodeTest(const Config& config);
|
||||
EncodeDecodeTest(int testMode, const Config& config);
|
||||
EncodeDecodeTest();
|
||||
explicit EncodeDecodeTest(int testMode);
|
||||
virtual void Perform();
|
||||
|
||||
uint16_t _playoutFreq;
|
||||
@ -102,8 +100,6 @@ class EncodeDecodeTest : public ACMTest {
|
||||
private:
|
||||
void EncodeToFile(int fileType, int codeId, int* codePars, int testMode);
|
||||
|
||||
const Config& config_;
|
||||
|
||||
protected:
|
||||
Sender _sender;
|
||||
Receiver _receiver;
|
||||
|
@ -99,9 +99,9 @@ void TestPack::reset_payload_size() {
|
||||
payload_size_ = 0;
|
||||
}
|
||||
|
||||
TestAllCodecs::TestAllCodecs(int test_mode, const Config& config)
|
||||
: acm_a_(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
acm_b_(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
TestAllCodecs::TestAllCodecs(int test_mode)
|
||||
: acm_a_(AudioCodingModule::Create(0)),
|
||||
acm_b_(AudioCodingModule::Create(1)),
|
||||
channel_a_to_b_(NULL),
|
||||
test_count_(0),
|
||||
packet_size_samples_(0),
|
||||
|
@ -11,7 +11,6 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_TESTALLCODECS_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_TESTALLCODECS_H_
|
||||
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/Channel.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/PCMFile.h"
|
||||
@ -50,7 +49,7 @@ class TestPack : public AudioPacketizationCallback {
|
||||
|
||||
class TestAllCodecs : public ACMTest {
|
||||
public:
|
||||
TestAllCodecs(int test_mode, const Config& config);
|
||||
explicit TestAllCodecs(int test_mode);
|
||||
~TestAllCodecs();
|
||||
|
||||
void Perform();
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <assert.h>
|
||||
#include <iostream>
|
||||
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
|
||||
@ -23,12 +22,11 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
TestFEC::TestFEC(const Config& config)
|
||||
: _acmA(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
_acmB(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
TestFEC::TestFEC()
|
||||
: _acmA(AudioCodingModule::Create(0)),
|
||||
_acmB(AudioCodingModule::Create(1)),
|
||||
_channelA2B(NULL),
|
||||
_testCntr(0) {
|
||||
}
|
||||
_testCntr(0) {}
|
||||
|
||||
TestFEC::~TestFEC() {
|
||||
if (_channelA2B != NULL) {
|
||||
|
@ -18,11 +18,9 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class Config;
|
||||
|
||||
class TestFEC : public ACMTest {
|
||||
public:
|
||||
explicit TestFEC(const Config& config);
|
||||
TestFEC();
|
||||
~TestFEC();
|
||||
|
||||
void Perform();
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
|
||||
@ -108,9 +107,9 @@ void TestPackStereo::set_lost_packet(bool lost) {
|
||||
lost_packet_ = lost;
|
||||
}
|
||||
|
||||
TestStereo::TestStereo(int test_mode, const Config& config)
|
||||
: acm_a_(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
acm_b_(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
TestStereo::TestStereo(int test_mode)
|
||||
: acm_a_(AudioCodingModule::Create(0)),
|
||||
acm_b_(AudioCodingModule::Create(1)),
|
||||
channel_a2b_(NULL),
|
||||
test_cntr_(0),
|
||||
pack_size_samp_(0),
|
||||
|
@ -20,8 +20,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class Config;
|
||||
|
||||
enum StereoMonoMode {
|
||||
kNotSet,
|
||||
kMono,
|
||||
@ -62,7 +60,7 @@ class TestPackStereo : public AudioPacketizationCallback {
|
||||
|
||||
class TestStereo : public ACMTest {
|
||||
public:
|
||||
TestStereo(int test_mode, const Config& config);
|
||||
explicit TestStereo(int test_mode);
|
||||
~TestStereo();
|
||||
|
||||
void Perform();
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
|
||||
@ -23,11 +22,10 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
TestVADDTX::TestVADDTX(const Config& config)
|
||||
: _acmA(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
_acmB(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
_channelA2B(NULL) {
|
||||
}
|
||||
TestVADDTX::TestVADDTX()
|
||||
: _acmA(AudioCodingModule::Create(0)),
|
||||
_acmB(AudioCodingModule::Create(1)),
|
||||
_channelA2B(NULL) {}
|
||||
|
||||
TestVADDTX::~TestVADDTX() {
|
||||
if (_channelA2B != NULL) {
|
||||
|
@ -18,8 +18,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class Config;
|
||||
|
||||
typedef struct {
|
||||
bool statusDTX;
|
||||
bool statusVAD;
|
||||
@ -49,7 +47,7 @@ class ActivityMonitor : public ACMVADCallback {
|
||||
|
||||
class TestVADDTX : public ACMTest {
|
||||
public:
|
||||
explicit TestVADDTX(const Config& config);
|
||||
TestVADDTX();
|
||||
~TestVADDTX();
|
||||
|
||||
void Perform();
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/APITest.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/EncodeDecodeTest.h"
|
||||
@ -24,7 +23,6 @@
|
||||
#include "webrtc/modules/audio_coding/main/test/TestStereo.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/TestVADDTX.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/TwoWayCommunication.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/utility.h"
|
||||
#include "webrtc/system_wrappers/interface/trace.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
@ -39,21 +37,7 @@ TEST(AudioCodingModuleTest, TestAllCodecs) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_allcodecs_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::TestAllCodecs(ACM_TEST_MODE, config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, TestAllCodecsNewACM) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_allcodecs_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::TestAllCodecs(ACM_TEST_MODE, config).Perform();
|
||||
webrtc::TestAllCodecs(ACM_TEST_MODE).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -61,21 +45,7 @@ TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestEncodeDecode)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_encodedecode_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::EncodeDecodeTest(ACM_TEST_MODE, config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestEncodeDecodeNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_encodedecode_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::EncodeDecodeTest(ACM_TEST_MODE, config).Perform();
|
||||
webrtc::EncodeDecodeTest(ACM_TEST_MODE).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -83,21 +53,7 @@ TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestFEC)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_fec_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::TestFEC(config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestFECNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_fec_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::TestFEC(config).Perform();
|
||||
webrtc::TestFEC().Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -105,21 +61,7 @@ TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestIsac)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_isac_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::ISACTest(ACM_TEST_MODE, config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestIsacNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_isac_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::ISACTest(ACM_TEST_MODE, config).Perform();
|
||||
webrtc::ISACTest(ACM_TEST_MODE).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -127,21 +69,7 @@ TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TwoWayCommunication)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_twowaycom_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::TwoWayCommunication(ACM_TEST_MODE, config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TwoWayCommunicationNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_twowaycom_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::TwoWayCommunication(ACM_TEST_MODE, config).Perform();
|
||||
webrtc::TwoWayCommunication(ACM_TEST_MODE).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -149,21 +77,7 @@ TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestStereo)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_stereo_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::TestStereo(ACM_TEST_MODE, config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestStereoNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_stereo_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::TestStereo(ACM_TEST_MODE, config).Perform();
|
||||
webrtc::TestStereo(ACM_TEST_MODE).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -171,21 +85,7 @@ TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestVADDTX)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_vaddtx_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::TestVADDTX(config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestVADDTXNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_vaddtx_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::TestVADDTX(config).Perform();
|
||||
webrtc::TestVADDTX().Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -193,21 +93,7 @@ TEST(AudioCodingModuleTest, TestOpus) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_opus_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::OpusTest(config).Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestOpusNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_opus_trace_new.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::OpusTest(config).Perform();
|
||||
webrtc::OpusTest().Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
|
||||
@ -218,14 +104,7 @@ TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestOpusNewACM)) {
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
||||
"acm_apitest_trace.txt").c_str());
|
||||
webrtc::Config config;
|
||||
|
||||
UseLegacyAcm(&config);
|
||||
webrtc::APITest(config).Perform();
|
||||
|
||||
UseNewAcm(&config);
|
||||
webrtc::APITest(config).Perform();
|
||||
|
||||
webrtc::APITest().Perform();
|
||||
Trace::ReturnTrace();
|
||||
}
|
||||
#endif
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/PCMFile.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/utility.h"
|
||||
@ -31,12 +30,12 @@ namespace webrtc {
|
||||
|
||||
#define MAX_FILE_NAME_LENGTH_BYTE 500
|
||||
|
||||
TwoWayCommunication::TwoWayCommunication(int testMode, const Config& config)
|
||||
: _acmA(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
_acmB(config.Get<AudioCodingModuleFactory>().Create(2)),
|
||||
_acmRefA(config.Get<AudioCodingModuleFactory>().Create(3)),
|
||||
_acmRefB(config.Get<AudioCodingModuleFactory>().Create(4)),
|
||||
_testMode(testMode) { }
|
||||
TwoWayCommunication::TwoWayCommunication(int testMode)
|
||||
: _acmA(AudioCodingModule::Create(1)),
|
||||
_acmB(AudioCodingModule::Create(2)),
|
||||
_acmRefA(AudioCodingModule::Create(3)),
|
||||
_acmRefB(AudioCodingModule::Create(4)),
|
||||
_testMode(testMode) {}
|
||||
|
||||
TwoWayCommunication::~TwoWayCommunication() {
|
||||
delete _channel_A2B;
|
||||
|
@ -20,11 +20,9 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class Config;
|
||||
|
||||
class TwoWayCommunication : public ACMTest {
|
||||
public:
|
||||
TwoWayCommunication(int testMode, const Config& config);
|
||||
explicit TwoWayCommunication(int testMode);
|
||||
~TwoWayCommunication();
|
||||
|
||||
void Perform();
|
||||
|
@ -35,7 +35,6 @@ DEFINE_string(input_file, "", "Input file, PCM16 32 kHz, optional.");
|
||||
DEFINE_int32(delay, 0, "Delay in millisecond.");
|
||||
DEFINE_int32(init_delay, 0, "Initial delay in millisecond.");
|
||||
DEFINE_bool(dtx, false, "Enable DTX at the sender side.");
|
||||
DEFINE_bool(acm2, false, "Run the test with ACM2.");
|
||||
DEFINE_bool(packet_loss, false, "Apply packet loss, c.f. Channel{.cc, .h}.");
|
||||
DEFINE_bool(fec, false, "Use Forward Error Correction (FEC).");
|
||||
|
||||
@ -64,9 +63,9 @@ struct TestSettings {
|
||||
|
||||
class DelayTest {
|
||||
public:
|
||||
explicit DelayTest(const Config& config)
|
||||
: acm_a_(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
acm_b_(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
DelayTest()
|
||||
: acm_a_(AudioCodingModule::Create(0)),
|
||||
acm_b_(AudioCodingModule::Create(1)),
|
||||
channel_a2b_(new Channel),
|
||||
test_cntr_(0),
|
||||
encoding_sample_rate_hz_(8000) {}
|
||||
@ -245,7 +244,6 @@ class DelayTest {
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
||||
webrtc::Config config;
|
||||
webrtc::TestSettings test_setting;
|
||||
strcpy(test_setting.codec.name, FLAGS_codec.c_str());
|
||||
|
||||
@ -266,13 +264,7 @@ int main(int argc, char* argv[]) {
|
||||
test_setting.acm.fec = FLAGS_fec;
|
||||
test_setting.packet_loss = FLAGS_packet_loss;
|
||||
|
||||
if (FLAGS_acm2) {
|
||||
webrtc::UseNewAcm(&config);
|
||||
} else {
|
||||
webrtc::UseLegacyAcm(&config);
|
||||
}
|
||||
|
||||
webrtc::DelayTest delay_test(config);
|
||||
webrtc::DelayTest delay_test;
|
||||
delay_test.Initialize();
|
||||
delay_test.Perform(&test_setting, 1, 240, "delay_test");
|
||||
return 0;
|
||||
|
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/PCMFile.h"
|
||||
@ -22,9 +21,10 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class DualStreamTest : public AudioPacketizationCallback {
|
||||
public:
|
||||
explicit DualStreamTest(const Config& config);
|
||||
class DualStreamTest : public AudioPacketizationCallback,
|
||||
public ::testing::Test {
|
||||
protected:
|
||||
DualStreamTest();
|
||||
~DualStreamTest();
|
||||
|
||||
void RunTest(int frame_size_primary_samples,
|
||||
@ -35,8 +35,6 @@ class DualStreamTest : public AudioPacketizationCallback {
|
||||
|
||||
void ApiTest();
|
||||
|
||||
protected:
|
||||
|
||||
int32_t SendData(FrameType frameType, uint8_t payload_type,
|
||||
uint32_t timestamp, const uint8_t* payload_data,
|
||||
uint16_t payload_size,
|
||||
@ -93,10 +91,10 @@ class DualStreamTest : public AudioPacketizationCallback {
|
||||
bool received_payload_[kMaxNumStreams];
|
||||
};
|
||||
|
||||
DualStreamTest::DualStreamTest(const Config& config)
|
||||
: acm_dual_stream_(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
acm_ref_primary_(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
acm_ref_secondary_(config.Get<AudioCodingModuleFactory>().Create(2)),
|
||||
DualStreamTest::DualStreamTest()
|
||||
: acm_dual_stream_(AudioCodingModule::Create(0)),
|
||||
acm_ref_primary_(AudioCodingModule::Create(1)),
|
||||
acm_ref_secondary_(AudioCodingModule::Create(2)),
|
||||
payload_ref_is_stored_(),
|
||||
payload_dual_is_stored_(),
|
||||
timestamp_ref_(),
|
||||
@ -388,17 +386,106 @@ int32_t DualStreamTest::SendData(FrameType frameType, uint8_t payload_type,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DualStreamTest::RunTest(int frame_size_primary_samples,
|
||||
int num_channels_primary,
|
||||
int sampling_rate,
|
||||
bool start_in_sync,
|
||||
int num_channels_input) {
|
||||
InitializeSender(
|
||||
frame_size_primary_samples, num_channels_primary, sampling_rate);
|
||||
Perform(start_in_sync, num_channels_input);
|
||||
};
|
||||
// Mono input, mono primary WB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb20Ms)) {
|
||||
InitializeSender(20, 1, 16000);
|
||||
Perform(true, 1);
|
||||
}
|
||||
|
||||
void DualStreamTest::ApiTest() {
|
||||
// Mono input, stereo primary WB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInput_StereoPrimaryWb20Ms)) {
|
||||
InitializeSender(20, 2, 16000);
|
||||
Perform(true, 1);
|
||||
}
|
||||
|
||||
// Mono input, mono primary SWB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimarySwb20Ms)) {
|
||||
InitializeSender(20, 1, 32000);
|
||||
Perform(true, 1);
|
||||
}
|
||||
|
||||
// Mono input, stereo primary SWB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimarySwb20Ms)) {
|
||||
InitializeSender(20, 2, 32000);
|
||||
Perform(true, 1);
|
||||
}
|
||||
|
||||
// Mono input, mono primary WB 40 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb40Ms)) {
|
||||
InitializeSender(40, 1, 16000);
|
||||
Perform(true, 1);
|
||||
}
|
||||
|
||||
// Mono input, stereo primary WB 40 ms frame
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimaryWb40Ms)) {
|
||||
InitializeSender(40, 2, 16000);
|
||||
Perform(true, 1);
|
||||
}
|
||||
|
||||
// Stereo input, mono primary WB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb20Ms)) {
|
||||
InitializeSender(20, 1, 16000);
|
||||
Perform(true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, stereo primary WB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb20Ms)) {
|
||||
InitializeSender(20, 2, 16000);
|
||||
Perform(true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, mono primary SWB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimarySwb20Ms)) {
|
||||
InitializeSender(20, 1, 32000);
|
||||
Perform(true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, stereo primary SWB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimarySwb20Ms)) {
|
||||
InitializeSender(20, 2, 32000);
|
||||
Perform(true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, mono primary WB 40 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb40Ms)) {
|
||||
InitializeSender(40, 1, 16000);
|
||||
Perform(true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, stereo primary WB 40 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb40Ms)) {
|
||||
InitializeSender(40, 2, 16000);
|
||||
Perform(true, 2);
|
||||
}
|
||||
|
||||
// Asynchronous test, ACM is fed with data then secondary coder is registered.
|
||||
// Mono input, mono primary WB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb20Ms)) {
|
||||
InitializeSender(20, 1, 16000);
|
||||
Perform(false, 1);
|
||||
}
|
||||
|
||||
// Mono input, mono primary WB 20 ms frame.
|
||||
TEST_F(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb40Ms)) {
|
||||
InitializeSender(40, 1, 16000);
|
||||
Perform(false, 1);
|
||||
}
|
||||
|
||||
TEST_F(DualStreamTest, DISABLED_ON_ANDROID(Api)) {
|
||||
PopulateCodecInstances(20, 1, 16000);
|
||||
CodecInst my_codec;
|
||||
ASSERT_EQ(0, acm_dual_stream_->InitializeSender());
|
||||
@ -449,171 +536,4 @@ void DualStreamTest::ApiTest() {
|
||||
EXPECT_EQ(VADVeryAggr, vad_mode);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
DualStreamTest* CreateLegacy() {
|
||||
Config config;
|
||||
UseLegacyAcm(&config);
|
||||
DualStreamTest* test = new DualStreamTest(config);
|
||||
return test;
|
||||
}
|
||||
|
||||
DualStreamTest* CreateNew() {
|
||||
Config config;
|
||||
UseNewAcm(&config);
|
||||
DualStreamTest* test = new DualStreamTest(config);
|
||||
return test;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// Mono input, mono primary WB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 1, 16000, true, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 1, 16000, true, 1);
|
||||
}
|
||||
|
||||
// Mono input, stereo primary WB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInput_StereoPrimaryWb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 2, 16000, true, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 2, 16000, true, 1);
|
||||
}
|
||||
|
||||
// Mono input, mono primary SWB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimarySwb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 1, 32000, true, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 1, 32000, true, 1);
|
||||
}
|
||||
|
||||
// Mono input, stereo primary SWB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimarySwb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 2, 32000, true, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 2, 32000, true, 1);
|
||||
}
|
||||
|
||||
// Mono input, mono primary WB 40 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb40Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateNew());
|
||||
test->RunTest(40, 1, 16000, true, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(40, 1, 16000, true, 1);
|
||||
}
|
||||
|
||||
// Mono input, stereo primary WB 40 ms frame
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimaryWb40Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateNew());
|
||||
test->RunTest(40, 2, 16000, true, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(40, 2, 16000, true, 1);
|
||||
}
|
||||
|
||||
// Stereo input, mono primary WB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 1, 16000, true, 2);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 1, 16000, true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, stereo primary WB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 2, 16000, true, 2);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 2, 16000, true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, mono primary SWB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimarySwb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 1, 32000, true, 2);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 1, 32000, true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, stereo primary SWB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimarySwb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 2, 32000, true, 2);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 2, 32000, true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, mono primary WB 40 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb40Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(40, 1, 16000, true, 2);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(40, 1, 16000, true, 2);
|
||||
}
|
||||
|
||||
// Stereo input, stereo primary WB 40 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb40Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(40, 2, 16000, true, 2);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(40, 2, 16000, true, 2);
|
||||
}
|
||||
|
||||
// Asynchronous test, ACM is fed with data then secondary coder is registered.
|
||||
// Mono input, mono primary WB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb20Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(20, 1, 16000, false, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(20, 1, 16000, false, 1);
|
||||
}
|
||||
|
||||
// Mono input, mono primary WB 20 ms frame.
|
||||
TEST(DualStreamTest,
|
||||
DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb40Ms)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->RunTest(40, 1, 16000, false, 1);
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RunTest(40, 1, 16000, false, 1);
|
||||
}
|
||||
|
||||
TEST(DualStreamTest, DISABLED_ON_ANDROID(ApiTest)) {
|
||||
scoped_ptr<DualStreamTest> test(CreateLegacy());
|
||||
test->ApiTest();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->ApiTest();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -86,11 +86,10 @@ int16_t SetISAConfig(ACMTestISACConfig& isacConfig, AudioCodingModule* acm,
|
||||
return 0;
|
||||
}
|
||||
|
||||
ISACTest::ISACTest(int testMode, const Config& config)
|
||||
: _acmA(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
_acmB(config.Get<AudioCodingModuleFactory>().Create(2)),
|
||||
_testMode(testMode) {
|
||||
}
|
||||
ISACTest::ISACTest(int testMode)
|
||||
: _acmA(AudioCodingModule::Create(1)),
|
||||
_acmB(AudioCodingModule::Create(2)),
|
||||
_testMode(testMode) {}
|
||||
|
||||
ISACTest::~ISACTest() {}
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/ACMTest.h"
|
||||
@ -27,8 +26,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class Config;
|
||||
|
||||
struct ACMTestISACConfig {
|
||||
int32_t currentRateBitPerSec;
|
||||
int16_t currentFrameSizeMsec;
|
||||
@ -42,7 +39,7 @@ struct ACMTestISACConfig {
|
||||
|
||||
class ISACTest : public ACMTest {
|
||||
public:
|
||||
ISACTest(int testMode, const Config& config);
|
||||
explicit ISACTest(int testMode);
|
||||
~ISACTest();
|
||||
|
||||
void Perform();
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
|
||||
@ -44,11 +43,11 @@ double FrameRms(AudioFrame& frame) {
|
||||
|
||||
}
|
||||
|
||||
class InitialPlayoutDelayTest {
|
||||
public:
|
||||
explicit InitialPlayoutDelayTest(const Config& config)
|
||||
: acm_a_(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
acm_b_(config.Get<AudioCodingModuleFactory>().Create(1)),
|
||||
class InitialPlayoutDelayTest : public ::testing::Test {
|
||||
protected:
|
||||
InitialPlayoutDelayTest()
|
||||
: acm_a_(AudioCodingModule::Create(0)),
|
||||
acm_b_(AudioCodingModule::Create(1)),
|
||||
channel_a2b_(NULL) {}
|
||||
|
||||
~InitialPlayoutDelayTest() {
|
||||
@ -162,72 +161,16 @@ class InitialPlayoutDelayTest {
|
||||
Channel* channel_a2b_;
|
||||
};
|
||||
|
||||
namespace {
|
||||
TEST_F(InitialPlayoutDelayTest, NbMono) { NbMono(); }
|
||||
|
||||
InitialPlayoutDelayTest* CreateLegacy() {
|
||||
Config config;
|
||||
UseLegacyAcm(&config);
|
||||
InitialPlayoutDelayTest* test = new InitialPlayoutDelayTest(config);
|
||||
test->SetUp();
|
||||
return test;
|
||||
}
|
||||
TEST_F(InitialPlayoutDelayTest, WbMono) { WbMono(); }
|
||||
|
||||
InitialPlayoutDelayTest* CreateNew() {
|
||||
Config config;
|
||||
UseNewAcm(&config);
|
||||
InitialPlayoutDelayTest* test = new InitialPlayoutDelayTest(config);
|
||||
test->SetUp();
|
||||
return test;
|
||||
}
|
||||
TEST_F(InitialPlayoutDelayTest, SwbMono) { SwbMono(); }
|
||||
|
||||
} // namespace
|
||||
TEST_F(InitialPlayoutDelayTest, NbStereo) { NbStereo(); }
|
||||
|
||||
TEST(InitialPlayoutDelayTest, NbMono) {
|
||||
scoped_ptr<InitialPlayoutDelayTest> test(CreateLegacy());
|
||||
test->NbMono();
|
||||
TEST_F(InitialPlayoutDelayTest, WbStereo) { WbStereo(); }
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->NbMono();
|
||||
}
|
||||
|
||||
TEST(InitialPlayoutDelayTest, WbMono) {
|
||||
scoped_ptr<InitialPlayoutDelayTest> test(CreateLegacy());
|
||||
test->WbMono();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->WbMono();
|
||||
}
|
||||
|
||||
TEST(InitialPlayoutDelayTest, SwbMono) {
|
||||
scoped_ptr<InitialPlayoutDelayTest> test(CreateLegacy());
|
||||
test->SwbMono();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->SwbMono();
|
||||
}
|
||||
|
||||
TEST(InitialPlayoutDelayTest, NbStereo) {
|
||||
scoped_ptr<InitialPlayoutDelayTest> test(CreateLegacy());
|
||||
test->NbStereo();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->NbStereo();
|
||||
}
|
||||
|
||||
TEST(InitialPlayoutDelayTest, WbStereo) {
|
||||
scoped_ptr<InitialPlayoutDelayTest> test(CreateLegacy());
|
||||
test->WbStereo();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->WbStereo();
|
||||
}
|
||||
|
||||
TEST(InitialPlayoutDelayTest, SwbStereo) {
|
||||
scoped_ptr<InitialPlayoutDelayTest> test(CreateLegacy());
|
||||
test->SwbStereo();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->SwbStereo();
|
||||
}
|
||||
TEST_F(InitialPlayoutDelayTest, SwbStereo) { SwbStereo(); }
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -15,13 +15,12 @@
|
||||
#include <string>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/common.h" // Config.
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/opus/interface/opus_interface.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
|
||||
#include "webrtc/modules/audio_coding/main/source/acm_codec_database.h"
|
||||
#include "webrtc/modules/audio_coding/main/source/acm_opus.h"
|
||||
#include "webrtc/modules/audio_coding/main/acm2/acm_codec_database.h"
|
||||
#include "webrtc/modules/audio_coding/main/acm2/acm_opus.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/TestStereo.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/utility.h"
|
||||
#include "webrtc/system_wrappers/interface/trace.h"
|
||||
@ -29,13 +28,12 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
OpusTest::OpusTest(const Config& config)
|
||||
: acm_receiver_(config.Get<AudioCodingModuleFactory>().Create(0)),
|
||||
OpusTest::OpusTest()
|
||||
: acm_receiver_(AudioCodingModule::Create(0)),
|
||||
channel_a2b_(NULL),
|
||||
counter_(0),
|
||||
payload_type_(255),
|
||||
rtp_timestamp_(0) {
|
||||
}
|
||||
rtp_timestamp_(0) {}
|
||||
|
||||
OpusTest::~OpusTest() {
|
||||
if (channel_a2b_ != NULL) {
|
||||
@ -254,11 +252,12 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate,
|
||||
}
|
||||
|
||||
// If input audio is sampled at 32 kHz, resampling to 48 kHz is required.
|
||||
EXPECT_EQ(480, resampler_.Resample10Msec(audio_frame.data_,
|
||||
audio_frame.sample_rate_hz_,
|
||||
&audio[written_samples],
|
||||
48000,
|
||||
channels));
|
||||
EXPECT_EQ(480,
|
||||
resampler_.Resample10Msec(audio_frame.data_,
|
||||
audio_frame.sample_rate_hz_,
|
||||
48000,
|
||||
channels,
|
||||
&audio[written_samples]));
|
||||
written_samples += 480 * channels;
|
||||
|
||||
// Sometimes we need to loop over the audio vector to produce the right
|
||||
|
@ -13,8 +13,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "webrtc/modules/audio_coding/main/source/acm_opus.h"
|
||||
#include "webrtc/modules/audio_coding/main/source/acm_resampler.h"
|
||||
#include "webrtc/modules/audio_coding/main/acm2/acm_opus.h"
|
||||
#include "webrtc/modules/audio_coding/main/acm2/acm_resampler.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/Channel.h"
|
||||
#include "webrtc/modules/audio_coding/main/test/PCMFile.h"
|
||||
@ -23,11 +23,9 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class Config;
|
||||
|
||||
class OpusTest : public ACMTest {
|
||||
public:
|
||||
explicit OpusTest(const Config& config);
|
||||
OpusTest();
|
||||
~OpusTest();
|
||||
|
||||
void Perform();
|
||||
@ -47,7 +45,7 @@ class OpusTest : public ACMTest {
|
||||
int counter_;
|
||||
uint8_t payload_type_;
|
||||
int rtp_timestamp_;
|
||||
acm1::ACMResampler resampler_;
|
||||
acm2::ACMResampler resampler_;
|
||||
WebRtcOpusEncInst* opus_mono_encoder_;
|
||||
WebRtcOpusEncInst* opus_stereo_encoder_;
|
||||
WebRtcOpusDecInst* opus_mono_decoder_;
|
||||
|
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/pcm16b/include/pcm16b.h"
|
||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
||||
@ -22,11 +21,9 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
class TargetDelayTest {
|
||||
public:
|
||||
explicit TargetDelayTest(const Config& config)
|
||||
: acm_(config.Get<AudioCodingModuleFactory>().Create(0)) {}
|
||||
class TargetDelayTest : public ::testing::Test {
|
||||
protected:
|
||||
TargetDelayTest() : acm_(AudioCodingModule::Create(0)) {}
|
||||
|
||||
~TargetDelayTest() {}
|
||||
|
||||
@ -202,65 +199,24 @@ class TargetDelayTest {
|
||||
uint8_t payload_[kPayloadLenBytes];
|
||||
};
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
TargetDelayTest* CreateLegacy() {
|
||||
Config config;
|
||||
UseLegacyAcm(&config);
|
||||
TargetDelayTest* test = new TargetDelayTest(config);
|
||||
test->SetUp();
|
||||
return test;
|
||||
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(OutOfRangeInput)) {
|
||||
OutOfRangeInput();
|
||||
}
|
||||
|
||||
TargetDelayTest* CreateNew() {
|
||||
Config config;
|
||||
UseNewAcm(&config);
|
||||
TargetDelayTest* test = new TargetDelayTest(config);
|
||||
test->SetUp();
|
||||
return test;
|
||||
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(NoTargetDelayBufferSizeChanges)) {
|
||||
NoTargetDelayBufferSizeChanges();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST(TargetDelayTest, DISABLED_ON_ANDROID(OutOfRangeInput)) {
|
||||
scoped_ptr<TargetDelayTest> test(CreateLegacy());
|
||||
test->OutOfRangeInput();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->OutOfRangeInput();
|
||||
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(WithTargetDelayBufferNotChanging)) {
|
||||
WithTargetDelayBufferNotChanging();
|
||||
}
|
||||
|
||||
TEST(TargetDelayTest, DISABLED_ON_ANDROID(NoTargetDelayBufferSizeChanges)) {
|
||||
scoped_ptr<TargetDelayTest> test(CreateLegacy());
|
||||
test->NoTargetDelayBufferSizeChanges();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->NoTargetDelayBufferSizeChanges();
|
||||
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(RequiredDelayAtCorrectRange)) {
|
||||
RequiredDelayAtCorrectRange();
|
||||
}
|
||||
|
||||
TEST(TargetDelayTest, DISABLED_ON_ANDROID(WithTargetDelayBufferNotChanging)) {
|
||||
scoped_ptr<TargetDelayTest> test(CreateLegacy());
|
||||
test->WithTargetDelayBufferNotChanging();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->WithTargetDelayBufferNotChanging();
|
||||
}
|
||||
|
||||
TEST(TargetDelayTest, DISABLED_ON_ANDROID(RequiredDelayAtCorrectRange)) {
|
||||
scoped_ptr<TargetDelayTest> test(CreateLegacy());
|
||||
test->RequiredDelayAtCorrectRange();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->RequiredDelayAtCorrectRange();
|
||||
}
|
||||
|
||||
TEST(TargetDelayTest, DISABLED_ON_ANDROID(TargetDelayBufferMinMax)) {
|
||||
scoped_ptr<TargetDelayTest> test(CreateLegacy());
|
||||
test->TargetDelayBufferMinMax();
|
||||
|
||||
test.reset(CreateNew());
|
||||
test->TargetDelayBufferMinMax();
|
||||
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(TargetDelayBufferMinMax)) {
|
||||
TargetDelayBufferMinMax();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -330,14 +330,4 @@ int32_t VADCallback::InFrameType(int16_t frameType) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UseLegacyAcm(webrtc::Config* config) {
|
||||
config->Set<webrtc::AudioCodingModuleFactory>(
|
||||
new webrtc::AudioCodingModuleFactory());
|
||||
}
|
||||
|
||||
void UseNewAcm(webrtc::Config* config) {
|
||||
config->Set<webrtc::AudioCodingModuleFactory>(
|
||||
new webrtc::NewAudioCodingModuleFactory());
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
Loading…
x
Reference in New Issue
Block a user