diff --git a/src/voice_engine/main/test/auto_test/voe_extended_test.cc b/src/voice_engine/main/test/auto_test/voe_extended_test.cc index 5a3f11b8ae..df9578cc4f 100644 --- a/src/voice_engine/main/test/auto_test/voe_extended_test.cc +++ b/src/voice_engine/main/test/auto_test/voe_extended_test.cc @@ -259,51 +259,51 @@ VoEExtendedTest::~VoEExtendedTest() { void VoEExtendedTest::StartMedia(int channel, int rtpPort, bool listen, bool playout, bool send) { - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); _listening[channel] = false; _playing[channel] = false; _sending[channel] = false; - base->SetLocalReceiver(channel, rtpPort); - base->SetSendDestination(channel, rtpPort, "127.0.0.1"); + voe_base_->SetLocalReceiver(channel, rtpPort); + voe_base_->SetSendDestination(channel, rtpPort, "127.0.0.1"); if (listen) { _listening[channel] = true; - base->StartReceive(channel); + voe_base_->StartReceive(channel); } if (playout) { _playing[channel] = true; - base->StartPlayout(channel); + voe_base_->StartPlayout(channel); } if (send) { _sending[channel] = true; - base->StartSend(channel); + voe_base_->StartSend(channel); } } void VoEExtendedTest::StopMedia(int channel) { - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); if (_listening[channel]) { _listening[channel] = false; - base->StopReceive(channel); + voe_base_->StopReceive(channel); } if (_playing[channel]) { _playing[channel] = false; - base->StopPlayout(channel); + voe_base_->StopPlayout(channel); } if (_sending[channel]) { _sending[channel] = false; - base->StopSend(channel); + voe_base_->StopSend(channel); } } void VoEExtendedTest::Play(int channel, unsigned int timeMillisec, bool addFileAsMicrophone, bool addTimeMarker) { - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEFile* file = _mgr.FilePtr(); - base->StartPlayout(channel); + voe_base_->StartPlayout(channel); TEST_LOG("[playing]"); fflush(NULL); if (addFileAsMicrophone) { @@ -317,7 +317,7 @@ void VoEExtendedTest::Play(int channel, unsigned int timeMillisec, bool addFileA fflush(NULL); // print sleep time in seconds } SLEEP(timeMillisec); - base->StopPlayout(channel); + voe_base_->StopPlayout(channel); file->StopPlayingFileAsMicrophone(channel); } @@ -338,7 +338,11 @@ int VoEExtendedTest::TestBase() { PrepareTest("Base"); - VoEBase* base = _mgr.BasePtr(); + // TODO(qhogpat): make this an actual instance variable. I think the + // macro black magic will make more sense then. This is named like an + // instance variable since it is required in order to appease the + // gods of darkness. + VoEBase* voe_base_ = _mgr.BasePtr(); VoENetwork* netw = _mgr.NetworkPtr(); #ifdef _TEST_RTP_RTCP_ VoERTP_RTCP* rtp = _mgr.RTP_RTCPPtr(); @@ -375,10 +379,10 @@ int VoEExtendedTest::TestBase() { TEST(SetObserver); ANL(); - TEST_MUSTPASS(base->RegisterVoiceEngineObserver(*this)); + TEST_MUSTPASS(voe_base_->RegisterVoiceEngineObserver(*this)); MARK(); SLEEP(100); - TEST_MUSTPASS(base->DeRegisterVoiceEngineObserver()); + TEST_MUSTPASS(voe_base_->DeRegisterVoiceEngineObserver()); MARK(); ANL(); @@ -394,7 +398,7 @@ int VoEExtendedTest::TestBase() { char version[1024]; // audio device module and AudioProcessing fail to getversion when they // are not initiliazed - TEST_MUSTPASS(base->GetVersion(version)); + TEST_MUSTPASS(voe_base_->GetVersion(version)); MARK(); TEST_LOG("\n-----\n%s\n-----\n", version); @@ -408,22 +412,22 @@ int VoEExtendedTest::TestBase() { TEST(Init); ANL(); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); MARK(); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); MARK(); // ensure that no new memory is allocated at the second call (check // trace file) - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); MARK(); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) // verify AEC recording - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); MARK(); // verify output dat-files - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); #endif ANL(); @@ -435,10 +439,10 @@ int VoEExtendedTest::TestBase() { // Terminate TEST(Terminate); ANL(); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); MARK(); // should be ignored - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->Terminate()); MARK(); // should terminate ANL(); @@ -467,9 +471,9 @@ int VoEExtendedTest::TestBase() { ASSERT_TRUE(xADM->ReferenceCounter() == 1); // Verify default usage case for external ADM. - TEST_MUSTPASS(base->Init(xADM));MARK(); + TEST_MUSTPASS(voe_base_->Init(xADM));MARK(); ASSERT_TRUE(xADM->ReferenceCounter() == 2); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); ASSERT_TRUE(xADM->ReferenceCounter() == 1); // Our reference-count implementation does not self destruct. @@ -485,7 +489,7 @@ int VoEExtendedTest::TestBase() { // MaxNumOfChannels TEST(MaxNumOfChannels); ANL(); - TEST_MUSTPASS(base->MaxNumOfChannels() < 0); + TEST_MUSTPASS(voe_base_->MaxNumOfChannels() < 0); MARK(); ANL(); AOK(); @@ -498,60 +502,60 @@ int VoEExtendedTest::TestBase() { int i; int channel; - int nChannels(base->MaxNumOfChannels()); + int nChannels(voe_base_->MaxNumOfChannels()); TEST(CreateChannel); ANL(); TEST(DeleteChannel); ANL(); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); - channel = base->CreateChannel(); + channel = voe_base_->CreateChannel(); MARK(); TEST_MUSTPASS(channel != 0); - channel = base->CreateChannel(); + channel = voe_base_->CreateChannel(); MARK(); TEST_MUSTPASS(channel != 1); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); MARK(); - TEST_MUSTPASS(base->DeleteChannel(1)); + TEST_MUSTPASS(voe_base_->DeleteChannel(1)); MARK(); // create and delete one channel many times for (i = 0; i < 10; i++) { - channel = base->CreateChannel(); + channel = voe_base_->CreateChannel(); MARK(); TEST_MUSTPASS(channel != 0); // should be 0 each time - TEST_MUSTPASS(base->DeleteChannel(channel)); + TEST_MUSTPASS(voe_base_->DeleteChannel(channel)); MARK(); } // create max number of channels for (i = 0; i < nChannels; i++) { - channel = base->CreateChannel(); + channel = voe_base_->CreateChannel(); MARK(); TEST_MUSTPASS(channel != i); } - channel = base->CreateChannel(); + channel = voe_base_->CreateChannel(); MARK(); // should fail since no more channels can now be created TEST_MUSTPASS(channel != -1); int aChannel = (((nChannels - 17) > 0) ? (nChannels - 17) : 0); - TEST_MUSTPASS(base->DeleteChannel(aChannel)); + TEST_MUSTPASS(voe_base_->DeleteChannel(aChannel)); MARK(); - channel = base->CreateChannel(); + channel = voe_base_->CreateChannel(); MARK(); // should reuse channel TEST_MUSTPASS(channel != aChannel); // delete all created channels for (i = 0; i < nChannels; i++) { - TEST_MUSTPASS(base->DeleteChannel(i)); + TEST_MUSTPASS(voe_base_->DeleteChannel(i)); MARK(); } // try to delete a non-existing channel - TEST_MUSTPASS(-1 != base->DeleteChannel(aChannel)); + TEST_MUSTPASS(-1 != voe_base_->DeleteChannel(aChannel)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); @@ -564,7 +568,7 @@ int VoEExtendedTest::TestBase() { // >> SetLocalReceiver // // State: VE not initialized, no existing channels - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); int ch; @@ -572,11 +576,11 @@ int VoEExtendedTest::TestBase() { ANL(); // no channel created yet => should fail - TEST_MUSTPASS(!base->SetLocalReceiver(0, 100)); + TEST_MUSTPASS(!voe_base_->SetLocalReceiver(0, 100)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); #ifdef MAC_IPHONE printf("\nNOTE: Local IP must be set in source code (line %d) \n", @@ -591,53 +595,53 @@ int VoEExtendedTest::TestBase() { #endif // trivial invalid function calls - TEST_MUSTPASS(!base->SetLocalReceiver(ch+1, 12345)); + TEST_MUSTPASS(!voe_base_->SetLocalReceiver(ch+1, 12345)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(!base->SetLocalReceiver(ch, -1)); + TEST_MUSTPASS(!voe_base_->SetLocalReceiver(ch, -1)); MARK(); TEST_ERROR(VE_INVALID_PORT_NMBR); // check conflict with ongoing receiving - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); MARK(); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(!base->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(!voe_base_->SetLocalReceiver(ch, 12345)); MARK(); TEST_ERROR(VE_ALREADY_LISTENING); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); // check conflict with ongoing transmission - TEST_MUSTPASS(base->SetSendDestination(ch, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); - TEST_MUSTPASS(!base->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartSend(ch)); + TEST_MUSTPASS(!voe_base_->SetLocalReceiver(ch, 12345)); MARK(); TEST_ERROR(VE_ALREADY_SENDING); - TEST_MUSTPASS(base->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); // valid function calls // Need to sleep between, otherwise it may fail for unknown reason - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345, kVoEDefault, localIp)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345, kVoEDefault, localIp)); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345, kVoEDefault, NULL, + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345, kVoEDefault, NULL, "230.1.2.3")); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345, kVoEDefault, localIp, + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345, kVoEDefault, localIp, "230.1.2.3")); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345, 5555, NULL)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345, 5555, NULL)); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); MARK(); SLEEP(100); @@ -647,22 +651,22 @@ int VoEExtendedTest::TestBase() { // Add some dynamic tests as well: // ensure that last setting is used (cancels old settings) - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 44444)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 44444)); MARK(); SLEEP(100); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 54321)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 54321)); MARK(); - TEST_MUSTPASS(base->SetSendDestination(ch, 54321, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 54321, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); Play(ch, 1000, true, true); - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); - TEST_MUSTPASS(base->DeleteChannel(ch)); + TEST_MUSTPASS(voe_base_->DeleteChannel(ch)); ANL(); AOK(); @@ -683,38 +687,38 @@ int VoEExtendedTest::TestBase() { char ipaddr[64]; int RTCPport; - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); // verify non-configured (blank) local receiver - TEST_MUSTPASS(base->GetLocalReceiver(ch, port, RTCPport, ipaddr)); + TEST_MUSTPASS(voe_base_->GetLocalReceiver(ch, port, RTCPport, ipaddr)); MARK(); TEST_MUSTPASS(port != 0); TEST_MUSTPASS(RTCPport != 0); TEST_MUSTPASS(strcmp(ipaddr, "") != 0); // check some trivial set/get combinations - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)) - TEST_MUSTPASS(base->GetLocalReceiver(ch, port, RTCPport, ipaddr)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)) + TEST_MUSTPASS(voe_base_->GetLocalReceiver(ch, port, RTCPport, ipaddr)); MARK(); TEST_MUSTPASS(port != 12345); TEST_MUSTPASS(RTCPport != 12346); TEST_MUSTPASS(strcmp(ipaddr, "0.0.0.0") != 0); // now binded to "any" IP - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345, 55555)) - TEST_MUSTPASS(base->GetLocalReceiver(ch, port, RTCPport, ipaddr)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345, 55555)) + TEST_MUSTPASS(voe_base_->GetLocalReceiver(ch, port, RTCPport, ipaddr)); MARK(); TEST_MUSTPASS(port != 12345); TEST_MUSTPASS(RTCPport != 55555); TEST_MUSTPASS(strcmp(ipaddr, "0.0.0.0") != 0); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345, kVoEDefault, localIp)) - TEST_MUSTPASS(base->GetLocalReceiver(ch, port, RTCPport, ipaddr)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345, kVoEDefault, localIp)) + TEST_MUSTPASS(voe_base_->GetLocalReceiver(ch, port, RTCPport, ipaddr)); MARK(); TEST_MUSTPASS(port != 12345); TEST_MUSTPASS(RTCPport != 12346); TEST_MUSTPASS(strcmp(ipaddr, localIp) != 0); - TEST_MUSTPASS(base->DeleteChannel(ch)); + TEST_MUSTPASS(voe_base_->DeleteChannel(ch)); ANL(); AOK(); @@ -732,62 +736,62 @@ int VoEExtendedTest::TestBase() { ANL(); // call without existing channel - TEST_MUSTPASS(!base->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(!voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); // trivial fail tests - TEST_MUSTPASS(!base->SetSendDestination(ch, 65536, "127.0.0.1")); + TEST_MUSTPASS(!voe_base_->SetSendDestination(ch, 65536, "127.0.0.1")); MARK(); TEST_ERROR(VE_INVALID_PORT_NMBR); // invalid RTP port - TEST_MUSTPASS(!base->SetSendDestination(ch, 12345, "127.0.0.1", 65536)); + TEST_MUSTPASS(!voe_base_->SetSendDestination(ch, 12345, "127.0.0.1", 65536)); MARK(); TEST_ERROR(VE_INVALID_PORT_NMBR); // invalid source port - TEST_MUSTPASS(!base->SetSendDestination(ch, 12345, "127.0.0.1", kVoEDefault, + TEST_MUSTPASS(!voe_base_->SetSendDestination(ch, 12345, "127.0.0.1", kVoEDefault, 65536)); MARK(); TEST_ERROR(VE_INVALID_PORT_NMBR); // invalid RTCP port - TEST_MUSTPASS(!base->SetSendDestination(ch, 12345, "127.0.0.300")); + TEST_MUSTPASS(!voe_base_->SetSendDestination(ch, 12345, "127.0.0.300")); MARK(); TEST_ERROR(VE_INVALID_IP_ADDRESS); // invalid IP address // sockets must be created first to support multi-cast (not required // otherwise) - TEST_MUSTPASS(!base->SetSendDestination(ch, 55555, "230.0.0.1")); + TEST_MUSTPASS(!voe_base_->SetSendDestination(ch, 55555, "230.0.0.1")); MARK(); TEST_ERROR(VE_SOCKET_ERROR); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 55555)); // create sockets - TEST_MUSTPASS(base->SetSendDestination(ch, 55555, "230.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 55555)); // create sockets + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 55555, "230.0.0.1")); MARK(); // should work now - base->DeleteChannel(0); - ch = base->CreateChannel(); + voe_base_->DeleteChannel(0); + ch = voe_base_->CreateChannel(); // STATE: one channel created, no sockets exist // valid function calls - TEST_MUSTPASS(base->SetSendDestination(ch, 33333, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33333, "127.0.0.1")); MARK(); - TEST_MUSTPASS(base->SetSendDestination(ch, 33333, "127.0.0.1", 44444)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33333, "127.0.0.1", 44444)); MARK(); - TEST_MUSTPASS(base->SetSendDestination(ch, 33333, "127.0.0.1", kVoEDefault, + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33333, "127.0.0.1", kVoEDefault, 55555)); MARK(); - TEST_MUSTPASS(base->SetSendDestination(ch, 33333, "127.0.0.1", 44444, + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33333, "127.0.0.1", 44444, 55555)); MARK(); - base->DeleteChannel(0); - ch = base->CreateChannel(); + voe_base_->DeleteChannel(0); + ch = voe_base_->CreateChannel(); // create receive sockets first and then an extra pair of send sockets - TEST_MUSTPASS(base->SetLocalReceiver(ch, 44444)); - TEST_MUSTPASS(base->SetSendDestination(ch, 44444, "127.0.0.1", 11111)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 44444)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 44444, "127.0.0.1", 11111)); MARK(); // binds to 11111 - TEST_MUSTPASS(base->DeleteChannel(ch)); + TEST_MUSTPASS(voe_base_->DeleteChannel(ch)); ANL(); AOK(); @@ -806,10 +810,10 @@ int VoEExtendedTest::TestBase() { int sourcePort; - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); // verify non-configured (blank) local receiver - TEST_MUSTPASS(base->GetSendDestination(ch, port, ipaddr, sourcePort, + TEST_MUSTPASS(voe_base_->GetSendDestination(ch, port, ipaddr, sourcePort, RTCPport)); MARK(); TEST_MUSTPASS(port != 0); @@ -818,8 +822,8 @@ int VoEExtendedTest::TestBase() { TEST_MUSTPASS(strcmp(ipaddr, "") != 0); // check some trivial set/get combinations - TEST_MUSTPASS(base->SetSendDestination(ch, 44444, "127.0.0.1")); - TEST_MUSTPASS(base->GetSendDestination(ch, port, ipaddr, sourcePort, + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 44444, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->GetSendDestination(ch, port, ipaddr, sourcePort, RTCPport)); MARK(); TEST_MUSTPASS(port != 44444); @@ -828,8 +832,8 @@ int VoEExtendedTest::TestBase() { TEST_MUSTPASS(RTCPport != 44445); TEST_MUSTPASS(strcmp(ipaddr, "127.0.0.1") != 0); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 55555)); - TEST_MUSTPASS(base->GetSendDestination(ch, port, ipaddr, sourcePort, + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 55555)); + TEST_MUSTPASS(voe_base_->GetSendDestination(ch, port, ipaddr, sourcePort, RTCPport)); MARK(); TEST_MUSTPASS(port != 44444); @@ -837,19 +841,19 @@ int VoEExtendedTest::TestBase() { TEST_MUSTPASS(RTCPport != 44445); TEST_MUSTPASS(strcmp(ipaddr, "127.0.0.1") != 0); - base->DeleteChannel(0); - ch = base->CreateChannel(); + voe_base_->DeleteChannel(0); + ch = voe_base_->CreateChannel(); - TEST_MUSTPASS(base->SetSendDestination(ch, 44444, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 44444, "127.0.0.1")); // NULL as IP-address input should work as well - TEST_MUSTPASS(base->GetSendDestination(ch, port, NULL, sourcePort, + TEST_MUSTPASS(voe_base_->GetSendDestination(ch, port, NULL, sourcePort, RTCPport)); MARK(); TEST_MUSTPASS(port != 44444); TEST_MUSTPASS(sourcePort != 0); TEST_MUSTPASS(RTCPport != 44445); - TEST_MUSTPASS(base->DeleteChannel(ch)); + TEST_MUSTPASS(voe_base_->DeleteChannel(ch)); ANL(); AOK(); @@ -870,81 +874,81 @@ int VoEExtendedTest::TestBase() { ANL(); // call without existing channel - TEST_MUSTPASS(!base->StartReceive(0)); + TEST_MUSTPASS(!voe_base_->StartReceive(0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(!base->StopReceive(0)); + TEST_MUSTPASS(!voe_base_->StopReceive(0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); // sockets must be created first - TEST_MUSTPASS(!base->StartReceive(0)); + TEST_MUSTPASS(!voe_base_->StartReceive(0)); MARK(); TEST_ERROR(VE_SOCKETS_NOT_INITED); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 55555)); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 55555)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); MARK(); // should work this time // enable again (should work) - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); MARK(); // Stop/Start (should work) - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); MARK(); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); MARK(); // Verify in loopback - TEST_MUSTPASS(base->SetSendDestination(ch, 55555, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 55555, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartSend(ch)); Play(ch, 1000, true, true); - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); MARK(); - base->DeleteChannel(0); - ch = base->CreateChannel(); + voe_base_->DeleteChannel(0); + ch = voe_base_->CreateChannel(); // Ensure that it is OK to add delay between SetLocalReceiver and StarListen TEST_LOG("\nspeak after 2 seconds and ensure that no delay is added:\n"); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 55555)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 55555)); Sleep(2000, true); // adding emulated delay here - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->SetSendDestination(ch, 55555, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 55555, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartSend(ch)); Play(ch, 2000, true, true); - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(ch)); + TEST_MUSTPASS(voe_base_->DeleteChannel(ch)); ANL(); // Multi-channel tests - for (i = 0; i < base->MaxNumOfChannels(); i++) { - ch = base->CreateChannel(); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 11111+2*i)); - TEST_MUSTPASS(base->StartReceive(ch)); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 11111+2*i)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); MARK(); } - for (i = 0; i < base->MaxNumOfChannels(); i++) { - TEST_MUSTPASS(base->StopReceive(i)); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + TEST_MUSTPASS(voe_base_->StopReceive(i)); MARK(); - base->DeleteChannel(i); + voe_base_->DeleteChannel(i); } - for (i = 0; i < base->MaxNumOfChannels(); i++) { - ch = base->CreateChannel(); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 11111+2*i)); - TEST_MUSTPASS(base->StartReceive(ch)); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 11111+2*i)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); MARK(); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); MARK(); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); } ANL(); @@ -966,46 +970,46 @@ int VoEExtendedTest::TestBase() { ANL(); // call without existing channel - TEST_MUSTPASS(!base->StartPlayout(0)); + TEST_MUSTPASS(!voe_base_->StartPlayout(0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(!base->StopPlayout(0)); + TEST_MUSTPASS(!voe_base_->StopPlayout(0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); MARK(); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); MARK(); - TEST_MUSTPASS(base->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); MARK(); - TEST_MUSTPASS(base->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); MARK(); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); // Multi-channel tests const int MaxNumberOfPlayingChannels(kVoiceEngineMaxNumOfActiveChannels); for (i = 0; i < MaxNumberOfPlayingChannels; i++) { - ch = base->CreateChannel(); - TEST_MUSTPASS(base->StartPlayout(ch)); + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); MARK(); } for (i = 0; i < MaxNumberOfPlayingChannels; i++) { - TEST_MUSTPASS(base->StopPlayout(i)); + TEST_MUSTPASS(voe_base_->StopPlayout(i)); MARK(); - base->DeleteChannel(i); + voe_base_->DeleteChannel(i); } for (i = 0; i < MaxNumberOfPlayingChannels; i++) { - ch = base->CreateChannel(); - TEST_MUSTPASS(base->StartPlayout(ch)); + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); MARK(); - TEST_MUSTPASS(base->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); MARK(); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); } ANL(); @@ -1027,72 +1031,72 @@ int VoEExtendedTest::TestBase() { ANL(); // call without existing channel - TEST_MUSTPASS(!base->StartSend(0)); + TEST_MUSTPASS(!voe_base_->StartSend(0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(!base->StopSend(0)); + TEST_MUSTPASS(!voe_base_->StopSend(0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); // call without initialized destination - TEST_MUSTPASS(!base->StartSend(ch)); + TEST_MUSTPASS(!voe_base_->StartSend(ch)); MARK(); TEST_ERROR(VE_DESTINATION_NOT_INITED); // initialize destination and try again (should work even without existing // sockets) - TEST_MUSTPASS(base->SetSendDestination(ch, 33333, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33333, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartSend(ch)); MARK(); SLEEP(100); // STATE: sockets should now have been created automatically at the first // transmitted packet should be binded to 33333 and "0.0.0.0" - TEST_MUSTPASS(base->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); MARK(); - base->DeleteChannel(ch); - ch = base->CreateChannel(); + voe_base_->DeleteChannel(ch); + ch = voe_base_->CreateChannel(); // try loopback with unique send sockets (closed when channel is deleted or // new source is set) - TEST_MUSTPASS(base->SetLocalReceiver(ch, 33333)); - TEST_MUSTPASS(base->SetSendDestination(ch, 33333, "127.0.0.1", 44444)); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 33333)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33333, "127.0.0.1", 44444)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); MARK(); - TEST_MUSTPASS(base->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); Play(ch, 2000, true, true); - TEST_MUSTPASS(base->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); MARK(); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); ANL(); // Multi-channel tests - for (i = 0; i < base->MaxNumOfChannels(); i++) { - ch = base->CreateChannel(); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 33333 + 2*i)); - TEST_MUSTPASS(base->SetSendDestination(ch, 33333 + 2*i, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 33333 + 2*i)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33333 + 2*i, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartSend(ch)); MARK(); } - for (i = 0; i < base->MaxNumOfChannels(); i++) { - TEST_MUSTPASS(base->StopSend(i)); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + TEST_MUSTPASS(voe_base_->StopSend(i)); MARK(); - base->DeleteChannel(i); + voe_base_->DeleteChannel(i); } - for (i = 0; i < base->MaxNumOfChannels(); i++) { - ch = base->CreateChannel(); - TEST_MUSTPASS(base->SetLocalReceiver(ch, 45633 + 2*i)); - TEST_MUSTPASS(base->SetSendDestination(ch, 45633 + 2*i, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 45633 + 2*i)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 45633 + 2*i, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartSend(ch)); MARK(); - TEST_MUSTPASS(base->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); MARK(); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); } ANL(); AOK(); @@ -1112,54 +1116,54 @@ int VoEExtendedTest::TestBase() { NetEqModes mode; - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); // invalid function calls (should fail) - TEST_MUSTPASS(!base->GetNetEQPlayoutMode(ch+1, mode)); + TEST_MUSTPASS(!voe_base_->GetNetEQPlayoutMode(ch+1, mode)); MARK(); - TEST_MUSTPASS(!base->SetNetEQPlayoutMode(ch+1, kNetEqDefault)); + TEST_MUSTPASS(!voe_base_->SetNetEQPlayoutMode(ch+1, kNetEqDefault)); MARK(); // verify default mode (should be kNetEqDefault) - TEST_MUSTPASS(base->GetNetEQPlayoutMode(ch, mode)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(ch, mode)); MARK(); TEST_MUSTPASS(mode != kNetEqDefault); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(ch, kNetEqStreaming)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(ch, kNetEqStreaming)); MARK(); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); // ensure that default mode is set as soon as new channel is created - ch = base->CreateChannel(); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(ch, mode)); + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(ch, mode)); MARK(); TEST_MUSTPASS(mode != kNetEqDefault); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); // verify Set/Get for all supported modes and max number of channels - for (i = 0; i < base->MaxNumOfChannels(); i++) { - ch = base->CreateChannel(); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + ch = voe_base_->CreateChannel(); // verify Set/Get for all supported modes - TEST_MUSTPASS(base->SetNetEQPlayoutMode(i, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(i, kNetEqDefault)); MARK(); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(i, mode)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(i, mode)); MARK(); TEST_MUSTPASS(mode != kNetEqDefault); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(i, kNetEqStreaming)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(i, kNetEqStreaming)); MARK(); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(i, mode)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(i, mode)); MARK(); TEST_MUSTPASS(mode != kNetEqStreaming); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(i, kNetEqFax)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(i, kNetEqFax)); MARK(); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(i, mode)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(i, mode)); MARK(); TEST_MUSTPASS(mode != kNetEqFax); SLEEP(50); } - for (i = 0; i < base->MaxNumOfChannels(); i++) { - base->DeleteChannel(i); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + voe_base_->DeleteChannel(i); } ANL(); @@ -1177,85 +1181,85 @@ int VoEExtendedTest::TestBase() { NetEqBgnModes bgnMode; - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); // invalid function calls (should fail) - TEST_MUSTPASS(!base->GetNetEQBGNMode(ch+1, bgnMode)); + TEST_MUSTPASS(!voe_base_->GetNetEQBGNMode(ch+1, bgnMode)); MARK(); - TEST_MUSTPASS(!base->SetNetEQBGNMode(ch+1, kBgnOn)); + TEST_MUSTPASS(!voe_base_->SetNetEQBGNMode(ch+1, kBgnOn)); MARK(); // verify default mode (should be kBgnOn) - TEST_MUSTPASS(base->GetNetEQBGNMode(ch, bgnMode)); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(ch, bgnMode)); MARK(); TEST_MUSTPASS(bgnMode != kBgnOn); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); // ensure that default mode is set as soon as new channel is created - ch = base->CreateChannel(); - TEST_MUSTPASS(base->GetNetEQBGNMode(ch, bgnMode)); + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(ch, bgnMode)); MARK(); TEST_MUSTPASS(bgnMode != kBgnOn); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); // verify Set/Get for all supported modes and max number of channels - for (i = 0; i < base->MaxNumOfChannels(); i++) { - ch = base->CreateChannel(); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + ch = voe_base_->CreateChannel(); // verify Set/Get for all supported modes - TEST_MUSTPASS(base->SetNetEQBGNMode(i, kBgnOn)); + TEST_MUSTPASS(voe_base_->SetNetEQBGNMode(i, kBgnOn)); MARK(); - TEST_MUSTPASS(base->GetNetEQBGNMode(i, bgnMode)); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(i, bgnMode)); MARK(); TEST_MUSTPASS(bgnMode != kBgnOn); - TEST_MUSTPASS(base->SetNetEQBGNMode(i, kBgnFade)); + TEST_MUSTPASS(voe_base_->SetNetEQBGNMode(i, kBgnFade)); MARK(); - TEST_MUSTPASS(base->GetNetEQBGNMode(i, bgnMode)); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(i, bgnMode)); MARK(); TEST_MUSTPASS(bgnMode != kBgnFade); - TEST_MUSTPASS(base->SetNetEQBGNMode(i, kBgnOff)); + TEST_MUSTPASS(voe_base_->SetNetEQBGNMode(i, kBgnOff)); MARK(); - TEST_MUSTPASS(base->GetNetEQBGNMode(i, bgnMode)); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(i, bgnMode)); MARK(); TEST_MUSTPASS(bgnMode != kBgnOff); SLEEP(50); } - for (i = 0; i < base->MaxNumOfChannels(); i++) { - base->DeleteChannel(i); + for (i = 0; i < voe_base_->MaxNumOfChannels(); i++) { + voe_base_->DeleteChannel(i); } // Verify real-time performance for all playout modes in full duplex - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); - TEST_MUSTPASS(base->SetLocalReceiver(ch , 12345)); - TEST_MUSTPASS(base->SetSendDestination(ch, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch , 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartSend(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(ch, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(ch, kNetEqDefault)); MARK(); TEST_LOG("\nenjoy full duplex using kNetEqDefault playout mode...\n"); PAUSE - TEST_MUSTPASS(base->SetNetEQPlayoutMode(ch, kNetEqStreaming)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(ch, kNetEqStreaming)); MARK(); TEST_LOG("\nenjoy full duplex using kNetEqStreaming playout mode...\n"); PAUSE - TEST_MUSTPASS(base->SetNetEQPlayoutMode(ch, kNetEqFax)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(ch, kNetEqFax)); MARK(); TEST_LOG("\nenjoy full duplex using kNetEqFax playout mode...\n"); PAUSE - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); - base->DeleteChannel(ch); + voe_base_->DeleteChannel(ch); ANL(); AOK(); @@ -1265,20 +1269,20 @@ int VoEExtendedTest::TestBase() { ///////////////////// // Full duplex tests - ch = base->CreateChannel(); // We must delete this channel first to be able + ch = voe_base_->CreateChannel(); // We must delete this channel first to be able // to reuse port 12345 // start with default case, also test non-default RTCP port #ifdef _TEST_RTP_RTCP_ TEST_MUSTPASS(rtp->SetRTCP_CNAME(ch, "Johnny")); #endif - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345, 12349)); - TEST_MUSTPASS(base->SetSendDestination(ch, 12345, "127.0.0.1", kVoEDefault, + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345, 12349)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 12345, "127.0.0.1", kVoEDefault, 12349)); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartSend(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); TEST_LOG("full duplex is now activated (1)\n"); TEST_LOG("waiting for RTCP packet...\n"); @@ -1296,33 +1300,33 @@ int VoEExtendedTest::TestBase() { char ipAddr[64] = { 0 }; TEST_MUSTPASS(netw->GetSourceInfo(ch, rtpPort, rtcpPort, ipAddr)); TEST_MUSTPASS(12349 != rtcpPort); - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); // Call StartSend before StartReceive - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); - TEST_MUSTPASS(base->SetSendDestination(ch, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); TEST_LOG("\nfull duplex is now activated (2)\n"); PAUSE - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); // Try again using same ports - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); - TEST_MUSTPASS(base->SetSendDestination(ch, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartSend(ch)); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); TEST_LOG("\nfull duplex is now activated (3)\n"); TEST_LOG("waiting for RTCP packet...\n"); @@ -1333,105 +1337,105 @@ int VoEExtendedTest::TestBase() { // Verify correct RTCP source port TEST_MUSTPASS(netw->GetSourceInfo(ch, rtpPort, rtcpPort, ipAddr)); TEST_MUSTPASS(12345+1 != rtcpPort); - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); - base->DeleteChannel(ch); - ch = base->CreateChannel(); + voe_base_->DeleteChannel(ch); + ch = voe_base_->CreateChannel(); // Try with extra send socket - TEST_MUSTPASS(base->SetLocalReceiver(ch , 22222)); - TEST_MUSTPASS(base->SetSendDestination(ch, 22222, "127.0.0.1", 11111)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch , 22222)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 22222, "127.0.0.1", 11111)); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartSend(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); TEST_LOG("\nfull duplex is now activated (4)\n"); PAUSE - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); // repeat default case starting with a fresh channel - base->DeleteChannel(ch); - ch = base->CreateChannel(); - TEST_MUSTPASS(base->SetLocalReceiver(ch , 12345)); - TEST_MUSTPASS(base->SetSendDestination(ch, 12345, "127.0.0.1")); + voe_base_->DeleteChannel(ch); + ch = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch , 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartSend(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); TEST_LOG("\nfull duplex is now activated (5)\n"); PAUSE - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); // restart call again - TEST_MUSTPASS(base->SetLocalReceiver(ch, 12345)); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 12345)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); TEST_LOG("\nfull duplex is now activated (6)\n"); PAUSE - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); // force sending from new socket - TEST_MUSTPASS(base->SetLocalReceiver(ch , 12345)); - TEST_MUSTPASS(base->SetSendDestination(ch, 12345, "127.0.0.1", 12350, + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch , 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 12345, "127.0.0.1", 12350, 12359)); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); TEST_LOG("\nfull duplex is now activated (7)\n"); PAUSE // Test getting send settings - TEST_MUSTPASS(base->GetSendDestination(ch, rtpPort, ipAddr, sourcePort, + TEST_MUSTPASS(voe_base_->GetSendDestination(ch, rtpPort, ipAddr, sourcePort, rtcpPort)); TEST_MUSTPASS(12345 != rtpPort); TEST_MUSTPASS(_stricmp("127.0.0.1", ipAddr)); TEST_MUSTPASS(12350 != sourcePort); TEST_MUSTPASS(12359 != rtcpPort); - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); // new channel and new port - ch = base->CreateChannel(); + ch = voe_base_->CreateChannel(); - TEST_MUSTPASS(base->SetLocalReceiver(ch , 33221)); - TEST_MUSTPASS(base->SetSendDestination(ch, 33221, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch , 33221)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33221, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); TEST_LOG("\nfull duplex is now activated (8)\n"); PAUSE - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); - base->DeleteChannel(ch); - ch = base->CreateChannel(); + voe_base_->DeleteChannel(ch); + ch = voe_base_->CreateChannel(); #ifndef MAC_IPHONE // bind to local IP and try again @@ -1440,18 +1444,18 @@ int VoEExtendedTest::TestBase() { localIp = "127.0.0.1"; #endif - TEST_MUSTPASS(base->SetLocalReceiver(ch, 33221, 12349, localIp)); - TEST_MUSTPASS(base->SetSendDestination(ch, 33221, localIp)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch, 33221, 12349, localIp)); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch, 33221, localIp)); - TEST_MUSTPASS(base->StartReceive(ch)); - TEST_MUSTPASS(base->StartPlayout(ch)); - TEST_MUSTPASS(base->StartSend(ch)); + TEST_MUSTPASS(voe_base_->StartReceive(ch)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch)); + TEST_MUSTPASS(voe_base_->StartSend(ch)); TEST_LOG("\nfull duplex is now activated (9)\n"); PAUSE - TEST_MUSTPASS(base->GetLocalReceiver(ch, rtpPort, rtcpPort, ipAddr)); + TEST_MUSTPASS(voe_base_->GetLocalReceiver(ch, rtpPort, rtcpPort, ipAddr)); TEST_MUSTPASS(33221 != rtpPort); TEST_MUSTPASS(_stricmp(localIp, ipAddr)); TEST_MUSTPASS(12349 != rtcpPort); @@ -1476,9 +1480,9 @@ int VoEExtendedTest::TestBase() { TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceNone)); MARK(); SLEEP(300); // API call and info should NOT be seen in log - TEST_MUSTPASS(base->SetOnHoldStatus(0, true)); MARK(); + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, true)); MARK(); // API call and error should NOT be seen in log - TEST_MUSTPASS(!base->SetOnHoldStatus(999, true)); MARK(); + TEST_MUSTPASS(!voe_base_->SetOnHoldStatus(999, true)); MARK(); TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceApiCall | kTraceCritical | @@ -1486,17 +1490,17 @@ int VoEExtendedTest::TestBase() { kTraceWarning)); MARK(); SLEEP(300); // API call should and info should NOT be seen in log - TEST_MUSTPASS(base->SetOnHoldStatus(0, false)); MARK(); + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, false)); MARK(); // API call and error should be seen in log - TEST_MUSTPASS(!base->SetOnHoldStatus(999, true)); MARK(); + TEST_MUSTPASS(!voe_base_->SetOnHoldStatus(999, true)); MARK(); TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceApiCall | kTraceInfo)); MARK(); SLEEP(300); // API call and info should be seen in log - TEST_MUSTPASS(base->SetOnHoldStatus(0, true)); MARK(); + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, true)); MARK(); // API call should and error should NOT be seen in log - TEST_MUSTPASS(!base->SetOnHoldStatus(999, true)); MARK(); + TEST_MUSTPASS(!voe_base_->SetOnHoldStatus(999, true)); MARK(); // Back to default TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceAll)); MARK(); @@ -1536,13 +1540,13 @@ int VoEExtendedTest::TestBase() { ////////////// // Close down - TEST_MUSTPASS(base->StopSend(ch)); - TEST_MUSTPASS(base->StopPlayout(ch)); - TEST_MUSTPASS(base->StopReceive(ch)); - TEST_MUSTPASS(base->DeleteChannel(ch)); + TEST_MUSTPASS(voe_base_->StopSend(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopReceive(ch)); + TEST_MUSTPASS(voe_base_->DeleteChannel(ch)); - base->DeleteChannel(0); - TEST_MUSTPASS(base->Terminate()); + voe_base_->DeleteChannel(0); + TEST_MUSTPASS(voe_base_->Terminate()); return 0; } @@ -1553,7 +1557,7 @@ int VoEExtendedTest::TestBase() { int VoEExtendedTest::TestCallReport() { // Get required sub-API pointers - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoECallReport* report = _mgr.CallReportPtr(); VoEFile* file = _mgr.FilePtr(); VoEAudioProcessing* apm = _mgr.APMPtr(); @@ -1579,13 +1583,13 @@ int VoEExtendedTest::TestCallReport() { kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); @@ -1687,11 +1691,11 @@ int VoEExtendedTest::TestCallReport() { ANL(); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); return 0; } @@ -1703,7 +1707,7 @@ int VoEExtendedTest::TestCallReport() { int VoEExtendedTest::TestCodec() { PrepareTest("Codec"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoECodec* codec = _mgr.CodecPtr(); VoEFile* file = _mgr.FilePtr(); @@ -1719,19 +1723,19 @@ int VoEExtendedTest::TestCodec() { kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); #ifdef WEBRTC_EXTERNAL_TRANSPORT ExtendedTestTransport* ptrTransport(NULL); ptrTransport = new ExtendedTestTransport(netw); TEST_MUSTPASS(netw->RegisterExternalTransport(0, *ptrTransport)); #else - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); #endif - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); /////////////////////////// // Actual test starts here @@ -1778,7 +1782,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(-1 != codec->GetCodec(nCodecs, cinst)); MARK(); // ensure that error code is VE_INVALID_LISTNR - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_LISTNR); AOK(); ANL(); @@ -1791,7 +1795,7 @@ int VoEExtendedTest::TestCodec() { CodecInst defaultCodec; // check the channel parameter - int nMaxChannels(base->MaxNumOfChannels()); + int nMaxChannels(voe_base_->MaxNumOfChannels()); TEST_MUSTPASS(-1 != codec->GetSendCodec(nMaxChannels-1, cinst)); MARK(); // not created TEST_MUSTPASS(-1 != codec->GetSendCodec(nMaxChannels, cinst)); @@ -1845,7 +1849,7 @@ int VoEExtendedTest::TestCodec() { // default settings for invalid payload names (should give // VE_INVALID_PLNAME) TEST_MUSTPASS(!codec->SetSendCodec(0, cinst)); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); continue; } @@ -1869,7 +1873,7 @@ int VoEExtendedTest::TestCodec() { // log valid packet size TEST_LOG("%d ", pacsize); } else { - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } } @@ -1883,7 +1887,7 @@ int VoEExtendedTest::TestCodec() { // valid channels (only 1 should be OK) TEST_LOG("%d ", channels); } else { - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } } @@ -1901,7 +1905,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)) { // ensure that error code is VE_INVALID_PLNAME - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } @@ -1942,7 +1946,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)) { // ensure that error code is VE_CANNOT_SET_SEND_CODEC - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } ANL(); @@ -1961,7 +1965,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)) { // ensure that error code is VE_CANNOT_SET_SEND_CODEC - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } } @@ -2014,7 +2018,7 @@ int VoEExtendedTest::TestCodec() { cinst.rate = 2000; // invalid TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)) { - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } ANL(); @@ -2031,13 +2035,13 @@ int VoEExtendedTest::TestCodec() { cinst.rate = 5999; // invalid TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)) { - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } cinst.rate = 40001; // invalid TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)) { - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } ANL(); @@ -2048,7 +2052,7 @@ int VoEExtendedTest::TestCodec() { TEST_LOG("%d ", cinst.rate); cinst.rate = defaultCodec.rate + 17; TEST_MUSTPASS(!codec->SetSendCodec(0, cinst)); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); ANL(); } @@ -2060,21 +2064,21 @@ int VoEExtendedTest::TestCodec() { // valid pacsizes: 80, 160, 240, 320 cinst.pacsize = 480; // only supported in combination with 16kHz TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); cinst.pacsize = 640; // only supported in combination with 16kHz TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } else { // valid pacsizes: 160, 320, 480, 640 cinst.pacsize = 80; // only supported in combination with 8kHz TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); cinst.pacsize = 240; // only supported in combination with 8kHz TEST_MUSTPASS(-1 != codec->SetSendCodec(0, cinst)); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); } } @@ -2193,18 +2197,18 @@ int VoEExtendedTest::TestCodec() { ANL(); // stop all streaming first - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); // start loopback streaming (PCMU is default) #ifndef WEBRTC_EXTERNAL_TRANSPORT - TEST_MUSTPASS(base->SetSendDestination(0,8000,"127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(0,8000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0,8000,"127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0,8000)); #endif - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(100); // ensure that at least one packets is received // scan all supported and valid codecs @@ -2228,9 +2232,9 @@ int VoEExtendedTest::TestCodec() { } // stop streaming - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); ANL(); AOK(); @@ -2242,8 +2246,8 @@ int VoEExtendedTest::TestCodec() { // SetAMREncFormat // Fresh channel - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); TEST(SetAMREncFormat); ANL(); @@ -2284,7 +2288,7 @@ int VoEExtendedTest::TestCodec() { // It should not be possible to set AMR dec format before valid AMR decoder // is registered TEST_MUSTPASS(!codec->SetAMRDecFormat(0)); MARK(); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_AUDIO_CODING_MODULE_ERROR); // Ensure that ACM::RegisterReceiveCodec(AMR) is called @@ -2307,8 +2311,8 @@ int VoEExtendedTest::TestCodec() { // SetAMRWbEncFormat // Fresh channel - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); TEST(SetAMRWbEncFormat); ANL(); @@ -2349,7 +2353,7 @@ int VoEExtendedTest::TestCodec() { // It should not be possible to set AMR dec format before valid AMR decoder // is registered TEST_MUSTPASS(!codec->SetAMRWbDecFormat(0)); MARK(); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_AUDIO_CODING_MODULE_ERROR); // Ensure that ACM::RegisterReceiveCodec(AMR) is called @@ -2388,7 +2392,7 @@ int VoEExtendedTest::TestCodec() { // Not possible to change PT for 8000 TEST_MUSTPASS(!codec->SetSendCNPayloadType(0, 96, kFreq8000Hz)); MARK(); - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_PLFREQ); // Try some dynamic for 16000 and 32000 as well @@ -2475,10 +2479,10 @@ int VoEExtendedTest::TestCodec() { ANL(); #ifndef WEBRTC_EXTERNAL_TRANSPORT - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); #endif - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); if (file) { TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), @@ -2513,25 +2517,25 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); // Verify no audio - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_LOG(" silence"); fflush(NULL); SLEEP(800); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); // Restore codec TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst)); // Verify audio - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_LOG(" audio"); fflush(NULL); SLEEP(800); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); if (127 == cinst.pltype) { // If no default payload type is defined, i.e. we have set pt to @@ -2558,8 +2562,8 @@ int VoEExtendedTest::TestCodec() { } ANL(); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); // Test sending all codecs - verify audio/no audio depending on codec TEST_LOG("Looping through send codecs \n"); @@ -2576,11 +2580,11 @@ int VoEExtendedTest::TestCodec() { // payload type if (-1 == cinst.pltype) { cinst.pltype = 127; - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); } // Set send codec @@ -2590,8 +2594,8 @@ int VoEExtendedTest::TestCodec() { SLEEP(800); } - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); // Restore codecs TEST_LOG("Restoring receive codecs:"); @@ -2606,8 +2610,8 @@ int VoEExtendedTest::TestCodec() { } ANL(); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); // Test sending all codecs - verify audio TEST_LOG("Looping through send codecs \n"); @@ -2624,11 +2628,11 @@ int VoEExtendedTest::TestCodec() { // payload type if (-1 == cinst.pltype) { cinst.pltype = 127; - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); } // Set send codec @@ -2638,13 +2642,13 @@ int VoEExtendedTest::TestCodec() { SLEEP(800); } - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); // Fresh channel - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); #if defined(WEBRTC_CODEC_ISAC) @@ -2664,7 +2668,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 10000)); MARK(); // should fail since iSAC is not active - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_CODEC_ERROR); // set iSAC as sending codec (16kHz) @@ -2678,17 +2682,17 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACInitTargetRate(1, 10000)); MARK(); // invalid channel - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_CHANNEL_NOT_VALID); TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 500)); MARK(); // invalid target rates (too small) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 33000)); MARK(); // invalid target rates (too large) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(codec->SetISACInitTargetRate(0, 10000)); @@ -2711,7 +2715,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 32000)); MARK(); // only works in adaptive mode - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_AUDIO_CODING_MODULE_ERROR); cinst.rate = -1; @@ -2739,27 +2743,27 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACInitTargetRate(1, 10000)); MARK(); // invalid channel - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_CHANNEL_NOT_VALID); TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, -1)); MARK(); // invalid target rates (too small) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, -1)); MARK(); // invalid target rates (too small) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 500)); MARK(); // invalid target rates (too small) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 57000)); MARK(); // invalid target rates (valid range is [10000, 56000]) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(codec->SetISACInitTargetRate(0, 10000)); @@ -2793,7 +2797,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACMaxRate(0, 48000)); MARK(); // should fail since iSAC is not active - TEST_MUSTPASS(base->LastError() != VE_CODEC_ERROR); + TEST_MUSTPASS(voe_base_->LastError() != VE_CODEC_ERROR); // set iSAC as sending codec cinst.channels = 1; @@ -2806,15 +2810,15 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACMaxRate(1, 48000)); MARK(); // invalid channel - TEST_MUSTPASS(base->LastError() != VE_CHANNEL_NOT_VALID); + TEST_MUSTPASS(voe_base_->LastError() != VE_CHANNEL_NOT_VALID); TEST_MUSTPASS(!codec->SetISACMaxRate(0, 31900)); MARK(); // invalid target rates (too small) - TEST_MUSTPASS(base->LastError() != VE_INVALID_ARGUMENT); + TEST_MUSTPASS(voe_base_->LastError() != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACMaxRate(0, 53500)); MARK(); // invalid target rates (too large) - TEST_MUSTPASS(base->LastError() != VE_INVALID_ARGUMENT); + TEST_MUSTPASS(voe_base_->LastError() != VE_INVALID_ARGUMENT); TEST_MUSTPASS(codec->SetISACMaxRate(0, 32000)); MARK(); // life is good now @@ -2852,15 +2856,15 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACMaxRate(1, 48000)); MARK(); // invalid channel - TEST_MUSTPASS(base->LastError() != VE_CHANNEL_NOT_VALID); + TEST_MUSTPASS(voe_base_->LastError() != VE_CHANNEL_NOT_VALID); TEST_MUSTPASS(!codec->SetISACMaxRate(0, 31900)); MARK(); // invalid target rates (too small) - TEST_MUSTPASS(base->LastError() != VE_INVALID_ARGUMENT); + TEST_MUSTPASS(voe_base_->LastError() != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACMaxRate(0, 107500)); MARK(); // invalid target rates (too large) - TEST_MUSTPASS(base->LastError() != VE_INVALID_ARGUMENT); + TEST_MUSTPASS(voe_base_->LastError() != VE_INVALID_ARGUMENT); TEST_MUSTPASS(codec->SetISACMaxRate(0, 32000)); MARK(); // life is good now @@ -2880,15 +2884,15 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACMaxRate(1, 48000)); MARK(); // invalid channel - TEST_MUSTPASS(base->LastError() != VE_CHANNEL_NOT_VALID); + TEST_MUSTPASS(voe_base_->LastError() != VE_CHANNEL_NOT_VALID); TEST_MUSTPASS(!codec->SetISACMaxRate(0, 31900)); MARK(); // invalid target rates (too small) - TEST_MUSTPASS(base->LastError() != VE_INVALID_ARGUMENT); + TEST_MUSTPASS(voe_base_->LastError() != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACMaxRate(0, 107500)); MARK(); // invalid target rates (too large) - TEST_MUSTPASS(base->LastError() != VE_INVALID_ARGUMENT); + TEST_MUSTPASS(voe_base_->LastError() != VE_INVALID_ARGUMENT); TEST_MUSTPASS(codec->SetISACMaxRate(0, 32000)); MARK(); // life is good now @@ -2921,7 +2925,7 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(0, 120)); MARK(); // should fail since iSAC is not active - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_CODEC_ERROR); // set iSAC as sending codec @@ -2935,17 +2939,17 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(1, 120)); MARK(); // invalid channel - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_CHANNEL_NOT_VALID); TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(0, 100)); MARK(); // invalid size (too small) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(0, 410)); MARK(); // invalid size (too large) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(codec->SetISACMaxPayloadSize(0, 200)); @@ -2972,17 +2976,17 @@ int VoEExtendedTest::TestCodec() { TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(1, 100)); MARK(); // invalid channel - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_CHANNEL_NOT_VALID); TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(0, 100)); MARK(); // invalid size (too small) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(0, 610)); MARK(); // invalid size (too large) - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); TEST_MUSTPASS(codec->SetISACMaxPayloadSize(0, 200)); @@ -3001,12 +3005,12 @@ int VoEExtendedTest::TestCodec() { #ifdef WEBRTC_EXTERNAL_TRANSPORT TEST_MUSTPASS(netw->RegisterExternalTransport(0, *ptrTransport)); #else - TEST_MUSTPASS(base->SetSendDestination(0, 8001, "127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(0, 8001)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8001, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8001)); #endif - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( 0, GetFilename("audio_long16.pcm"), true , true)); cinst.channels = 1; @@ -3041,9 +3045,9 @@ int VoEExtendedTest::TestCodec() { cinst.plfreq = 32000; TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); SLEEP(2000); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); #else TEST_LOG("Skipping extended iSAC API tests - " "WEBRTC_CODEC_ISAC not defined\n"); @@ -3053,8 +3057,8 @@ int VoEExtendedTest::TestCodec() { delete ptrTransport; #endif - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); return 0; } @@ -3066,7 +3070,7 @@ int VoEExtendedTest::TestCodec() { int VoEExtendedTest::TestDtmf() { PrepareTest("Dtmf"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEDtmf* dtmf = _mgr.DtmfPtr(); VoECodec* codec = _mgr.CodecPtr(); VoEVolumeControl* volume = _mgr.VolumeControlPtr(); @@ -3082,13 +3086,13 @@ int VoEExtendedTest::TestDtmf() { kTraceMemory | kTraceInfo)); //#endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); /////////////////////////// // Actual test starts here @@ -3155,33 +3159,33 @@ int VoEExtendedTest::TestDtmf() { // 255, 256->0 TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, -1, false, 160, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, 16, false, 160, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); // Length TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, 0, true, 99, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, 0, true, 60001, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, 20, true, -1, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); // Volume TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, 0, true, 160, -1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, 0, true, 160, 37)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); // Without sending - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(!dtmf->SendTelephoneEvent(0, 0, true)); MARK(); - TEST_MUSTPASS(VE_NOT_SENDING != base->LastError()); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(VE_NOT_SENDING != voe_base_->LastError()); + TEST_MUSTPASS(voe_base_->StartSend(0)); // Testing Dtmf out-of-band: event, length and volume TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, 0, true)); @@ -3253,19 +3257,19 @@ int VoEExtendedTest::TestDtmf() { ANL(); TEST_MUSTPASS(!dtmf->PlayDtmfTone(-1, 200, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->PlayDtmfTone(16, 200, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->PlayDtmfTone(0, 9, 10)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->PlayDtmfTone(0, 200, -1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!dtmf->PlayDtmfTone(0, 200, 37)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(dtmf->PlayDtmfTone(0)); MARK(); @@ -3363,7 +3367,7 @@ int VoEExtendedTest::TestDtmf() { ANL(); TEST_MUSTPASS(!dtmf->SetSendTelephoneEventPayloadType(0, 128)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(dtmf->SetSendTelephoneEventPayloadType(0, 96)); MARK(); @@ -3386,22 +3390,22 @@ int VoEExtendedTest::TestDtmf() { strcpy(ci.plname, "PCMU"); TEST_MUSTPASS(codec->SetSendCodec(0, ci)); - int ch2 = base->CreateChannel(); - TEST_MUSTPASS(base->SetSendDestination(ch2, 8002, "127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(ch2, 8002)); - TEST_MUSTPASS(base->StartReceive(ch2)); + int ch2 = voe_base_->CreateChannel(); + TEST_MUSTPASS(voe_base_->SetSendDestination(ch2, 8002, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(ch2, 8002)); + TEST_MUSTPASS(voe_base_->StartReceive(ch2)); TEST_MUSTPASS(codec->SetSendCodec(ch2, ci)); - TEST_MUSTPASS(base->StartPlayout(ch2)); - TEST_MUSTPASS(base->StartSend(ch2)); + TEST_MUSTPASS(voe_base_->StartPlayout(ch2)); + TEST_MUSTPASS(voe_base_->StartSend(ch2)); MARK(); DtmfCallback *d = new DtmfCallback(); TEST_MUSTPASS(dtmf->SetDtmfFeedbackStatus(false)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); // In-band TEST_MUSTPASS(dtmf->RegisterTelephoneEventDetection(0, kInBand, *d)); @@ -3441,11 +3445,11 @@ int VoEExtendedTest::TestDtmf() { #endif TEST_MUSTPASS(dtmf->SetDtmfFeedbackStatus(true, false)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); return 0; } @@ -3457,7 +3461,7 @@ int VoEExtendedTest::TestDtmf() { int VoEExtendedTest::TestEncryption() { PrepareTest("Encryption"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEFile* file = _mgr.FilePtr(); VoEEncryption* encrypt = _mgr.EncryptionPtr(); @@ -3473,13 +3477,13 @@ int VoEExtendedTest::TestEncryption() { kTraceMemory | kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); @@ -3505,140 +3509,140 @@ int VoEExtendedTest::TestEncryption() { // Incorrect parameters when not all protection is enabled TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kNoProtection, key1)); - TEST_MUSTPASS(VE_SRTP_ERROR != base->LastError()); + TEST_MUSTPASS(VE_SRTP_ERROR != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kEncryption key1)); - TEST_MUSTPASS(VE_SRTP_ERROR != base->LastError()); + TEST_MUSTPASS(VE_SRTP_ERROR != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kAuthentication, key1)); - TEST_MUSTPASS(VE_SRTP_ERROR != base->LastError()); + TEST_MUSTPASS(VE_SRTP_ERROR != voe_base_->LastError()); MARK(); // Incorrect cipher key length TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 15, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 257, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherNull, 15, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherNull, 257, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // Incorrect auth key length TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 21, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 30, kAuthNull, 257, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // Incorrect auth tag length TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 20, 21, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 30, kAuthNull, 20, 13, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // key NULL pointer TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, NULL)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // Same for receive // Incorrect parameters when not all protection is enabled TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kNoProtection, key1)); - TEST_MUSTPASS(VE_SRTP_ERROR != base->LastError()); + TEST_MUSTPASS(VE_SRTP_ERROR != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kEncryption key1)); - TEST_MUSTPASS(VE_SRTP_ERROR != base->LastError()); + TEST_MUSTPASS(VE_SRTP_ERROR != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kAuthentication, key1)); - TEST_MUSTPASS(VE_SRTP_ERROR != base->LastError()); + TEST_MUSTPASS(VE_SRTP_ERROR != voe_base_->LastError()); MARK(); // Incorrect cipher key length TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherAes128CounterMode, 15, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherAes128CounterMode, 257, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherNull, 15, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherNull, 257, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // Incorrect auth key length TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 21, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // it crashed the application TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthNull, 257, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // Incorrect auth tag length TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 20, 21, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // it crashed the application TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthNull, 20, 13, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // key NULL pointer TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, NULL)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); ANL(); @@ -3719,9 +3723,9 @@ int VoEExtendedTest::TestEncryption() { kEncryptionAndAuthentication, key1)); MARK(); SLEEP(2000); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(encrypt->DisableSRTPSend(0)); TEST_MUSTPASS(encrypt->DisableSRTPReceive(0)); TEST_MUSTPASS(encrypt->EnableSRTPSend(0, kCipherAes128CounterMode, 30, @@ -3731,11 +3735,11 @@ int VoEExtendedTest::TestEncryption() { kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key2)); - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); MARK(); SLEEP(2000); @@ -3940,24 +3944,24 @@ int VoEExtendedTest::TestEncryption() { TEST_MUSTPASS(!encrypt->EnableSRTPSend(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); TEST_MUSTPASS(!encrypt->EnableSRTPReceive(0, kCipherNull, 30, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, key1)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); TEST_MUSTPASS(!encrypt->DisableSRTPSend(0)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); TEST_MUSTPASS(!encrypt->DisableSRTPReceive(0)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); ANL(); #endif AOK(); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); return 0; } @@ -3969,7 +3973,7 @@ int VoEExtendedTest::TestEncryption() { int VoEExtendedTest::TestExternalMedia() { PrepareTest("VoEExternalMedia"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEExternalMedia* xmedia = _mgr.ExternalMediaPtr(); // check if this interface is supported @@ -3986,13 +3990,13 @@ int VoEExtendedTest::TestExternalMedia() { kTraceError | kTraceCritical | kTraceApiCall | kTraceMemory | kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); int getLen = 0; WebRtc_Word16 vector[32000]; @@ -4005,13 +4009,13 @@ int VoEExtendedTest::TestExternalMedia() { ANL(); TEST_MUSTPASS(!xmedia->SetExternalPlayoutStatus(true)); - TEST_MUSTPASS(VE_ALREADY_SENDING != base->LastError()); + TEST_MUSTPASS(VE_ALREADY_SENDING != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalPlayoutGetData(vector, 16000, 100, getLen)); - TEST_MUSTPASS(VE_INVALID_OPERATION != base->LastError()); + TEST_MUSTPASS(VE_INVALID_OPERATION != voe_base_->LastError()); - TEST_MUSTPASS(base->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); TEST_MUSTPASS(xmedia->SetExternalPlayoutStatus(true)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(xmedia->ExternalPlayoutGetData(vector, 48000, 0, getLen)); TEST_MUSTPASS(480 != getLen); @@ -4021,26 +4025,26 @@ int VoEExtendedTest::TestExternalMedia() { SLEEP(10); TEST_MUSTPASS(!xmedia->ExternalPlayoutGetData(vector, 8000, 100, getLen)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalPlayoutGetData(vector, 16000, -1, getLen)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); - TEST_MUSTPASS(base->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); TEST_MUSTPASS(xmedia->SetExternalPlayoutStatus(false)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); // SetExternalRecording TEST(SetExternalRecording); ANL(); TEST_MUSTPASS(!xmedia->SetExternalRecordingStatus(true)); - TEST_MUSTPASS(VE_ALREADY_SENDING != base->LastError()); + TEST_MUSTPASS(VE_ALREADY_SENDING != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalRecordingInsertData(vector, 160, 16000, 20)); - TEST_MUSTPASS(VE_INVALID_OPERATION != base->LastError()); + TEST_MUSTPASS(VE_INVALID_OPERATION != voe_base_->LastError()); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(xmedia->SetExternalRecordingStatus(true)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(xmedia->ExternalRecordingInsertData(vector, 480, 48000, 0)); SLEEP(10); @@ -4048,36 +4052,36 @@ int VoEExtendedTest::TestExternalMedia() { SLEEP(40); TEST_MUSTPASS(!xmedia->ExternalRecordingInsertData(vector, 160, 16000, -1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalRecordingInsertData(vector, 80, 8000, 20)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalRecordingInsertData(vector, 0, 16000, 20)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalRecordingInsertData(vector, 80, 16000, 20)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalRecordingInsertData(vector, 500, 16000, 20)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(xmedia->SetExternalRecordingStatus(false)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); #else // #ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT TEST_MUSTPASS(!xmedia->SetExternalPlayoutStatus(true)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalPlayoutGetData(vector, 16000, 100, getLen)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->SetExternalRecordingStatus(true)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); TEST_MUSTPASS(!xmedia->ExternalRecordingInsertData(vector, 160, 16000, 20)); - TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != base->LastError()); + TEST_MUSTPASS(VE_FUNC_NOT_SUPPORTED != voe_base_->LastError()); #endif // #ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); ANL(); AOK(); @@ -4091,7 +4095,7 @@ int VoEExtendedTest::TestExternalMedia() { int VoEExtendedTest::TestFile() { PrepareTest("File"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEFile* file = _mgr.FilePtr(); VoECodec* codec = _mgr.CodecPtr(); @@ -4108,13 +4112,13 @@ int VoEExtendedTest::TestFile() { kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); /////////////////////////// // Actual test starts here @@ -4126,16 +4130,16 @@ int VoEExtendedTest::TestFile() { TEST(StopPlayingFileLocally); ANL(); - base->StopPlayout(0); + voe_base_->StopPlayout(0); TEST_MUSTPASS(file->StartPlayingFileLocally( 0, GetResource("audio_long16.pcm")));MARK(); - base->StartPlayout(0); + voe_base_->StartPlayout(0); MARK(); // file should be mixed in and played out SLEEP(dT); TEST_MUSTPASS(!file->StartPlayingFileLocally( 0, GetResource("audio_long16.pcm"))); MARK(); // should fail (must stop first) - TEST_MUSTPASS(base->LastError() != VE_ALREADY_PLAYING); + TEST_MUSTPASS(voe_base_->LastError() != VE_ALREADY_PLAYING); TEST_MUSTPASS(file->StopPlayingFileLocally(0)); MARK(); TEST_MUSTPASS(file->StartPlayingFileLocally( @@ -4187,17 +4191,17 @@ int VoEExtendedTest::TestFile() { 0, GetResource("audio_short16.pcm"), false, kFileFormatPcm16kHzFile, 1.0, 2000, 1000)); MARK(); // invalid segment - TEST_MUSTPASS(base->LastError() != VE_BAD_FILE); + TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE); TEST_MUSTPASS(!file->StartPlayingFileLocally( 0, GetResource("audio_short16.pcm"), false, kFileFormatPcm16kHzFile, 1.0, 21000, 30000)); MARK(); // start > file size - TEST_MUSTPASS(base->LastError() != VE_BAD_FILE); + TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE); TEST_MUSTPASS(!file->StartPlayingFileLocally( 0, GetResource("audio_short16.pcm"), false, kFileFormatPcm16kHzFile, 1.0, 100, 100)); MARK(); // invalid segment - TEST_MUSTPASS(base->LastError() != VE_BAD_FILE); + TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE); TEST_MUSTPASS(file->StartPlayingFileLocally( 0, GetResource("audio_long16.pcm"))); MARK(); // should work again (restarts file) @@ -4205,7 +4209,7 @@ int VoEExtendedTest::TestFile() { MARK(); TEST_MUSTPASS(!file->StartPlayingFileLocally(0, (InStream*)NULL)); MARK(); // just do it - TEST_MUSTPASS(base->LastError() != VE_BAD_FILE); + TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE); AOK(); ANL(); @@ -4298,13 +4302,13 @@ int VoEExtendedTest::TestFile() { continue; #endif } - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(codec->SetRecPayloadType(0, tempCodec)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(codec->SetSendCodec(0, tempCodec)); TEST_LOG("File 1 in 16 kHz no mix, 2 in 16 kHz mix," @@ -4469,13 +4473,13 @@ int VoEExtendedTest::TestFile() { TEST_MUSTPASS(file->StopRecordingMicrophone()); MARK(); - base->StopSend(0); + voe_base_->StopSend(0); TEST_MUSTPASS(file->StartRecordingMicrophone(GetFilename("rec_mic16.pcm"))); MARK(); // record without sending as well SLEEP(1000); TEST_MUSTPASS(file->StopRecordingMicrophone()); MARK(); - base->StartSend(0); // restore sending + voe_base_->StartSend(0); // restore sending fcomp.plfreq = 8000; strcpy(fcomp.plname, "L16"); @@ -4498,18 +4502,18 @@ int VoEExtendedTest::TestFile() { TEST_LOG("StartRecordingCall, record both mic and file in specific" " channels \n"); TEST_LOG("Create maxnumofchannels \n"); - for (int i = 1; i < base->MaxNumOfChannels(); i++) { - int ch = base->CreateChannel(); + for (int i = 1; i < voe_base_->MaxNumOfChannels(); i++) { + int ch = voe_base_->CreateChannel(); TEST_MUSTPASS(ch == -1); - TEST_MUSTPASS(base->StopPlayout(ch)); + TEST_MUSTPASS(voe_base_->StopPlayout(ch)); } - TEST_MUSTPASS(base->SetSendDestination(1, 12356, "127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(1, 12356)); - TEST_MUSTPASS(base->StartReceive(1)); - TEST_MUSTPASS(base->StopPlayout(1)); - TEST_MUSTPASS(base->StartSend(1)); - TEST_MUSTPASS(base->StartPlayout(1)); + TEST_MUSTPASS(voe_base_->SetSendDestination(1, 12356, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(1, 12356)); + TEST_MUSTPASS(voe_base_->StartReceive(1)); + TEST_MUSTPASS(voe_base_->StopPlayout(1)); + TEST_MUSTPASS(voe_base_->StartSend(1)); + TEST_MUSTPASS(voe_base_->StartPlayout(1)); TEST_LOG("ALways playing audio_long16.pcm for " "channel 0 in background \n"); @@ -4568,8 +4572,8 @@ int VoEExtendedTest::TestFile() { kFileFormatCompressedFile)); SLEEP(2500); TEST_MUSTPASS(file->StopPlayingFileLocally(0)); - for (int i = 1; i < base->MaxNumOfChannels(); i++) { - TEST_MUSTPASS(base->DeleteChannel(i)); + for (int i = 1; i < voe_base_->MaxNumOfChannels(); i++) { + TEST_MUSTPASS(voe_base_->DeleteChannel(i)); } AOK(); @@ -4586,8 +4590,8 @@ int VoEExtendedTest::TestFile() { VoEHardware* hardware = _mgr.HardwarePtr(); TEST_MUSTPASS(NULL == hardware); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); #if defined(_WIN32) TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); @@ -4595,12 +4599,12 @@ int VoEExtendedTest::TestFile() { TEST_MUSTPASS(hardware->SetRecordingDevice(0)); TEST_MUSTPASS(hardware->SetPlayoutDevice(0)); #endif - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); MARK(); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); #if defined(_WIN32) TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); @@ -4608,8 +4612,8 @@ int VoEExtendedTest::TestFile() { TEST_MUSTPASS(hardware->SetRecordingDevice(0)); TEST_MUSTPASS(hardware->SetPlayoutDevice(0)); #endif - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); AOK(); ANL(); @@ -4620,8 +4624,8 @@ int VoEExtendedTest::TestFile() { // Conversion between different file formats #if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID) - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); #endif TEST(ConvertPCMToWAV); @@ -4681,8 +4685,8 @@ int VoEExtendedTest::TestFile() { AOK();ANL(); #if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID) - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); #endif // Misc file functions @@ -4732,7 +4736,7 @@ int VoEExtendedTest::TestFile() { "audio_tiny16.wav", "audio_tiny22.wav", "audio_tiny32.wav", "audio_tiny44.wav", "audio_tiny48.wav" }; char freq[7][5] = { "8", "11", "16", "22", "32", "44.1", "48" }; - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); for (int i = 0; i < 7; i++) { TEST_LOG("Playing file %s, in %s KHz \n", localFiles[i], freq[i]); TEST_MUSTPASS(file->StartPlayingFileLocally( @@ -4742,11 +4746,11 @@ int VoEExtendedTest::TestFile() { } // TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); // Should not work - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); AOK(); ANL(); @@ -4765,7 +4769,7 @@ int VoEExtendedTest::RunMixingTest(int num_channels, int16_t input_value, int16_t max_output_value, int16_t min_output_value) { - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEFile* file = _mgr.FilePtr(); VoECodec* codec = _mgr.CodecPtr(); VoEAudioProcessing* apm = _mgr.APMPtr(); @@ -4793,23 +4797,23 @@ int VoEExtendedTest::RunMixingTest(int num_channels, } fclose(file_to_generate); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); std::vector channels(num_channels); for (int channel_index = 0; channel_index < num_channels; ++channel_index) { - const int channel = base->CreateChannel(); + const int channel = voe_base_->CreateChannel(); channels[channel_index] = channel; ASSERT_TRUE(channel != -1); TEST_MUSTPASS(codec->SetRecPayloadType(channel, codec_inst)); - TEST_MUSTPASS(base->SetLocalReceiver(channel, + TEST_MUSTPASS(voe_base_->SetLocalReceiver(channel, 1234 + 2 * channel_index)); - TEST_MUSTPASS(base->SetSendDestination(channel, + TEST_MUSTPASS(voe_base_->SetSendDestination(channel, 1234 + 2 * channel_index, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(channel)); - TEST_MUSTPASS(base->StartPlayout(channel)); + TEST_MUSTPASS(voe_base_->StartReceive(channel)); + TEST_MUSTPASS(voe_base_->StartPlayout(channel)); TEST_MUSTPASS(codec->SetSendCodec(channel, codec_inst)); - TEST_MUSTPASS(base->StartSend(channel)); + TEST_MUSTPASS(voe_base_->StartSend(channel)); } for (int channel_index = 0; channel_index < num_channels; ++channel_index) { const int channel = channels[channel_index]; @@ -4828,10 +4832,10 @@ int VoEExtendedTest::RunMixingTest(int num_channels, for (int channel_index = 0; channel_index < num_channels; ++channel_index) { const int channel = channels[channel_index]; channels[channel_index] = channel; - TEST_MUSTPASS(base->StopSend(channel)); - TEST_MUSTPASS(base->StopPlayout(channel)); - TEST_MUSTPASS(base->StopReceive(channel)); - TEST_MUSTPASS(base->DeleteChannel(channel)); + TEST_MUSTPASS(voe_base_->StopSend(channel)); + TEST_MUSTPASS(voe_base_->StopPlayout(channel)); + TEST_MUSTPASS(voe_base_->StopReceive(channel)); + TEST_MUSTPASS(voe_base_->DeleteChannel(channel)); } FILE* verification_file = fopen(mix_result, "rb"); @@ -4899,7 +4903,7 @@ int VoEExtendedTest::TestMixing() { int VoEExtendedTest::TestHardware() { PrepareTest("Hardware"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEHardware* hardware = _mgr.HardwarePtr(); #ifdef _USE_EXTENDED_TRACE_ @@ -4930,7 +4934,7 @@ int VoEExtendedTest::TestHardware() { "should be able to set.\n"); TEST_LOG("Verify that this is the case.\n"); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); if(givenLayer == kAudioWindowsCore) @@ -4942,13 +4946,13 @@ int VoEExtendedTest::TestHardware() { TEST_LOG("CoreAudio was *not* set\n"); } - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); wantedLayer = kAudioWindowsWave; TEST_MUSTPASS(hardware->SetAudioDeviceLayer(wantedLayer)); TEST_LOG("Wave audio should always be able to set.\n"); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); if(givenLayer == kAudioWindowsWave) @@ -4960,7 +4964,7 @@ int VoEExtendedTest::TestHardware() { TEST_LOG("Wave audio was not set\n"); } - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); // end _WIN32 #elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) wantedLayer = kAudioLinuxPulse; @@ -4971,7 +4975,7 @@ int VoEExtendedTest::TestHardware() { " should be able to set.\n"); TEST_LOG("Verify that this is the case.\n"); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); if(givenLayer == kAudioLinuxPulse) @@ -4983,13 +4987,13 @@ int VoEExtendedTest::TestHardware() { TEST_LOG("\nPulseAudio was not set\n"); } - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); wantedLayer = kAudioLinuxAlsa; TEST_MUSTPASS(hardware->SetAudioDeviceLayer(wantedLayer)); TEST_LOG("ALSA audio should always be able to set.\n"); - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); if(givenLayer == kAudioLinuxAlsa) @@ -5001,12 +5005,12 @@ int VoEExtendedTest::TestHardware() { TEST_LOG("\nALSA audio was not set\n"); } - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); #endif // defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) // Invalid arguments wantedLayer = (AudioLayers) 17; TEST_MUSTPASS(-1 != hardware->SetAudioDeviceLayer(wantedLayer)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); // Basic usage @@ -5016,12 +5020,12 @@ int VoEExtendedTest::TestHardware() { TEST_MUSTPASS(givenLayer != wantedLayer); MARK(); - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); wantedLayer = kAudioPlatformDefault; TEST_MUSTPASS(-1 != hardware->SetAudioDeviceLayer(wantedLayer)); - TEST_MUSTPASS(VE_ALREADY_INITED != base->LastError()); + TEST_MUSTPASS(VE_ALREADY_INITED != voe_base_->LastError()); MARK(); TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); MARK(); @@ -5074,17 +5078,17 @@ int VoEExtendedTest::TestHardware() { ANL(); TEST_MUSTPASS(-1 != hardware->GetPlayoutDeviceName(nPlay, devName, guidName)); - TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != base->LastError()); + TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != voe_base_->LastError()); MARK(); TEST_MUSTPASS(-1 != hardware->GetPlayoutDeviceName(-2, devName, guidName)); - TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != base->LastError()); + TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != voe_base_->LastError()); MARK(); TEST_MUSTPASS(-1 != hardware->GetPlayoutDeviceName(nPlay+1, devName, guidName)); - TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != base->LastError()); + TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != voe_base_->LastError()); MARK(); TEST_MUSTPASS(-1 != hardware->GetPlayoutDeviceName(0, NULL, guidName)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(hardware->GetPlayoutDeviceName(0, devName, NULL)); @@ -5104,17 +5108,17 @@ int VoEExtendedTest::TestHardware() { ANL(); TEST_MUSTPASS(-1 != hardware->GetRecordingDeviceName(nRec, devName, guidName)); - TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != base->LastError()); + TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != voe_base_->LastError()); MARK(); TEST_MUSTPASS(-1 != hardware->GetRecordingDeviceName(-2, devName, guidName)); - TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != base->LastError()); + TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != voe_base_->LastError()); MARK(); TEST_MUSTPASS(-1 != hardware->GetRecordingDeviceName(nRec+1, devName, guidName)); - TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != base->LastError()); + TEST_MUSTPASS(VE_CANNOT_RETRIEVE_DEVICE_NAME != voe_base_->LastError()); MARK(); TEST_MUSTPASS(-1 != hardware->GetRecordingDeviceName(0, NULL, guidName)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(hardware->GetRecordingDeviceName(0, devName, NULL)); @@ -5163,11 +5167,11 @@ int VoEExtendedTest::TestHardware() { } TEST_LOG("Start streaming - verify the audio after each batch of resets \n"); - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(0,8000)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0,8000)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(2000); SLEEP(2000); @@ -5184,17 +5188,17 @@ int VoEExtendedTest::TestHardware() { } TEST_LOG("Stop streaming \n"); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); #endif // defined(MAC_IPHONE)) #ifdef MAC_IPHONE TEST_LOG("\nNOTE: Always run hardware tests also without extended tests " "enabled,\nsince the extended tests are pre-streaming tests only.\n"); #endif - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); ANL(); AOK(); @@ -5234,7 +5238,7 @@ int VoEExtendedTest::TestNetwork() { int sleepTime2 = 200; #endif - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEFile* file = _mgr.FilePtr(); VoENetwork* netw = _mgr.NetworkPtr(); @@ -5251,7 +5255,7 @@ int VoEExtendedTest::TestNetwork() { kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); + TEST_MUSTPASS(voe_base_->Init()); // ------------------------------------------------------------------------ // >> GetLocalIP @@ -5325,7 +5329,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // NULL as input string TEST_MUSTPASS(!netw->GetSourceInfo(0, rtpPort, rtcpPort, NULL)); @@ -5348,10 +5352,10 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(rtcpPort != 0); TEST_MUSTPASS(strcmp(ipaddr, "") != 0); // send and receive packets with default settings for a while - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime2); // does not guarantee RTCP // verify remote parameters (exclude RTCP) @@ -5361,15 +5365,15 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(strcmp(ipaddr, "127.0.0.1") != 0); // ensure that valid results are maintained after StopListen - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); MARK(); TEST_MUSTPASS(rtpPort != 8000); TEST_MUSTPASS(strcmp(ipaddr, "127.0.0.1") != 0); // verify that results are maintained after new call to SetLocalReceiver - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); MARK(); TEST_MUSTPASS(rtpPort != 8000); @@ -5377,10 +5381,10 @@ int VoEExtendedTest::TestNetwork() { // STATE: not listening, not sending // send and receive packets with other settings for a while - TEST_MUSTPASS(base->SetLocalReceiver(0, 9005)); - TEST_MUSTPASS(base->SetSendDestination(0, 9005, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 9005)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 9005, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); // STATE: listening, sending @@ -5392,12 +5396,12 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(strcmp(ipaddr, "127.0.0.1") != 0); // restart sending to and from local IP - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->SetLocalReceiver(0, 9005, kVoEDefault, localIP)); - TEST_MUSTPASS(base->SetSendDestination(0, 9005, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 9005, kVoEDefault, localIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 9005, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); // verify new remote parameters @@ -5407,12 +5411,12 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(strcmp(ipaddr, localIP) != 0); // should not be "127.0.0.1" // use non-default source port in outgoing packets - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->SetLocalReceiver(0, 9005)); - TEST_MUSTPASS(base->SetSendDestination(0, 9005, "127.0.0.1", 9010)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 9005)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 9005, "127.0.0.1", 9010)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); // verify new remote parameters @@ -5424,8 +5428,8 @@ int VoEExtendedTest::TestNetwork() { // STATE: listening and sending using an extra local socket // stop/start sending - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); // verify that the unique source port is maintained for the extra socket @@ -5435,9 +5439,9 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(strcmp(ipaddr, "127.0.0.1") != 0); // set new source port for outgoing packets (9010 -> 9020) - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->SetSendDestination(0, 9005, "127.0.0.1", 9020)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 9005, "127.0.0.1", 9020)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); #ifdef MAC_IPHONE SLEEP(500); // Need extra pause for some reason @@ -5450,15 +5454,15 @@ int VoEExtendedTest::TestNetwork() { // STATE: listening and sending using an extra local socket // remove extra send socket and restart call again - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); // delete channel => destroys the + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); // delete channel => destroys the // extra socket - TEST_MUSTPASS(base->CreateChannel()); // new channel uses one socket only - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); // use new port as well - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); // new channel uses one socket only + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); // use new port as well + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); // verify that remote info is correct @@ -5471,13 +5475,13 @@ int VoEExtendedTest::TestNetwork() { // use non-default source port in outgoing packets to create extra send // socket - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->SetLocalReceiver(0, 7000)); - TEST_MUSTPASS(base->SetSendDestination(0, 7000, "127.0.0.1", 7010)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 7000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 7000, "127.0.0.1", 7010)); // RTP src is 7010 => RTCP src = 7011 - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); // verify new remote parameters TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); @@ -5492,10 +5496,10 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(rtpPort != 7010); TEST_MUSTPASS(rtcpPort != 7011); TEST_MUSTPASS(strcmp(ipaddr, "127.0.0.1") != 0); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); @@ -5522,7 +5526,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // different valid call combinations TEST_MUSTPASS(netw->RegisterExternalTransport(0, *ptrTransport)); @@ -5541,29 +5545,29 @@ int VoEExtendedTest::TestNetwork() { // STATE: external transport is disabled // initialize sending and ensure that external transport can't be enabled - TEST_MUSTPASS(base->SetSendDestination(0, 1234, "127.0.0.2")); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 1234, "127.0.0.2")); TEST_MUSTPASS(!netw->RegisterExternalTransport(0, *ptrTransport)); MARK(); TEST_ERROR(VE_SEND_SOCKETS_CONFLICT); // restart channel to ensure that "initialized sender" state is cleared - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); // initialize receiving and ensure that external transport can't be enabled - TEST_MUSTPASS(base->SetLocalReceiver(0, 5678)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 5678)); TEST_MUSTPASS(!netw->RegisterExternalTransport(0, *ptrTransport)); MARK(); TEST_ERROR(VE_RECEIVE_SOCKETS_CONFLICT); // restart channel to ensure that "initialized receiver" state is cleared - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); // enable external transport and verify that "emulated loopback" works TEST_MUSTPASS(netw->RegisterExternalTransport(0, *ptrTransport)); MARK(); - TEST_MUSTPASS(base->StartSend(0)); // should only start recording + TEST_MUSTPASS(voe_base_->StartSend(0)); // should only start recording TEST_MUSTPASS(!netw->RegisterExternalTransport(0, *ptrTransport)); MARK(); // should fail TEST_MUSTPASS(netw->DeRegisterExternalTransport(0)); @@ -5586,13 +5590,13 @@ int VoEExtendedTest::TestNetwork() { bool useSetSockopt, enabled; TEST_MUSTPASS(netw->RegisterExternalTransport(0, *ptrTransport)); MARK(); - TEST_MUSTPASS(!base->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(!voe_base_->SetLocalReceiver(0, 12345)); TEST_ERROR(VE_EXTERNAL_TRANSPORT_ENABLED); - TEST_MUSTPASS(!base->GetLocalReceiver(0, rtpPort, rtcpPort, ipaddr)); + TEST_MUSTPASS(!voe_base_->GetLocalReceiver(0, rtpPort, rtcpPort, ipaddr)); TEST_ERROR(VE_EXTERNAL_TRANSPORT_ENABLED); - TEST_MUSTPASS(!base->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(!voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); TEST_ERROR(VE_EXTERNAL_TRANSPORT_ENABLED); - TEST_MUSTPASS(!base->GetSendDestination(0, rtpPort, ipaddr, rtpPort, + TEST_MUSTPASS(!voe_base_->GetSendDestination(0, rtpPort, ipaddr, rtpPort, rtcpPort)); TEST_ERROR(VE_EXTERNAL_TRANSPORT_ENABLED); TEST_MUSTPASS(!netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); @@ -5607,8 +5611,8 @@ int VoEExtendedTest::TestNetwork() { TEST_ERROR(VE_EXTERNAL_TRANSPORT_ENABLED); // modified i VoE 3.4 (can be called also for external transport) - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); #if (!defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_MAC)) || \ defined(WEBRTC_EXTERNAL_TRANSPORT) @@ -5639,7 +5643,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); delete ptrTransport; - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); @@ -5671,7 +5675,7 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(!netw->EnableIPv6(0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // call with enabled external transport ptrTransport = new ExtendedTestTransport(netw); @@ -5687,11 +5691,11 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(!netw->EnableIPv6(0)); MARK(); // Should fail // Check that IPv6 address is invalid - TEST_MUSTPASS(!base->SetSendDestination(0, 8000, "::1")); MARK(); // fail + TEST_MUSTPASS(!voe_base_->SetSendDestination(0, 8000, "::1")); MARK(); // fail // New channel - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); // valid default call TEST_MUSTPASS(netw->EnableIPv6(0)); MARK(); @@ -5702,33 +5706,33 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(netw->IPv6IsEnabled(0) != true); // check that IPv4 address is invalid - TEST_MUSTPASS(!base->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(!voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); TEST_ERROR(VE_INVALID_IP_ADDRESS); // verify usage of IPv6 loopback address - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); // IPv6 loopback address is 0:0:0:0:0:0:0:1 - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "::1")); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "::1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); TEST_MUSTPASS(!netw->EnableIPv6(0)); MARK(); // Should fail - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); Play(0, 2000, true, true); ANL(); // Restart channel - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); TEST_MUSTPASS(netw->EnableIPv6(0)); MARK(); // ensure that Ipv6 is enabled TEST_MUSTPASS(netw->IPv6IsEnabled(0) != true); - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); // IPv6 loopback address is 0:0:0:0:0:0:0:1 - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "::1")); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "::1")); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true); SLEEP(500); // ensure that we receieve some packets @@ -5785,10 +5789,10 @@ int VoEExtendedTest::TestNetwork() { SLEEP(1500); file->StopPlayingFileAsMicrophone(0); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); #endif // #ifdef _ENABLE_IPV6_TESTS_ // >> end of EnableIPv6 @@ -5808,7 +5812,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // invalid parameters TEST_MUSTPASS(!netw->SetSourceFilter(0, 65536)); @@ -5826,10 +5830,10 @@ int VoEExtendedTest::TestNetwork() { // disable all filters and ensure that media is received TEST_MUSTPASS(netw->SetSourceFilter(0, 0, 0, NULL)); MARK(); - TEST_MUSTPASS(base->SetLocalReceiver(0, 2000, kVoEDefault, localIP)); - TEST_MUSTPASS(base->SetSendDestination(0, 2000, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 2000, kVoEDefault, localIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 2000, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); @@ -5838,16 +5842,16 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(strcmp(ipaddr, localIP) != 0); // clear states and restart loopback session - TEST_MUSTPASS(base->DeleteChannel(0)); // clear source info state - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); // clear source info state + TEST_MUSTPASS(voe_base_->CreateChannel()); // set RTP filter to port 2002 and verify that source 2000 is blocked TEST_MUSTPASS(netw->SetSourceFilter(0, 2002, 0, NULL));; MARK(); - TEST_MUSTPASS(base->SetLocalReceiver(0, 2000, kVoEDefault, localIP)); - TEST_MUSTPASS(base->SetSendDestination(0, 2000, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 2000, kVoEDefault, localIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 2000, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); TEST_MUSTPASS(rtpPort != 0); @@ -5855,30 +5859,30 @@ int VoEExtendedTest::TestNetwork() { // ensure that received packets originates from 2002 and that they now pass // the filter - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); // RTP source is 2002 - TEST_MUSTPASS(base->SetLocalReceiver(0, 2002, kVoEDefault, localIP)); - TEST_MUSTPASS(base->SetSendDestination(0, 2002, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 2002, kVoEDefault, localIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 2002, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); TEST_MUSTPASS(rtpPort != 2002); TEST_MUSTPASS(strcmp(ipaddr, localIP) != 0); // clear states and restart loopback session - TEST_MUSTPASS(base->DeleteChannel(0)); // clear source info state - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); // clear source info state + TEST_MUSTPASS(voe_base_->CreateChannel()); // set IP filter to local IP and verify that default loopback stream is // blocked TEST_MUSTPASS(netw->SetSourceFilter(0, 0, 0, localIP));; MARK(); - TEST_MUSTPASS(base->SetLocalReceiver(0, 2000)); - TEST_MUSTPASS(base->SetSendDestination(0, 2000, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 2000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 2000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); TEST_MUSTPASS(rtpPort != 0); @@ -5886,20 +5890,20 @@ int VoEExtendedTest::TestNetwork() { // ensure that received packets originates from the local IP and that they // now pass the filter - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); // should pass the filter - TEST_MUSTPASS(base->SetLocalReceiver(0, 2000, kVoEDefault, localIP)); - TEST_MUSTPASS(base->SetSendDestination(0, 2000, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 2000, kVoEDefault, localIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 2000, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); TEST_MUSTPASS(netw->GetSourceInfo(0, rtpPort, rtcpPort, ipaddr)); TEST_MUSTPASS(rtpPort != 2000); TEST_MUSTPASS(strcmp(ipaddr, localIP) != 0); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); // STATE: no active media, IP filter is active @@ -5911,7 +5915,7 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(rtcpPort != 0); TEST_MUSTPASS(strcmp(ipaddr, "") != 0); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); ANL(); @@ -5934,7 +5938,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // invalid input parameters TEST_MUSTPASS(!netw->GetSourceFilter(0, rtpPort, rtcpPort, NULL)); @@ -5984,7 +5988,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_MUSTPASS(strcmp(ipaddr, "") != 0); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); ANL(); @@ -6010,7 +6014,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); TEST_MUSTPASS(netw->RegisterDeadOrAliveObserver(0, *this)); MARK(); @@ -6026,7 +6030,7 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(netw->DeRegisterDeadOrAliveObserver(0)); MARK(); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); // STATE: dead-or-alive observer is disabled @@ -6046,7 +6050,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // Invalid paramters TEST_MUSTPASS(!netw->SetPeriodicDeadOrAliveStatus(0, true, 0)); @@ -6100,10 +6104,10 @@ int VoEExtendedTest::TestNetwork() { TEST_LOG("\nStop sending and enable callbacks again.\n"); TEST_LOG("Verify that Dead callbacks are received (dT=2sec): "); fflush(NULL); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(netw->SetPeriodicDeadOrAliveStatus(0, true, 2)); SLEEP(6000); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("\nRestart sending.\n"); TEST_LOG("Verify that Alive callbacks are received again (dT=2sec): "); fflush(NULL); @@ -6116,7 +6120,7 @@ int VoEExtendedTest::TestNetwork() { StopMedia(0); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); ANL(); @@ -6146,7 +6150,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // invalid function calls TEST_MUSTPASS(!netw->SetPacketTimeoutNotification(0, true, 0)); @@ -6186,7 +6190,7 @@ int VoEExtendedTest::TestNetwork() { MARK(); TEST_MUSTPASS(enabled != false); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); ANL(); @@ -6221,7 +6225,7 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(!netw->SetSendTOS(0, 0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // trivial invalid function calls TEST_MUSTPASS(!netw->SetSendTOS(0, -1)); MARK(); @@ -6236,7 +6240,7 @@ int VoEExtendedTest::TestNetwork() { TEST_ERROR(VE_SOCKET_ERROR); // must create sockets first #ifdef _WIN32 - TEST_MUSTPASS(base->SetLocalReceiver(0, 3000)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 3000)); // enable ToS using SetSockopt (should work without local binding) TEST_MUSTPASS(netw->SetSendTOS(0, 1, -1, true)); MARK(); @@ -6262,7 +6266,7 @@ int VoEExtendedTest::TestNetwork() { TEST_ERROR(VE_TOS_ERROR); // must bind to local IP first // bind to local IP and try again (should work this time) - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345, kVoEDefault, localIP)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345, kVoEDefault, localIP)); TEST_LOG("\nThis test needs to be run as administrator\n"); TEST_MUSTPASS(netw->SetSendTOS(0, 1, -1, false)); MARK(); TEST_MUSTPASS(netw->GetSendTOS(0, DSCP, priority, useSetSockopt)); MARK(); @@ -6274,9 +6278,9 @@ int VoEExtendedTest::TestNetwork() { // SetSockopt) // verify loopback audio with the current settings - TEST_MUSTPASS(base->SetSendDestination(0, 12345, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); Play(0, 2000, true, true); // file should be played out here... #ifdef _SEND_TO_REMOTE_IP_ @@ -6286,7 +6290,7 @@ int VoEExtendedTest::TestNetwork() { "remote side!\n"); TEST_LOG("Sending approx. 5 packets to %s:%d for each DSCP below:\n", RemoteIP, RemotePort); - TEST_MUSTPASS(base->SetSendDestination(0, RemotePort, RemoteIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, RemotePort, RemoteIP)); TEST_LOG(" DSCP is set to 0x%02x\n", 1); SLEEP(100); @@ -6303,38 +6307,38 @@ int VoEExtendedTest::TestNetwork() { SLEEP(100); // stop and resume sending - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(netw->GetSendTOS(0, DSCP, priority, useSetSockopt)); TEST_LOG(" DSCP is set to 0x%02x\n", DSCP); SLEEP(100); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(netw->SetSendTOS(0, 0)); #endif // _SEND_TO_REMOTE_IP_ // Windows priority tests (priority cannot be set using setsockopt on Win) TEST_LOG("Testing priority\n"); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); TEST_MUSTPASS(!netw->SetSendTOS(0, 0, 3, true)); // Should fail TEST_ERROR(VE_INVALID_ARGUMENT); TEST_MUSTPASS(netw->SetSendTOS(0, 0, 3, false)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); Play(0, 2000, true, true); // file should be played out here... - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(netw->SetSendTOS(0, 1, 3, false)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); Play(0, 2000, true, true); // file should be played out here... - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); #endif // _WIN32 // STATE: no media, disabled ToS, no defined receiver // Repeat tests above but using setsockopt() this time. // Binding to local IP should not be required. - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345, kVoEDefault)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345, kVoEDefault)); TEST_MUSTPASS(netw->SetSendTOS(0, 10, -1, true)); MARK(); TEST_MUSTPASS(netw->GetSendTOS(0, DSCP, priority, useSetSockopt)); MARK(); TEST_MUSTPASS(DSCP != 10); @@ -6345,9 +6349,9 @@ int VoEExtendedTest::TestNetwork() { // (using SetSockopt) // verify loopback audio with the current settings - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); Play(0, 2000, true, true); // file should be played out here... #ifdef _SEND_TO_REMOTE_IP_ @@ -6357,7 +6361,7 @@ int VoEExtendedTest::TestNetwork() { " remote side!\n"); TEST_LOG("Sending approx. 5 packets to %s:%d for each DSCP below:\n", RemoteIP, RemotePort); - TEST_MUSTPASS(base->SetSendDestination(0, RemotePort, RemoteIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, RemotePort, RemoteIP)); TEST_MUSTPASS(netw->GetSendTOS(0, DSCP, priority, useSetSockopt)); TEST_LOG(" DSCP is set to 0x%02x (setsockopt)\n", DSCP); SLEEP(100); @@ -6375,26 +6379,26 @@ int VoEExtendedTest::TestNetwork() { SLEEP(100); // stop and resume sending - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(netw->GetSendTOS(0, DSCP, priority, useSetSockopt)); TEST_LOG(" DSCP is set to 0x%02x (setsockopt)\n", DSCP); SLEEP(100); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(netw->SetSendTOS(0, 0, -1, true)); #endif // _SEND_TO_REMOTE_IP_ #if defined(WEBRTC_LINUX) // Linux priority tests (using setsockopt) TEST_LOG("Testing priority\n"); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, localIP)); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, localIP)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); TEST_MUSTPASS(netw->SetSendTOS(0, 0, 3, true)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); Play(0, 2000, true, true); // file should be played out here... - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(netw->SetSendTOS(0, 1, 3, true)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); Play(0, 2000, true, true); // file should be played out here... #endif // #if defined(WEBRTC_LINUX) #if !defined(_WIN32) && !defined(WEBRTC_LINUX) @@ -6402,7 +6406,7 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(!netw->SetSendTOS(0, 0, 3, false)); // Should fail TEST_ERROR(VE_INVALID_ARGUMENT); #endif // #if !defined(_WIN32) && !defined(WEBRTC_LINUX) - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); ANL(); ANL(); // END #if defined(_WIN32) || defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) @@ -6448,19 +6452,19 @@ int VoEExtendedTest::TestNetwork() { TEST_MUSTPASS(!netw->SetSendGQoS(0, false, 0)); MARK(); TEST_ERROR(VE_CHANNEL_NOT_VALID); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); // supported service type but no sockets TEST_MUSTPASS(!netw->SetSendGQoS(0, true, SERVICETYPE_BESTEFFORT)); MARK(); TEST_ERROR(VE_SOCKETS_NOT_INITED); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); // supported service type but sender is not initialized TEST_MUSTPASS(!netw->SetSendGQoS(0, true, SERVICETYPE_BESTEFFORT)); MARK(); TEST_ERROR(VE_DESTINATION_NOT_INITED); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); // invalid service types TEST_MUSTPASS(!netw->SetSendGQoS(0, true, SERVICETYPE_NOTRAFFIC)); MARK(); @@ -6538,8 +6542,8 @@ int VoEExtendedTest::TestNetwork() { // Loopback tests using the four different GQoS settings TEST_MUSTPASS(netw->SetSendGQoS(0, true, SERVICETYPE_BESTEFFORT)); MARK(); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); ANL(); TEST_LOG("[SERVICETYPE_BESTEFFORT]"); Play(0, 2000, true, true); // file should be played out here... @@ -6564,7 +6568,7 @@ int VoEExtendedTest::TestNetwork() { // Use filter ip.src == "RemoteIP". // Modify the send destination on the fly - TEST_MUSTPASS(base->SetSendDestination(0, RemotePort, RemoteIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, RemotePort, RemoteIP)); TEST_LOG("\nUse Wireshark and verify a correctly received DSCP mapping at" " the remote side!\n"); @@ -6595,8 +6599,8 @@ int VoEExtendedTest::TestNetwork() { " be mapped to DSCP = 0x00\n", serviceType); SLEEP(100); #endif // _SEND_TO_REMOTE_IP_ - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); // STATE: sockets exists, sending side is initialized, no media @@ -6618,15 +6622,15 @@ int VoEExtendedTest::TestNetwork() { TEST_ERROR(VE_GQOS_ERROR); // make proper settings and try again (should work this time) - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345, kVoEDefault, localIP)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, localIP)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345, kVoEDefault, localIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, localIP)); TEST_MUSTPASS(netw->SetSendGQoS(0, true, SERVICETYPE_BESTEFFORT, 3)); MARK(); // Now, let's try some loopback tests using override DSCP - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); ANL(); TEST_LOG("[overrideDSCP=3]"); Play(0, 2000, true, true); // file should be played out here... @@ -6642,7 +6646,7 @@ int VoEExtendedTest::TestNetwork() { #ifdef _SEND_TO_REMOTE_IP_ // Modify the send destination on the fly - TEST_MUSTPASS(base->SetSendDestination(0, RemotePort, RemoteIP)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, RemotePort, RemoteIP)); TEST_LOG("\nUse Wireshark and verify a correctly received DSCP mapping at" " the remote side!\n"); @@ -6672,10 +6676,10 @@ int VoEExtendedTest::TestNetwork() { TEST_LOG(" QoS is disabled, should give DSCP = 0x%02x\n", 0); SLEEP(100); #endif // _SEND_TO_REMOTE_IP_ - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); ANL(); AOK(); ANL(); ANL(); #else @@ -6687,11 +6691,11 @@ int VoEExtendedTest::TestNetwork() { if (file) { file->StopPlayingFileAsMicrophone(0); } - base->StopSend(0); - base->StopPlayout(0); - base->StopReceive(0); - base->DeleteChannel(0); - base->Terminate(); + voe_base_->StopSend(0); + voe_base_->StopPlayout(0); + voe_base_->StopReceive(0); + voe_base_->DeleteChannel(0); + voe_base_->Terminate(); ANL(); AOK(); @@ -6772,7 +6776,7 @@ private: int VoEExtendedTest::TestRTP_RTCP() { PrepareTest("RTP_RTCP"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEFile* file = _mgr.FilePtr(); VoERTP_RTCP* rtp_rtcp = _mgr.RTP_RTCPPtr(); VoENetwork* network = _mgr.NetworkPtr(); @@ -6800,13 +6804,13 @@ int VoEExtendedTest::TestRTP_RTCP() { kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); /////////////////////////// // Actual test starts here @@ -6848,13 +6852,13 @@ int VoEExtendedTest::TestRTP_RTCP() { TEST_MUSTPASS(audioLevelEnabled != false); TEST_MUSTPASS(ID != id); } - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); RTPAudioTransport rtpAudioTransport; - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); TEST_MUSTPASS(network->RegisterExternalTransport(0, rtpAudioTransport)); TEST_MUSTPASS(rtp_rtcp->SetRTPAudioLevelIndicationStatus(0, true)); TEST_MUSTPASS(codec->SetVADStatus(0, true)); @@ -6864,53 +6868,53 @@ int VoEExtendedTest::TestRTP_RTCP() { SLEEP(2000); rtpAudioTransport.set_mute(true); TEST_MUSTPASS(volume->SetInputMute(0, true)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(5000); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); rtpAudioTransport.set_mute(false); TEST_MUSTPASS(volume->SetInputMute(0, false)); printf("\nReceiving packets from mic (should respond to mic level)...\n"); printf("VAD Level [dbFS]\n"); SLEEP(2000); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(5000); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); printf("\nReceiving packets from file (expect mostly VAD = 1)...\n"); printf("VAD Level [dbFS]\n"); SLEEP(2000); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(5000); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); printf("\nMuted and mic on independent channels...\n"); printf("Muted Mic\n"); SLEEP(2000); - ASSERT_TRUE(1 == base->CreateChannel()); + ASSERT_TRUE(1 == voe_base_->CreateChannel()); TEST_MUSTPASS(network->RegisterExternalTransport(1, rtpAudioTransport)); TEST_MUSTPASS(rtp_rtcp->SetRTPAudioLevelIndicationStatus(1, true)); TEST_MUSTPASS(codec->SetVADStatus(1, true)); TEST_MUSTPASS(volume->SetInputMute(0, true)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartSend(1)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(1)); SLEEP(5000); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopSend(1)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(1)); TEST_MUSTPASS(network->DeRegisterExternalTransport(0)); TEST_MUSTPASS(network->DeRegisterExternalTransport(1)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->DeleteChannel(1)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(1)); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); MARK(); ANL(); @@ -6923,10 +6927,10 @@ int VoEExtendedTest::TestRTP_RTCP() { TEST(SetLocalSSRC); TEST_MUSTPASS(!rtp_rtcp->SetLocalSSRC(0, 5678)); MARK(); - TEST_MUSTPASS(VE_ALREADY_SENDING != base->LastError()); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(VE_ALREADY_SENDING != voe_base_->LastError()); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(rtp_rtcp->SetLocalSSRC(0, 5678)); // force send SSRC to 5678 - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); MARK(); ANL(); @@ -6960,12 +6964,12 @@ int VoEExtendedTest::TestRTP_RTCP() { payloadData, 1500-28+1)); MARK(); // invalid size TEST_ERROR(VE_INVALID_ARGUMENT); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(-1 != rtp_rtcp->InsertExtraRTPPacket(0, 99, false, payloadData, 8)); MARK(); // not sending TEST_ERROR(VE_NOT_SENDING); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); @@ -7074,11 +7078,11 @@ int VoEExtendedTest::TestRTP_RTCP() { TEST(CNAME); TEST_MUSTPASS(!rtp_rtcp->SetRTCP_CNAME(0, NULL)); MARK(); - TEST_MUSTPASS(VE_RTP_RTCP_MODULE_ERROR != base->LastError()); + TEST_MUSTPASS(VE_RTP_RTCP_MODULE_ERROR != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!rtp_rtcp->GetRemoteRTCP_CNAME(0, NULL)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); ANL(); @@ -7100,12 +7104,12 @@ int VoEExtendedTest::TestRTP_RTCP() { ANL(); TEST(SetRTPObserver); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(rtp_rtcp->RegisterRTPObserver(0, rtpObserver)); TEST_MUSTPASS(rtp_rtcp->DeRegisterRTPObserver(0)); TEST_MUSTPASS(rtp_rtcp->RegisterRTPObserver(0, rtpObserver)); TEST_MUSTPASS(rtp_rtcp->SetLocalSSRC(0, 7777)); // force send SSRC to 7777 - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(sleepTime); // verify that the new SSRC has been detected by the observer TEST_MUSTPASS(rtpObserver._SSRC != 7777); @@ -7126,7 +7130,7 @@ int VoEExtendedTest::TestRTP_RTCP() { TEST(SetRTPKeepaliveStatus); // stop send before changing the settings - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); // verify invalid input parameters TEST_MUSTPASS(!rtp_rtcp->SetRTPKeepaliveStatus(-1, true, 0, 15)); MARK(); @@ -7157,19 +7161,19 @@ int VoEExtendedTest::TestRTP_RTCP() { // Make fresh restart (ensures that SSRC is randomized) TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); SLEEP(100); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); @@ -7235,14 +7239,14 @@ int VoEExtendedTest::TestRTP_RTCP() { cinst.channels = 1; cinst.rate = 40000; #endif - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst)); TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(rtp_rtcp->SetFECStatus(0, true, -1)); MARK(); TEST_MUSTPASS(codec->SetVADStatus(0,true)); @@ -7306,8 +7310,8 @@ int VoEExtendedTest::TestRTP_RTCP() { TEST(RTCPStatistics #2); ANL(); TEST_LOG("restart sending and ensure that the statistics is reset"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(50); // ensures approx. two received packets TEST_MUSTPASS(rtp_rtcp->GetRTCPStatistics(0, stats)); TEST_LOG("\n fractionLost = %hu \n cumulativeLost = %u \n " @@ -7338,8 +7342,8 @@ int VoEExtendedTest::TestRTP_RTCP() { TEST(RTCPStatistics #4); ANL(); TEST_LOG("restart receiving and check RX statistics"); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); SLEEP(50); // ensures approx. two received packets TEST_MUSTPASS(rtp_rtcp->GetRTCPStatistics(0, stats)); TEST_LOG("\n fractionLost = %hu \n cumulativeLost = %u \n " @@ -7354,12 +7358,12 @@ int VoEExtendedTest::TestRTP_RTCP() { TEST(SendApplicationDefinedRTCPPacket); // just do some fail tests here - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); // should fail since sending is off TEST_MUSTPASS(!rtp_rtcp->SendApplicationDefinedRTCPPacket( 0, 0, 0, "abcdabcdabcdabcdabcdabcdabcdabcd", 32)); MARK(); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(rtp_rtcp->SendApplicationDefinedRTCPPacket( 0, 0, 0, "abcdabcdabcdabcdabcdabcdabcdabcd", 32)); MARK(); @@ -7384,9 +7388,9 @@ int VoEExtendedTest::TestRTP_RTCP() { #ifdef WEBRTC_CODEC_RED TEST(SetFECStatus); ANL(); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); cinst.pltype = 126; strcpy(cinst.plname, "red"); cinst.plfreq = 8000; @@ -7412,11 +7416,11 @@ int VoEExtendedTest::TestRTP_RTCP() { // We have to re-register the audio codec payload type as stopReceive will // clean the database TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst)); - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("Start playing a file as microphone again \n"); TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); @@ -7428,11 +7432,11 @@ int VoEExtendedTest::TestRTP_RTCP() { MARK(); #endif // #ifdef WEBRTC_CODEC_RED TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); ANL(); AOK(); @@ -7447,7 +7451,7 @@ int VoEExtendedTest::TestVideoSync() { PrepareTest("VideoSync"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEVideoSync* vsync = _mgr.VideoSyncPtr(); // check if this interface is supported @@ -7470,13 +7474,13 @@ int VoEExtendedTest::TestVideoSync() kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); /////////////////////////// // Actual test starts here @@ -7484,11 +7488,11 @@ int VoEExtendedTest::TestVideoSync() TEST(SetInitTimestamp); ANL(); TEST_MUSTPASS(!vsync->SetInitTimestamp(0, 12345)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); MARK(); SLEEP(1000); TEST_MUSTPASS(vsync->SetInitTimestamp(0, 12345)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); MARK(); SLEEP(1000); AOK(); @@ -7497,11 +7501,11 @@ int VoEExtendedTest::TestVideoSync() TEST(SetInitSequenceNumber); ANL(); TEST_MUSTPASS(!vsync->SetInitSequenceNumber(0, 123)); - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); MARK(); SLEEP(1000); TEST_MUSTPASS(vsync->SetInitSequenceNumber(0, 123)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); MARK(); SLEEP(1000); AOK(); @@ -7524,17 +7528,17 @@ int VoEExtendedTest::TestVideoSync() TEST(SetMinimumPlayoutDelay); ANL(); TEST_MUSTPASS(!vsync->SetMinimumPlayoutDelay(0, -1)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); TEST_MUSTPASS(!vsync->SetMinimumPlayoutDelay(0, 5000)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); MARK(); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); AOK(); ANL(); @@ -7549,7 +7553,7 @@ int VoEExtendedTest::TestVolumeControl() { PrepareTest("TestVolumeControl"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEVolumeControl* volume = _mgr.VolumeControlPtr(); #ifdef _TEST_FILE_ VoEFile* file = _mgr.FilePtr(); @@ -7571,8 +7575,8 @@ int VoEExtendedTest::TestVolumeControl() kTraceInfo)); #endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); #if (defined _TEST_HARDWARE_ && (!defined(MAC_IPHONE) && \ !defined(WEBRTC_ANDROID))) #if defined(_WIN32) @@ -7583,11 +7587,11 @@ int VoEExtendedTest::TestVolumeControl() TEST_MUSTPASS(hardware->SetPlayoutDevice(0)); #endif #endif - TEST_MUSTPASS(base->SetLocalReceiver(0, 12345)); - TEST_MUSTPASS(base->SetSendDestination(0, 12345, "127.0.0.1")); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 12345)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 12345, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); #ifdef _TEST_FILE_ TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, _mgr.AudioFilename(), true, true)); @@ -7601,14 +7605,14 @@ int VoEExtendedTest::TestVolumeControl() ANL(); TEST_MUSTPASS(-1 != volume->SetSpeakerVolume(256)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); ANL(); #endif // #if !defined(MAC_IPHONE) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) TEST(SetMicVolume); ANL(); TEST_MUSTPASS(-1 != volume->SetMicVolume(256)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); ANL(); #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) @@ -7617,10 +7621,10 @@ int VoEExtendedTest::TestVolumeControl() ANL(); TEST_MUSTPASS(-1 != volume->SetChannelOutputVolumeScaling(0, (float)-0.1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(-1 != volume->SetChannelOutputVolumeScaling(0, (float)10.1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); ANL(); #endif // #if !defined(MAC_IPHONE) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) @@ -7629,19 +7633,19 @@ int VoEExtendedTest::TestVolumeControl() TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(-1, (float)-0.1, (float)1.0)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(-1, (float)1.1, (float)1.0)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(-1, (float)1.0, (float)-0.1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(-1, (float)1.0, (float)1.1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); ANL(); TEST(SetChannelOutputVolumePan); @@ -7649,29 +7653,29 @@ int VoEExtendedTest::TestVolumeControl() TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(0, (float)-0.1, (float)1.0)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(0, (float)1.1, (float)1.0)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(0, (float)1.0, (float)-0.1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(0, (float)1.0, (float)1.1)); MARK(); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); + TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); ANL(); #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #ifdef _TEST_FILE_ TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); #endif - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); AOK(); ANL(); @@ -7685,7 +7689,7 @@ int VoEExtendedTest::TestVolumeControl() int VoEExtendedTest::TestAPM() { PrepareTest("AudioProcessing"); - VoEBase* base = _mgr.BasePtr(); + VoEBase* voe_base_ = _mgr.BasePtr(); VoEAudioProcessing* apm = _mgr.APMPtr(); //#ifdef _USE_EXTENDED_TRACE_ @@ -7700,8 +7704,8 @@ int VoEExtendedTest::TestAPM() { kTraceInfo)); //#endif - TEST_MUSTPASS(base->Init()); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->Init()); + TEST_MUSTPASS(voe_base_->CreateChannel()); /////////////////////////// // Actual test starts here @@ -7950,7 +7954,7 @@ int VoEExtendedTest::TestAPM() { agcConfig = agcConfigDefault; agcConfig.targetLeveldBOv = targetLeveldBOvMax + 1; TEST_MUSTPASS(!apm->SetAgcConfig(agcConfig)); - int err = base->LastError(); + int err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_APM_ERROR); agcConfig = agcConfigDefault; agcConfig.digitalCompressionGaindB @@ -8101,12 +8105,12 @@ int VoEExtendedTest::TestAPM() { int ERL, ERLE, RERL, A_NLP; TEST_MUSTPASS(-1 != apm->GetEchoMetrics(ERL, ERLE, RERL, A_NLP)); MARK(); // Should fail since not activated. - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_APM_ERROR); TEST_MUSTPASS(apm->SetEcMetricsStatus(true)); TEST_MUSTPASS(-1 != apm->GetEchoMetrics(ERL, ERLE, RERL, A_NLP)); MARK(); // Should fail since AEC is off. - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_APM_ERROR); TEST_MUSTPASS(apm->SetEcStatus(true)); TEST_MUSTPASS(apm->GetEchoMetrics(ERL, ERLE, RERL, A_NLP)); @@ -8125,12 +8129,12 @@ int VoEExtendedTest::TestAPM() { int delay_std = 0; TEST_MUSTPASS(-1 != apm->GetEcDelayMetrics(delay_median, delay_std)); MARK(); // Should fail since not activated. - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_APM_ERROR); TEST_MUSTPASS(apm->SetEcMetricsStatus(true)); TEST_MUSTPASS(-1 != apm->GetEcDelayMetrics(delay_median, delay_std)); MARK(); // Should fail since AEC is off. - err = base->LastError(); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_APM_ERROR); TEST_MUSTPASS(apm->SetEcStatus(true)); TEST_MUSTPASS(apm->GetEcDelayMetrics(delay_median, delay_std)); @@ -8249,7 +8253,7 @@ int VoEExtendedTest::TestAPM() { rxAGCConfig = rxAGCConfigDefault; rxAGCConfig.targetLeveldBOv = rxTargetLeveldBOvMax + 1; TEST_MUSTPASS(!apm->SetRxAgcConfig(0, rxAGCConfig)); - int rxErr = base->LastError(); + int rxErr = voe_base_->LastError(); TEST_MUSTPASS(rxErr != VE_APM_ERROR); rxAGCConfig = rxAGCConfigDefault; rxAGCConfig.digitalCompressionGaindB @@ -8376,8 +8380,8 @@ int VoEExtendedTest::TestAPM() { TEST_LOG("StopDebugRecording"); TEST_MUSTPASS(apm->StopDebugRecording()); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); return 0; } diff --git a/src/voice_engine/main/test/auto_test/voe_standard_test.cc b/src/voice_engine/main/test/auto_test/voe_standard_test.cc index 6c01f12adc..0aedc82cb8 100644 --- a/src/voice_engine/main/test/auto_test/voe_standard_test.cc +++ b/src/voice_engine/main/test/auto_test/voe_standard_test.cc @@ -19,7 +19,8 @@ #include "voe_standard_test.h" -#if defined (_ENABLE_VISUAL_LEAK_DETECTOR_) && defined(_DEBUG) && defined(_WIN32) && !defined(_INSTRUMENTATION_TESTING_) +#if defined (_ENABLE_VISUAL_LEAK_DETECTOR_) && defined(_DEBUG) && \ + defined(_WIN32) && !defined(_INSTRUMENTATION_TESTING_) #include "vld.h" #endif @@ -171,7 +172,8 @@ void MyRTPObserver::OnIncomingCSRCChanged(const int channel, void MyRTPObserver::OnIncomingSSRCChanged(const int channel, const unsigned int SSRC) { char msg[128]; - sprintf(msg, "\n=> OnIncomingSSRCChanged(channel=%d, SSRC=%u)\n", channel, SSRC); + sprintf(msg, "\n=> OnIncomingSSRCChanged(channel=%d, SSRC=%u)\n", channel, + SSRC); TEST_LOG("%s", msg); _SSRC[channel] = SSRC; @@ -212,50 +214,50 @@ void MyMedia::Process(const int channel, MyMedia mobj; -my_transportation::my_transportation(VoENetwork* ptr) - : myNetw(ptr), - _thread(NULL), - _lock(NULL), - _event(NULL), - _length(0), - _channel(0), - _delayIsEnabled(0), - _delayTimeInMs(0) { +FakeExternalTransport::FakeExternalTransport(VoENetwork* ptr) + : my_network_(ptr), + thread_(NULL), + lock_(NULL), + event_(NULL), + length_(0), + channel_(0), + delay_is_enabled_(0), + delay_time_in_ms_(0) { const char* threadName = "external_thread"; - _lock = CriticalSectionWrapper::CreateCriticalSection(); - _event = EventWrapper::Create(); - _thread = ThreadWrapper::CreateThread(Run, this, kHighPriority, threadName); - if (_thread) { + lock_ = CriticalSectionWrapper::CreateCriticalSection(); + event_ = EventWrapper::Create(); + thread_ = ThreadWrapper::CreateThread(Run, this, kHighPriority, threadName); + if (thread_) { unsigned int id; - _thread->Start(id); + thread_->Start(id); } } -my_transportation::~my_transportation() { - if (_thread) { - _thread->SetNotAlive(); - _event->Set(); - if (_thread->Stop()) { - delete _thread; - _thread = NULL; - delete _event; - _event = NULL; - delete _lock; - _lock = NULL; +FakeExternalTransport::~FakeExternalTransport() { + if (thread_) { + thread_->SetNotAlive(); + event_->Set(); + if (thread_->Stop()) { + delete thread_; + thread_ = NULL; + delete event_; + event_ = NULL; + delete lock_; + lock_ = NULL; } } } -bool my_transportation::Run(void* ptr) { - return static_cast (ptr)->Process(); +bool FakeExternalTransport::Run(void* ptr) { + return static_cast (ptr)->Process(); } -bool my_transportation::Process() { - switch (_event->Wait(500)) { +bool FakeExternalTransport::Process() { + switch (event_->Wait(500)) { case kEventSignaled: - _lock->Enter(); - myNetw->ReceivedRTPPacket(_channel, _packetBuffer, _length); - _lock->Leave(); + lock_->Enter(); + my_network_->ReceivedRTPPacket(channel_, packet_buffer_, length_); + lock_->Leave(); return true; case kEventTimeout: return true; @@ -265,29 +267,29 @@ bool my_transportation::Process() { return true; } -int my_transportation::SendPacket(int channel, const void *data, int len) { - _lock->Enter(); +int FakeExternalTransport::SendPacket(int channel, const void *data, int len) { + lock_->Enter(); if (len < 1612) { - memcpy(_packetBuffer, (const unsigned char*) data, len); - _length = len; - _channel = channel; + memcpy(packet_buffer_, (const unsigned char*) data, len); + length_ = len; + channel_ = channel; } - _lock->Leave(); - _event->Set(); // triggers ReceivedRTPPacket() from worker thread + lock_->Leave(); + event_->Set(); // triggers ReceivedRTPPacket() from worker thread return len; } -int my_transportation::SendRTCPPacket(int channel, const void *data, int len) { - if (_delayIsEnabled) { - Sleep(_delayTimeInMs); +int FakeExternalTransport::SendRTCPPacket(int channel, const void *data, int len) { + if (delay_is_enabled_) { + Sleep(delay_time_in_ms_); } - myNetw->ReceivedRTCPPacket(channel, data, len); + my_network_->ReceivedRTCPPacket(channel, data, len); return len; } -void my_transportation::SetDelayStatus(bool enable, unsigned int delayInMs) { - _delayIsEnabled = enable; - _delayTimeInMs = delayInMs; +void FakeExternalTransport::SetDelayStatus(bool enable, unsigned int delayInMs) { + delay_is_enabled_ = enable; + delay_time_in_ms_ = delayInMs; } ErrorObserver::ErrorObserver() { @@ -603,26 +605,26 @@ bool SubAPIManager::GetExtendedMenuSelection(ExtendedSelection& sel) { VoETestManager::VoETestManager() : initialized_(false), - ve(0), - base(0), - report(0), - codec(0), - dtmf(0), - encrypt(0), - xmedia(0), - file(0), - hardware(0), + voice_engine_(NULL), + voe_base_(0), + voe_call_report_(0), + voe_codec_(0), + voe_dtmf_(0), + voe_encrypt_(0), + voe_xmedia_(0), + voe_file_(0), + voe_hardware_(0), + voe_network_(0), #ifdef _TEST_NETEQ_STATS_ - neteqst(NULL), + voe_neteq_stats_(NULL), #endif - netw(0), - rtp_rtcp(0), - vsync(0), - volume(0), - apm(0), - instanceCount(0), - resourcePath_(), - audioFilename_() { + voe_rtp_rtcp_(0), + voe_vsync_(0), + voe_volume_control_(0), + voe_apm_(0), + resource_path_(), + audio_filename_() +{ } VoETestManager::~VoETestManager() { @@ -641,60 +643,60 @@ bool VoETestManager::Init() { } #if defined(WEBRTC_ANDROID) - resourcePath_ = "/sdcard/"; + resource_path_ = "/sdcard/"; #else - resourcePath_ = webrtc::test::ProjectRootPath(); - if (resourcePath_ == webrtc::test::kCannotFindProjectRootDir) { + resource_path_ = webrtc::test::ProjectRootPath(); + if (resource_path_ == webrtc::test::kCannotFindProjectRootDir) { TEST_LOG("Failed to get project root directory\n"); return false; } - resourcePath_ += "test/data/voice_engine/"; + resource_path_ += "test/data/voice_engine/"; #endif - audioFilename_ = resourcePath_ + "audio_long16.pcm"; + audio_filename_ = resource_path_ + "audio_long16.pcm"; - ve = VoiceEngine::Create(); - if (!ve) { + voice_engine_ = VoiceEngine::Create(); + if (!voice_engine_) { TEST_LOG("Failed to create VoiceEngine\n"); return false; } - instanceCount++; return true; } void VoETestManager::GetInterfaces() { - if (ve) { - base = VoEBase::GetInterface(ve); - codec = VoECodec::GetInterface(ve); - volume = VoEVolumeControl::GetInterface(ve); - dtmf = VoEDtmf::GetInterface(ve); - rtp_rtcp = VoERTP_RTCP::GetInterface(ve); - apm = VoEAudioProcessing::GetInterface(ve); - netw = VoENetwork::GetInterface(ve); - file = VoEFile::GetInterface(ve); + if (voice_engine_) { + voe_base_ = VoEBase::GetInterface(voice_engine_); + voe_codec_ = VoECodec::GetInterface(voice_engine_); + voe_volume_control_ = VoEVolumeControl::GetInterface(voice_engine_); + voe_dtmf_ = VoEDtmf::GetInterface(voice_engine_); + voe_rtp_rtcp_ = VoERTP_RTCP::GetInterface(voice_engine_); + voe_apm_ = VoEAudioProcessing::GetInterface(voice_engine_); + voe_network_ = VoENetwork::GetInterface(voice_engine_); + voe_file_ = VoEFile::GetInterface(voice_engine_); #ifdef _TEST_VIDEO_SYNC_ - vsync = VoEVideoSync::GetInterface(ve); + voe_vsync_ = VoEVideoSync::GetInterface(voice_engine_); #endif - encrypt = VoEEncryption::GetInterface(ve); - hardware = VoEHardware::GetInterface(ve); + voe_encrypt_ = VoEEncryption::GetInterface(voice_engine_); + voe_hardware_ = VoEHardware::GetInterface(voice_engine_); // Set the audio layer to use in all tests - if (hardware) { - int res = hardware->SetAudioDeviceLayer(TESTED_AUDIO_LAYER); + if (voe_hardware_) { + int res = voe_hardware_->SetAudioDeviceLayer(TESTED_AUDIO_LAYER); if (res < 0) { printf("\nERROR: failed to set audio layer to use in " "testing\n"); } else { - printf("\nAudio layer %d will be used in testing\n", TESTED_AUDIO_LAYER); + printf("\nAudio layer %d will be used in testing\n", + TESTED_AUDIO_LAYER); } } #ifdef _TEST_XMEDIA_ - xmedia = VoEExternalMedia::GetInterface(ve); + voe_xmedia_ = VoEExternalMedia::GetInterface(voice_engine_); #endif #ifdef _TEST_CALL_REPORT_ - report = VoECallReport::GetInterface(ve); + voe_call_report_ = VoECallReport::GetInterface(voice_engine_); #endif #ifdef _TEST_NETEQ_STATS_ - neteqst = VoENetEqStats::GetInterface(ve); + voe_neteq_stats_ = VoENetEqStats::GetInterface(voice_engine_); #endif } } @@ -703,186 +705,186 @@ int VoETestManager::ReleaseInterfaces() { int err(0), remInt(1), j(0); bool releaseOK(true); - if (base) { + if (voe_base_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = base->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_base_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d base interfaces" "(should only be 1) \n", j); releaseOK = false; } // try to release one addition time (should fail) - TEST_MUSTPASS(-1 != base->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_base_->Release()); + err = voe_base_->LastError(); // it is considered safe to delete even if Release has been called // too many times TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (codec) { + if (voe_codec_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = codec->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_codec_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d codec interfaces" " (should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != codec->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_codec_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (volume) { + if (voe_volume_control_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = volume->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_volume_control_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d volume interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != volume->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_volume_control_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (dtmf) { + if (voe_dtmf_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = dtmf->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_dtmf_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d dtmf interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != dtmf->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_dtmf_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (rtp_rtcp) { + if (voe_rtp_rtcp_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = rtp_rtcp->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_rtp_rtcp_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d rtp/rtcp interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != rtp_rtcp->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_rtp_rtcp_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (apm) { + if (voe_apm_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = apm->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_apm_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d apm interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != apm->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_apm_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (netw) { + if (voe_network_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = netw->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_network_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d network interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != netw->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_network_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (file) { + if (voe_file_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = file->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_file_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d file interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != file->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_file_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } #ifdef _TEST_VIDEO_SYNC_ - if (vsync) { + if (voe_vsync_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = vsync->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_vsync_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d video sync interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != vsync->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_vsync_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } #endif - if (encrypt) { + if (voe_encrypt_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = encrypt->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_encrypt_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d encryption interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != encrypt->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_encrypt_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } - if (hardware) { + if (voe_hardware_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = hardware->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_hardware_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d hardware interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != hardware->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_hardware_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } #ifdef _TEST_XMEDIA_ - if (xmedia) { + if (voe_xmedia_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = xmedia->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_xmedia_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d external media interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != xmedia->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_xmedia_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } #endif #ifdef _TEST_CALL_REPORT_ - if (report) { + if (voe_call_report_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = report->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_call_report_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d call report interfaces" "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != report->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_call_report_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } #endif #ifdef _TEST_NETEQ_STATS_ - if (neteqst) { + if (voe_neteq_stats_) { for (remInt = 1, j = 0; remInt > 0; j++) - TEST_MUSTPASS(-1 == (remInt = neteqst->Release())); + TEST_MUSTPASS(-1 == (remInt = voe_neteq_stats_->Release())); if (j > 1) { TEST_LOG("\n\n*** Error: released %d neteq stat interfaces " "(should only be 1) \n", j); releaseOK = false; } - TEST_MUSTPASS(-1 != neteqst->Release()); - err = base->LastError(); + TEST_MUSTPASS(-1 != voe_neteq_stats_->Release()); + err = voe_base_->LastError(); TEST_MUSTPASS(err != VE_INTERFACE_NOT_FOUND); } #endif - if (false == VoiceEngine::Delete(ve)) { + if (false == VoiceEngine::Delete(voice_engine_)) { TEST_LOG("\n\nVoiceEngine::Delete() failed. \n"); releaseOK = false; } @@ -895,34 +897,25 @@ int VoETestManager::ReleaseInterfaces() { return (releaseOK == true) ? 0 : -1; } -int VoETestManager::DoStandardTest() { -#if (defined(_TEST_CODEC_) || defined(_TEST_FILE_)) - CodecInst cinst; - memset(&cinst, 0, sizeof(cinst)); -#endif - char tmpStr[1024]; - - TEST_LOG("\n\n+++ Base tests +++\n\n"); - - // Test trace callbacks +int VoETestManager::TestTraceApi() { + // Test trace callbacks. TEST_LOG("Enabling the trace callback => default trace messages " - "shall be printed... \n\n"); + "shall be printed... \n\n"); MyTraceCallback* callback = new MyTraceCallback(); VoiceEngine::SetTraceCallback(callback); - // Test the remaining trace APIs + // Test the remaining trace APIs. TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("webrtc_voe_trace.txt"), - true)); + true)); TEST_MUSTPASS(VoiceEngine::SetTraceFile(NULL)); TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename( - "webrtc_voe_trace.txt"))); + "webrtc_voe_trace.txt"))); VoiceEngine* extra = VoiceEngine::Create(); - instanceCount++; TEST_LOG("\nVerify that the VoE ID is now changed from 1 to 2\n\n"); TEST_MUSTPASS(VoiceEngine::SetTraceFile(NULL)); TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename( - "webrtc_voe_trace.txt"))); + "webrtc_voe_trace.txt"))); TEST_MUSTPASS(VoiceEngine::SetTraceFile(NULL)); VoiceEngine::Delete(extra); SLEEP(10); @@ -930,123 +923,132 @@ int VoETestManager::DoStandardTest() { TEST_LOG("NOTE: Currently it will still be 2, this is OK\n\n"); // The API below shall be the first line in the stored trace file - // (verify after test)! + // (verify after test). TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename( - "webrtc_voe_trace.txt"))); + "webrtc_voe_trace.txt"))); VoiceEngine::SetTraceCallback(NULL); delete callback; TEST_LOG("\n...the trace callback is now disabled.\n\n"); - ///////////////////////////////////////////////// - // Hardware (test before VoE is intialized) + return 0; +} + +int VoETestManager::TestHardwareBeforeInitializing() { #ifdef _TEST_HARDWARE_ - // Set/GetAudioDeviceLayer TEST_LOG("Set/Get audio device layer\n"); AudioLayers wantedLayer = TESTED_AUDIO_LAYER; AudioLayers givenLayer; - TEST_MUSTPASS(hardware->SetAudioDeviceLayer(wantedLayer)); - TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); - TEST_MUSTPASS(wantedLayer != givenLayer); // Should be same before init + TEST_MUSTPASS(voe_hardware_->SetAudioDeviceLayer(wantedLayer)); + TEST_MUSTPASS(voe_hardware_->GetAudioDeviceLayer(givenLayer)); + TEST_MUSTPASS(wantedLayer != givenLayer); // Should be same before init #endif //_TEST_HARDWARE_ TEST_LOG("Init \n"); #if defined BLACKFIN - TEST_MUSTPASS(base->Init(0,LINUX_AUDIO_OSS)); + TEST_MUSTPASS(voe_base_->Init(0,LINUX_AUDIO_OSS)); #else - TEST_MUSTPASS( base->Init()); + TEST_MUSTPASS(voe_base_->Init()); #endif #if defined(WEBRTC_ANDROID) TEST_LOG("Setting loudspeaker status to false \n"); - TEST_MUSTPASS(hardware->SetLoudspeakerStatus(false)); + TEST_MUSTPASS(voe_hardware_->SetLoudspeakerStatus(false)); #endif #ifndef __INSURE__ TEST_LOG("Enabling the observer \n"); - TEST_MUSTPASS(base->RegisterVoiceEngineObserver(obs)); + TEST_MUSTPASS(voe_base_->RegisterVoiceEngineObserver(obs)); #endif + return 0; +} + +int VoETestManager::SetUp() { + char char_buffer[1024]; TEST_LOG("Get version \n"); - TEST_MUSTPASS(base->GetVersion(tmpStr)); - TEST_LOG("--------------------\n%s\n--------------------\n", tmpStr); + TEST_MUSTPASS(voe_base_->GetVersion(char_buffer)); + TEST_LOG("--------------------\n%s\n--------------------\n", char_buffer); TEST_LOG("Create channel \n"); - int nChannels = base->MaxNumOfChannels(); + int nChannels = voe_base_->MaxNumOfChannels(); TEST_MUSTPASS(!(nChannels > 0)); TEST_LOG("Max number of channels = %d \n", nChannels); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->CreateChannel()); + return 0; +} - ///////////////////////////////////////////////// - // RTP/RTCP (test before streaming is activated) +int VoETestManager::TestRtpRtcpBeforeStreaming() { #ifdef _TEST_RTP_RTCP_ TEST_LOG("\n\n+++ RTP/RTCP tests +++\n\n"); TEST_LOG("Set/Get RTCP and CName \n"); bool on; - TEST_MUSTPASS(rtp_rtcp->GetRTCPStatus(0, on)); // should be on by default + // Should be on by default. + TEST_MUSTPASS(voe_rtp_rtcp_->GetRTCPStatus(0, on)); TEST_MUSTPASS(on != true); - TEST_MUSTPASS(rtp_rtcp->SetRTCPStatus(0, false)); - TEST_MUSTPASS(rtp_rtcp->GetRTCPStatus(0, on)); + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTCPStatus(0, false)); + TEST_MUSTPASS(voe_rtp_rtcp_->GetRTCPStatus(0, on)); TEST_MUSTPASS(on != false); - TEST_MUSTPASS(rtp_rtcp->SetRTCPStatus(0, true)); - TEST_MUSTPASS(rtp_rtcp->GetRTCPStatus(0, on)); + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTCPStatus(0, true)); + TEST_MUSTPASS(voe_rtp_rtcp_->GetRTCPStatus(0, on)); TEST_MUSTPASS(on != true); - TEST_MUSTPASS(rtp_rtcp->SetRTCP_CNAME(0, "Niklas")); + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTCP_CNAME(0, "Niklas")); TEST_LOG("Set/Get RTP Keepalive\n"); unsigned char pt; - int dT; - TEST_MUSTPASS(!rtp_rtcp->GetRTPKeepaliveStatus(-1, on, pt, dT)); - // should be off by default - TEST_MUSTPASS(rtp_rtcp->GetRTPKeepaliveStatus(0, on, pt, dT)); + int dt; + TEST_MUSTPASS(!voe_rtp_rtcp_->GetRTPKeepaliveStatus(-1, on, pt, dt)); + // Should be off by default. + TEST_MUSTPASS(voe_rtp_rtcp_->GetRTPKeepaliveStatus(0, on, pt, dt)); TEST_MUSTPASS(on != false); TEST_MUSTPASS(pt != 255); - TEST_MUSTPASS(dT != 0); + TEST_MUSTPASS(dt != 0); - // verify invalid input parameters - TEST_MUSTPASS(!rtp_rtcp->SetRTPKeepaliveStatus(-1, true, 0, 15)); - TEST_MUSTPASS(!rtp_rtcp->SetRTPKeepaliveStatus(0, true, -1, 15)); - TEST_MUSTPASS(!rtp_rtcp->SetRTPKeepaliveStatus(0, true, 0, 61)); - // should still be off - TEST_MUSTPASS(rtp_rtcp->GetRTPKeepaliveStatus(0, on, pt, dT)); - TEST_MUSTPASS(!rtp_rtcp->SetRTPKeepaliveStatus(0, true, 0)); - // should fail since default 0 is used bu PCMU + // Verify invalid input parameters. + TEST_MUSTPASS(!voe_rtp_rtcp_->SetRTPKeepaliveStatus(-1, true, 0, 15)); + TEST_MUSTPASS(!voe_rtp_rtcp_->SetRTPKeepaliveStatus(0, true, -1, 15)); + TEST_MUSTPASS(!voe_rtp_rtcp_->SetRTPKeepaliveStatus(0, true, 0, 61)); + // Should still be off. + TEST_MUSTPASS(voe_rtp_rtcp_->GetRTPKeepaliveStatus(0, on, pt, dt)); + TEST_MUSTPASS(!voe_rtp_rtcp_->SetRTPKeepaliveStatus(0, true, 0)); + // Should fail since default 0 is used bu PCMU. TEST_MUSTPASS(on != false); - // try valid settings - TEST_MUSTPASS(rtp_rtcp->SetRTPKeepaliveStatus(0, true, 1)); - TEST_MUSTPASS(rtp_rtcp->SetRTPKeepaliveStatus(0, true, 1)); - // should be on now - TEST_MUSTPASS(rtp_rtcp->GetRTPKeepaliveStatus(0, on, pt, dT)); - TEST_MUSTPASS(on != true);TEST_MUSTPASS(pt != 1);TEST_MUSTPASS(dT != 15); + // Try valid settings. + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTPKeepaliveStatus(0, true, 1)); + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTPKeepaliveStatus(0, true, 1)); + // Should be on now. + TEST_MUSTPASS(voe_rtp_rtcp_->GetRTPKeepaliveStatus(0, on, pt, dt)); + TEST_MUSTPASS(on != true);TEST_MUSTPASS(pt != 1);TEST_MUSTPASS(dt != 15); // Set the Keep alive payload to 60, and this payloadtype could not used - // by the codecs - TEST_MUSTPASS(rtp_rtcp->SetRTPKeepaliveStatus(0, true, 60, 3)); - TEST_MUSTPASS(rtp_rtcp->GetRTPKeepaliveStatus(0, on, pt, dT)); - TEST_MUSTPASS(on != true);TEST_MUSTPASS(pt != 60);TEST_MUSTPASS(dT != 3); - TEST_MUSTPASS(rtp_rtcp->SetRTPKeepaliveStatus(0, false, 60)); + // by the codecs. + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTPKeepaliveStatus(0, true, 60, 3)); + TEST_MUSTPASS(voe_rtp_rtcp_->GetRTPKeepaliveStatus(0, on, pt, dt)); + TEST_MUSTPASS(on != true);TEST_MUSTPASS(pt != 60);TEST_MUSTPASS(dt != 3); + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTPKeepaliveStatus(0, false, 60)); TEST_LOG("Set and get SSRC \n"); - TEST_MUSTPASS(rtp_rtcp->SetLocalSSRC(0, 1234)); - unsigned int sendSSRC = 0; - TEST_MUSTPASS(rtp_rtcp->GetLocalSSRC(0, sendSSRC)); - TEST_MUSTPASS(1234 != sendSSRC); + TEST_MUSTPASS(voe_rtp_rtcp_->SetLocalSSRC(0, 1234)); + unsigned int send_ssrc = 0; + TEST_MUSTPASS(voe_rtp_rtcp_->GetLocalSSRC(0, send_ssrc)); + TEST_MUSTPASS(1234 != send_ssrc); #else TEST_LOG("\n\n+++ RTP/RTCP tests NOT ENABLED +++\n"); #endif + return 0; +} - ///////////////////////////////////////////////// - // Hardware (test before streaming is activated) - // the test will select the device using 44100, which fails the call +int VoETestManager::TestHardwareBeforeStreaming() { #ifdef _TEST_HARDWARE_ TEST_LOG("\n\n+++ Hardware tests +++\n\n"); - // Set/GetAudioDeviceLayer + AudioLayers wanted_layer = TESTED_AUDIO_LAYER; + AudioLayers given_layer; TEST_LOG("Set/Get audio device layer\n"); - TEST_MUSTPASS(-1 != hardware->SetAudioDeviceLayer(wantedLayer)); - TEST_MUSTPASS(VE_ALREADY_INITED != base->LastError()); - TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); - switch (givenLayer) { + TEST_MUSTPASS(-1 != voe_hardware_->SetAudioDeviceLayer(wanted_layer)); + TEST_MUSTPASS(VE_ALREADY_INITED != voe_base_->LastError()); + TEST_MUSTPASS(voe_hardware_->GetAudioDeviceLayer(given_layer)); + switch (given_layer) { case kAudioPlatformDefault: - // already set above + // Already set above. break; case kAudioWindowsCore: TEST_LOG("Running kAudioWindowsCore\n"); @@ -1065,155 +1067,167 @@ int VoETestManager::DoStandardTest() { return -1; } - int loadPercent; + int load_percent; #if defined(_WIN32) TEST_LOG("CPU load \n"); - TEST_MUSTPASS(hardware->GetCPULoad(loadPercent)); - TEST_LOG("GetCPULoad => %d%%\n", loadPercent); + TEST_MUSTPASS(voe_hardware_->GetCPULoad(load_percent)); + TEST_LOG("GetCPULoad => %d%%\n", load_percent); #else - TEST_MUSTPASS(!hardware->GetCPULoad(loadPercent)); + TEST_MUSTPASS(!voe_hardware_->GetCPULoad(load_percent)); #endif #if !defined(MAC_IPHONE) & !defined(WEBRTC_ANDROID) - TEST_MUSTPASS(hardware->GetSystemCPULoad(loadPercent)); - TEST_LOG("GetSystemCPULoad => %d%%\n", loadPercent); + TEST_MUSTPASS(voe_hardware_->GetSystemCPULoad(load_percent)); + TEST_LOG("GetSystemCPULoad => %d%%\n", load_percent); #endif #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) - bool playAvail = false, recAvail = false; + bool play_available = false; + bool recording_available = false; TEST_LOG("Get device status \n"); - TEST_MUSTPASS(hardware->GetPlayoutDeviceStatus(playAvail)); - TEST_MUSTPASS(hardware->GetRecordingDeviceStatus(recAvail)); - TEST_MUSTPASS(!(recAvail && playAvail)); + TEST_MUSTPASS(voe_hardware_->GetPlayoutDeviceStatus(play_available)); + TEST_MUSTPASS(voe_hardware_->GetRecordingDeviceStatus(recording_available)); + TEST_MUSTPASS(!(recording_available && play_available)); #endif - - // Win, Mac and Linux sound device tests + // Win, Mac and Linux sound device tests. #if (defined(WEBRTC_MAC) && !defined(MAC_IPHONE)) || defined(_WIN32) || \ (defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)) - int idx, nRec = 0, nPlay = 0; - char devName[128] = {0}; - char guidName[128] = {0}; + + char device_name[128] = {0}; + char guid_name[128] = {0}; TEST_LOG("Printing names of default sound devices \n"); #if defined(_WIN32) - TEST_MUSTPASS(hardware->GetRecordingDeviceName(-1, devName, guidName)); - TEST_LOG("Recording device= %s, guid=%s\n",devName,guidName); - TEST_MUSTPASS(hardware->GetPlayoutDeviceName(-1, devName, guidName)); - TEST_LOG("Playout device= %s, guid=%s\n",devName,guidName); + TEST_MUSTPASS(voe_hardware_->GetRecordingDeviceName(-1, device_name, + guid_name)); + TEST_LOG("Recording device= %s, guid=%s\n", device_name, guid_name); + TEST_MUSTPASS(voe_hardware_->GetPlayoutDeviceName(-1, device_name, + guid_name)); + TEST_LOG("Playout device= %s, guid=%s\n", device_name, guid_name); #else - TEST_MUSTPASS(hardware->GetRecordingDeviceName(0, devName, guidName)); - TEST_LOG("Recording device= %s\n",devName); - TEST_MUSTPASS(hardware->GetPlayoutDeviceName(0, devName, guidName)); - TEST_LOG("Playout device= %s\n",devName); + TEST_MUSTPASS(voe_hardware_->GetRecordingDeviceName(0, device_name, + guid_name)); + TEST_LOG("Recording device= %s\n",device_name); + TEST_MUSTPASS(voe_hardware_->GetPlayoutDeviceName(0, device_name, + guid_name)); + TEST_LOG("Playout device= %s\n",device_name); #endif - // Recording side - TEST_MUSTPASS(hardware->GetNumOfRecordingDevices(nRec)); - TEST_LOG("GetNumOfRecordingDevices = %d\n", nRec); - for (idx = 0; idx < nRec; idx++) - { - // extended Win32 enumeration tests => unique GUID outputs on Vista - // and up - // Win XP and below : devName is copied to guidName - // Win Vista and up : devName is the friendly name and GUID is a uniqe - // indentifier - // Other : guidName is left unchanged - TEST_MUSTPASS(hardware->GetRecordingDeviceName(idx, devName, guidName)); + // Check recording side. + // Extended Win32 enumeration tests: unique GUID outputs on Vista and up: + // Win XP and below : device_name is copied to guid_name. + // Win Vista and up : device_name is the friendly name and GUID is a unique + // identifier. + // Other : guid_name is left unchanged. + int num_of_recording_devices = 0; + TEST_MUSTPASS(voe_hardware_->GetNumOfRecordingDevices( + num_of_recording_devices)); + TEST_LOG("GetNumOfRecordingDevices = %d\n", num_of_recording_devices); + for (int i = 0; i < num_of_recording_devices; i++) { + TEST_MUSTPASS(voe_hardware_->GetRecordingDeviceName(i, device_name, + guid_name)); #if defined(_WIN32) TEST_LOG("GetRecordingDeviceName(%d) => name=%s, guid=%s\n", - idx, devName, guidName); + i, device_name, guid_name); #else - TEST_LOG("GetRecordingDeviceName(%d) => name=%s\n", idx, devName); + TEST_LOG("GetRecordingDeviceName(%d) => name=%s\n", i, device_name); #endif - TEST_MUSTPASS(hardware->SetRecordingDevice(idx)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(i)); } - // Playout side - TEST_MUSTPASS(hardware->GetNumOfPlayoutDevices(nPlay)); - TEST_LOG("GetNumDevsPlayout = %d\n", nPlay); - for (idx = 0; idx < nPlay; idx++) - { - // extended Win32 enumeration tests => unique GUID outputs on Vista - // and up - // Win XP and below : devName is copied to guidName - // Win Vista and up : devName is the friendly name and GUID is a - // uniqe indentifier - // Other : guidName is left unchanged - TEST_MUSTPASS(hardware->GetPlayoutDeviceName(idx, devName, guidName)); + // Check playout side (the check is similar to the recording side). + int num_plays = 0; + TEST_MUSTPASS(voe_hardware_->GetNumOfPlayoutDevices(num_plays)); + TEST_LOG("GetNumDevsPlayout = %d\n", num_plays); + for (int i = 0; i < num_plays; i++) { + TEST_MUSTPASS(voe_hardware_->GetPlayoutDeviceName(i, device_name, + guid_name)); #if defined(_WIN32) TEST_LOG("GetPlayoutDeviceName(%d) => name=%s, guid=%s\n", - idx, devName, guidName); + i, device_name, guid_name); #else - TEST_LOG("GetPlayoutDeviceName(%d) => name=%s\n", idx, devName); + TEST_LOG("GetPlayoutDeviceName(%d) => name=%s\n", i, device_name); #endif - TEST_MUSTPASS(hardware->SetPlayoutDevice(idx)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(i)); } #endif // #if (defined(WEBRTC_MAC) && !defined(MAC_IPHONE)) || (defined(_WI...& TEST_LOG("Setting default sound devices \n"); #ifdef _WIN32 - TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); - TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(-1)); #else #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) - TEST_MUSTPASS(hardware->SetRecordingDevice(0)); - TEST_MUSTPASS(hardware->SetPlayoutDevice(0)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(0)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(0)); #endif #endif #ifdef MAC_IPHONE // Reset sound device TEST_LOG("Reset sound device \n"); - TEST_MUSTPASS(hardware->ResetAudioDevice()); + TEST_MUSTPASS(voe_hardware_->ResetAudioDevice()); #endif #else TEST_LOG("\n\n+++ Hardware tests NOT ENABLED +++\n"); #endif // #ifdef _TEST_HARDWARE_ - // This testing must be done before we start playing + return 0; +} + +int VoETestManager::TestCodecsBeforeStreaming() { + CodecInst codec_instance; + memset(&codec_instance, 0, sizeof(codec_instance)); + + // This testing must be done before we start playing. #ifdef _TEST_CODEC_ - // Test that set and get payload type work + // Test that set and get payload type work. #if defined(WEBRTC_CODEC_ISAC) TEST_LOG("Getting payload type for iSAC\n"); - strcpy(cinst.plname, "niklas"); - cinst.channels = 1; - cinst.plfreq = 16000; - cinst.pacsize = 480; - // should fail since niklas is not a valid codec name - TEST_MUSTPASS(!codec->GetRecPayloadType(0,cinst)); - strcpy(cinst.plname, "iSAC"); - TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); // both iSAC - strcpy(cinst.plname, "ISAC"); // and ISAC should work - TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); - int orgPT = cinst.pltype; // default payload type is 103 + strcpy(codec_instance.plname, "niklas"); + codec_instance.channels = 1; + codec_instance.plfreq = 16000; + codec_instance.pacsize = 480; + // Should fail since niklas is not a valid codec name. + TEST_MUSTPASS(!voe_codec_->GetRecPayloadType(0, codec_instance)); + // Both iSAC and ISAC should work here. + strcpy(codec_instance.plname, "iSAC"); + TEST_MUSTPASS(voe_codec_->GetRecPayloadType(0, codec_instance)); + strcpy(codec_instance.plname, "ISAC"); + TEST_MUSTPASS(voe_codec_->GetRecPayloadType(0,codec_instance)); + int original_pltype = codec_instance.pltype; // Default payload type is 103. TEST_LOG("Setting payload type for iSAC to 127\n"); - cinst.pltype = 123; - TEST_MUSTPASS(codec->SetRecPayloadType(0,cinst)); - TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); - TEST_MUSTPASS(!(cinst.pltype==123)); + codec_instance.pltype = 123; + TEST_MUSTPASS(voe_codec_->SetRecPayloadType(0,codec_instance)); + TEST_MUSTPASS(voe_codec_->GetRecPayloadType(0,codec_instance)); + TEST_MUSTPASS(!(codec_instance.pltype==123)); TEST_LOG("Setting it back\n"); - cinst.pltype = orgPT; - TEST_MUSTPASS(codec->SetRecPayloadType(0,cinst)); - TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); - TEST_MUSTPASS(!(cinst.pltype==orgPT)); - cinst.pltype = 123; - cinst.plfreq = 8000; - cinst.pacsize = 240; - cinst.rate = 13300; + codec_instance.pltype = original_pltype; + TEST_MUSTPASS(voe_codec_->SetRecPayloadType(0,codec_instance)); + TEST_MUSTPASS(voe_codec_->GetRecPayloadType(0,codec_instance)); + TEST_MUSTPASS(!(codec_instance.pltype==original_pltype)); + codec_instance.pltype = 123; + codec_instance.plfreq = 8000; + codec_instance.pacsize = 240; + codec_instance.rate = 13300; #ifdef WEBRTC_CODEC_ILBC - strcpy(cinst.plname, "iLBC"); - TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); - orgPT = cinst.pltype; - cinst.pltype = 123; - TEST_MUSTPASS(codec->SetRecPayloadType(0,cinst)); - TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); + strcpy(codec_instance.plname, "iLBC"); + TEST_MUSTPASS(voe_codec_->GetRecPayloadType(0,codec_instance)); + original_pltype = codec_instance.pltype; + codec_instance.pltype = 123; + TEST_MUSTPASS(voe_codec_->SetRecPayloadType(0,codec_instance)); + TEST_MUSTPASS(voe_codec_->GetRecPayloadType(0,codec_instance)); TEST_LOG("Setting it back\n"); - cinst.pltype = orgPT; - TEST_MUSTPASS(codec->SetRecPayloadType(0,cinst)); - TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); - TEST_MUSTPASS(!(cinst.pltype==orgPT)); + codec_instance.pltype = original_pltype; + TEST_MUSTPASS(voe_codec_->SetRecPayloadType(0,codec_instance)); + TEST_MUSTPASS(voe_codec_->GetRecPayloadType(0,codec_instance)); + TEST_MUSTPASS(!(codec_instance.pltype==original_pltype)); #endif // #ifdef WEBRTC_CODEC_ILBC #endif // #if defined(WEBRTC_CODEC_ISAC) #endif // #ifdef _TEST_CODEC_ + return 0; +} + +int VoETestManager::TestNetworkBeforeStreaming() { /////////////////////////////////////////////// // Network (test before streaming is activated) @@ -1221,53 +1235,49 @@ int VoETestManager::DoStandardTest() { TEST_LOG("\n\n+++ Network tests +++\n\n"); #ifndef WEBRTC_EXTERNAL_TRANSPORT - int srcRtpPort = 0; - int srcRtcpPort = 0; - - int filtPort = -1; - int filtPortRTCP = -1; - char srcIp[32] = "0.0.0.0"; - char filtIp[32] = "0.0.0.0"; + int filter_port = -1; + int filter_port_rtcp = -1; + char src_ip[32] = "0.0.0.0"; + char filter_ip[32] = "0.0.0.0"; TEST_LOG("GetSourceInfo \n"); - srcRtpPort = 1234; - srcRtcpPort = 1235; - TEST_MUSTPASS(netw->GetSourceInfo(0, srcRtpPort, srcRtcpPort, srcIp)); - TEST_MUSTPASS(0 != srcRtpPort); - TEST_MUSTPASS(0 != srcRtcpPort); - TEST_MUSTPASS(_stricmp(srcIp, "")); + int src_rtp_port = 1234; + int src_rtcp_port = 1235; + TEST_MUSTPASS(voe_network_->GetSourceInfo(0, src_rtp_port, src_rtcp_port, + src_ip)); + TEST_MUSTPASS(0 != src_rtp_port); + TEST_MUSTPASS(0 != src_rtcp_port); + TEST_MUSTPASS(_stricmp(src_ip, "")); TEST_LOG("GetSourceFilter \n"); - TEST_MUSTPASS(netw->GetSourceFilter(0, filtPort, filtPortRTCP, filtIp)); - TEST_MUSTPASS(0 != filtPort); - TEST_MUSTPASS(0 != filtPortRTCP); - TEST_MUSTPASS(_stricmp(filtIp, "")); + TEST_MUSTPASS(voe_network_->GetSourceFilter(0, filter_port, filter_port_rtcp, + filter_ip)); + TEST_MUSTPASS(0 != filter_port); + TEST_MUSTPASS(0 != filter_port_rtcp); + TEST_MUSTPASS(_stricmp(filter_ip, "")); TEST_LOG("SetSourceFilter \n"); - TEST_MUSTPASS(netw->SetSourceFilter(0, srcRtpPort)); + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, src_rtp_port)); #else TEST_LOG("Skipping network tests - WEBRTC_EXTERNAL_TRANSPORT is defined \n"); #endif // #ifndef WEBRTC_EXTERNAL_TRANSPORT #else TEST_LOG("\n\n+++ Network tests NOT ENABLED +++\n"); #endif + return 0; +} - /////////////////// - // Start streaming +int VoETestManager::TestStartStreaming(FakeExternalTransport& channel0_transport) { TEST_LOG("\n\n+++ Starting streaming +++\n\n"); - my_transportation ch0transport(netw); - - // goto Exit; - #ifdef WEBRTC_EXTERNAL_TRANSPORT TEST_LOG("Enabling external transport \n"); - TEST_MUSTPASS(netw->RegisterExternalTransport(0, ch0transport)); + TEST_MUSTPASS(voe_network_->RegisterExternalTransport(0, channel0_transport)); #else TEST_LOG("Setting send and receive parameters \n"); - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - // no IP specified => "0.0.0.0" will be stored - TEST_MUSTPASS(base->SetLocalReceiver(0,8000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + // No IP specified => "0.0.0.0" will be stored. + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0,8000)); CodecInst Jing_inst; Jing_inst.channels = 1; @@ -1276,201 +1286,216 @@ int VoETestManager::DoStandardTest() { Jing_inst.pltype = 0; Jing_inst.rate = 64000; strcpy(Jing_inst.plname, "PCMU"); - TEST_MUSTPASS(codec->SetSendCodec(0, Jing_inst)); + TEST_MUSTPASS(voe_codec_->SetSendCodec(0, Jing_inst)); - int port = -1, srcPort = -1, rtcpPort = -1; - char ipaddr[64] = { 0 }; - strcpy(ipaddr, "10.10.10.10"); - TEST_MUSTPASS(base->GetSendDestination(0, port, ipaddr, srcPort, rtcpPort)); + int port = -1; + int src_port = -1; + int rtcp_port = -1; + char ip_address[64] = { 0 }; + strcpy(ip_address, "10.10.10.10"); + TEST_MUSTPASS(voe_base_->GetSendDestination(0, port, ip_address, src_port, + rtcp_port)); TEST_MUSTPASS(8000 != port); - TEST_MUSTPASS(8000 != srcPort); - TEST_MUSTPASS(8001 != rtcpPort); - TEST_MUSTPASS(_stricmp(ipaddr, "127.0.0.1")); + TEST_MUSTPASS(8000 != src_port); + TEST_MUSTPASS(8001 != rtcp_port); + TEST_MUSTPASS(_stricmp(ip_address, "127.0.0.1")); port = -1; - rtcpPort = -1; - TEST_MUSTPASS(base->GetLocalReceiver(0, port, rtcpPort, ipaddr)); + rtcp_port = -1; + TEST_MUSTPASS(voe_base_->GetLocalReceiver(0, port, rtcp_port, ip_address)); TEST_MUSTPASS(8000 != port); - TEST_MUSTPASS(8001 != rtcpPort); - TEST_MUSTPASS(_stricmp(ipaddr, "0.0.0.0")); + TEST_MUSTPASS(8001 != rtcp_port); + TEST_MUSTPASS(_stricmp(ip_address, "0.0.0.0")); #endif + return 0; +} +int VoETestManager::TestStartPlaying() { TEST_LOG("Start listening, playout and sending \n"); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); - // <=== full duplex ===> + // Run in full duplex. TEST_LOG("You should now hear yourself, running default codec (PCMU)\n"); SLEEP(2000); - if (file) { + if (voe_file_) { TEST_LOG("Start playing a file as microphone, so you don't need to" " speak all the time\n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); SLEEP(1000); } + return 0; +} +int VoETestManager::TestHoldAndNetEq() { #ifdef _TEST_BASE_ TEST_LOG("Put channel on hold => should *not* hear audio \n"); - // HOLD_SEND_AND_PLAY is the default mode - TEST_MUSTPASS(base->SetOnHoldStatus(0, true)); + // HOLD_SEND_AND_PLAY is the default mode. + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, true)); SLEEP(2000); TEST_LOG("Remove on hold => should hear audio again \n"); - TEST_MUSTPASS(base->SetOnHoldStatus(0, false)); + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, false)); SLEEP(2000); TEST_LOG("Put sending on hold => should *not* hear audio \n"); - TEST_MUSTPASS(base->SetOnHoldStatus(0, true, kHoldSendOnly)); + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, true, kHoldSendOnly)); SLEEP(2000); - if (file) { + if (voe_file_) { TEST_LOG("Start playing a file locally => " "you should now hear this file being played out \n"); - TEST_MUSTPASS(file->StartPlayingFileLocally(0, AudioFilename(), + TEST_MUSTPASS(voe_file_->StartPlayingFileLocally(0, AudioFilename(), true)); SLEEP(2000); } TEST_LOG("Put playing on hold => should *not* hear audio \n"); - TEST_MUSTPASS(base->SetOnHoldStatus(0, true, kHoldPlayOnly)); + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, true, kHoldPlayOnly)); SLEEP(2000); TEST_LOG("Remove on hold => should hear audio again \n"); - if (file) { - TEST_MUSTPASS(file->StopPlayingFileLocally(0)); + if (voe_file_) { + TEST_MUSTPASS(voe_file_->StopPlayingFileLocally(0)); } - TEST_MUSTPASS(base->SetOnHoldStatus(0, false)); + TEST_MUSTPASS(voe_base_->SetOnHoldStatus(0, false)); SLEEP(2000); NetEqModes mode; - TEST_MUSTPASS(base->GetNetEQPlayoutMode(0, mode)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(0, mode)); TEST_MUSTPASS(mode != kNetEqDefault); TEST_LOG("NetEQ DEFAULT playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqDefault)); SLEEP(3000); TEST_LOG("NetEQ STREAMING playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqStreaming)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqStreaming)); SLEEP(3000); TEST_LOG("NetEQ FAX playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqFax)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqFax)); SLEEP(3000); TEST_LOG("NetEQ default mode is restored \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqDefault)); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(0, mode)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(0, mode)); TEST_MUSTPASS(mode != kNetEqDefault); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(0, mode)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(0, mode)); TEST_MUSTPASS(mode != kNetEqDefault); TEST_LOG("NetEQ DEFAULT playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqDefault)); SLEEP(3000); TEST_LOG("NetEQ STREAMING playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqStreaming)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqStreaming)); SLEEP(3000); TEST_LOG("NetEQ FAX playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqFax)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqFax)); SLEEP(3000); TEST_LOG("NetEQ default mode is restored \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqDefault)); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(0, mode)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(0, mode)); TEST_MUSTPASS(mode != kNetEqDefault); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(0, mode)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(0, mode)); TEST_MUSTPASS(mode != kNetEqDefault); TEST_LOG("NetEQ DEFAULT playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqDefault)); SLEEP(3000); TEST_LOG("NetEQ STREAMING playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqStreaming)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqStreaming)); SLEEP(3000); TEST_LOG("NetEQ FAX playout mode enabled => should hear OK audio \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqFax)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqFax)); SLEEP(3000); TEST_LOG("NetEQ default mode is restored \n"); - TEST_MUSTPASS(base->SetNetEQPlayoutMode(0, kNetEqDefault)); - TEST_MUSTPASS(base->GetNetEQPlayoutMode(0, mode)); + TEST_MUSTPASS(voe_base_->SetNetEQPlayoutMode(0, kNetEqDefault)); + TEST_MUSTPASS(voe_base_->GetNetEQPlayoutMode(0, mode)); TEST_MUSTPASS(mode != kNetEqDefault); TEST_LOG("Scan all possible NetEQ BGN modes\n"); // skip listening test - enum NetEqBgnModes bgnMode; - TEST_MUSTPASS(base->GetNetEQBGNMode(0, bgnMode)); - TEST_MUSTPASS(bgnMode != kBgnOn); - TEST_MUSTPASS(base->SetNetEQBGNMode(0, kBgnOn)); - TEST_MUSTPASS(base->GetNetEQBGNMode(0, bgnMode)); - TEST_MUSTPASS(bgnMode != kBgnOn); - TEST_MUSTPASS(base->SetNetEQBGNMode(0, kBgnFade)); - TEST_MUSTPASS(base->GetNetEQBGNMode(0, bgnMode)); - TEST_MUSTPASS(bgnMode != kBgnFade); - TEST_MUSTPASS(base->SetNetEQBGNMode(0, kBgnOff)); - TEST_MUSTPASS(base->GetNetEQBGNMode(0, bgnMode)); - TEST_MUSTPASS(bgnMode != kBgnOff); + enum NetEqBgnModes neteq_bgn_mode; + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(0, neteq_bgn_mode)); + TEST_MUSTPASS(neteq_bgn_mode != kBgnOn); + TEST_MUSTPASS(voe_base_->SetNetEQBGNMode(0, kBgnOn)); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(0, neteq_bgn_mode)); + TEST_MUSTPASS(neteq_bgn_mode != kBgnOn); + TEST_MUSTPASS(voe_base_->SetNetEQBGNMode(0, kBgnFade)); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(0, neteq_bgn_mode)); + TEST_MUSTPASS(neteq_bgn_mode != kBgnFade); + TEST_MUSTPASS(voe_base_->SetNetEQBGNMode(0, kBgnOff)); + TEST_MUSTPASS(voe_base_->GetNetEQBGNMode(0, neteq_bgn_mode)); + TEST_MUSTPASS(neteq_bgn_mode != kBgnOff); #else TEST_LOG("Skipping on hold and NetEQ playout tests -" "Base tests are not enabled \n"); #endif // #ifdef _TEST_BASE_ - ///////// - // Codec + return 0; +} + +int VoETestManager::TestCodecs() { #ifdef _TEST_CODEC_ + CodecInst codec_instance; + memset(&codec_instance, 0, sizeof(codec_instance)); + TEST_LOG("\n\n+++ Codec tests +++\n\n"); TEST_LOG("Checking default codec\n"); - TEST_MUSTPASS(codec->GetSendCodec(0, cinst)); - TEST_MUSTPASS(cinst.channels != 1); - TEST_MUSTPASS(cinst.pacsize != 160); - TEST_MUSTPASS(cinst.plfreq != 8000); - TEST_MUSTPASS(cinst.pltype != 0); - TEST_MUSTPASS(cinst.rate != 64000); - TEST_MUSTPASS(strcmp("PCMU", cinst.plname) != 0); + TEST_MUSTPASS(voe_codec_->GetSendCodec(0, codec_instance)); + TEST_MUSTPASS(codec_instance.channels != 1); + TEST_MUSTPASS(codec_instance.pacsize != 160); + TEST_MUSTPASS(codec_instance.plfreq != 8000); + TEST_MUSTPASS(codec_instance.pltype != 0); + TEST_MUSTPASS(codec_instance.rate != 64000); + TEST_MUSTPASS(strcmp("PCMU", codec_instance.plname) != 0); TEST_LOG("Looping through all codecs and packet sizes\n"); TEST_LOG("NOTE: For swb codecs, ensure that you speak in the mic\n"); - int nCodecs = codec->NumOfCodecs(); - for (int index = 0; index < nCodecs; index++) { - TEST_MUSTPASS(codec->GetCodec(index, cinst)); + int num_codecs = voe_codec_->NumOfCodecs(); + for (int i = 0; i < num_codecs; i++) { + TEST_MUSTPASS(voe_codec_->GetCodec(i, codec_instance)); - if (!((!_stricmp("CN", cinst.plname)) || - (!_stricmp("telephone-event", cinst.plname) || - (!_stricmp("red", cinst.plname))))) { + if (!((!_stricmp("CN", codec_instance.plname)) || + (!_stricmp("telephone-event", codec_instance.plname) || + (!_stricmp("red", codec_instance.plname))))) { // If no default payload type is defined, we use 127 and also set - // receive payload type - if (-1 == cinst.pltype) { - cinst.pltype = 127; - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + // receive payload type. + if (-1 == codec_instance.pltype) { + codec_instance.pltype = 127; + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_codec_->SetRecPayloadType(0, codec_instance)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); } - TEST_LOG("%s (pt=%d): default(%d) ", cinst.plname, cinst.pltype, - cinst.pacsize); - TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); + TEST_LOG("%s (pt=%d): default(%d) ", codec_instance.plname, + codec_instance.pltype, codec_instance.pacsize); + TEST_MUSTPASS(voe_codec_->SetSendCodec(0, codec_instance)); SLEEP(CODEC_TEST_TIME); - // Packet sizes - if (!_stricmp("g7221", cinst.plname)) // special case for G.722.1 + // special case for G.722.1: + if (!_stricmp("g7221", codec_instance.plname)) { - // Test 16 and 32 kHz + // Test 16 and 32 kHz. for (int freq = 16000; freq <= 32000; freq += 16000) { - cinst.plfreq = freq; - // Test 16/24/32 and 24/32/48 kbit respectively + codec_instance.plfreq = freq; + // Test 16/24/32 and 24/32/48 kbit respectively. int rate = (16000 == freq ? 16000 : 24000); int maxRate = (16000 == freq ? 32000 : 40000); - // In fact 48, see below + // In fact 48, see below. for (; rate <= maxRate; rate += 8000) { rate = (40000 == rate ? 48000 : rate); // 40 -> 48 - cinst.rate = rate; - // Test packet sizes - TEST_LOG("\n%s (pt=%d, fs=%d, rate=%d): ", cinst.plname, - cinst.pltype, cinst.plfreq, cinst.rate); - for (int pacsize = 80; pacsize < 1000; pacsize += 80) { - // Set codec, and receive payload type - cinst.pacsize = pacsize; - if (-1 != codec->SetSendCodec(0, cinst)) { - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(codec->SetRecPayloadType(0, - cinst)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_LOG("%d ", pacsize); + codec_instance.rate = rate; + // Test packet sizes. + TEST_LOG("\n%s (pt=%d, fs=%d, rate=%d): ", codec_instance.plname, + codec_instance.pltype, codec_instance.plfreq, + codec_instance.rate); + for (int packet_size = 80; packet_size < 1000; packet_size += 80) { + // Set codec, and receive payload type. + codec_instance.pacsize = packet_size; + if (-1 != voe_codec_->SetSendCodec(0, codec_instance)) { + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_codec_->SetRecPayloadType(0, + codec_instance)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_LOG("%d ", packet_size); fflush(NULL); SLEEP(2 * CODEC_TEST_TIME); } @@ -1479,18 +1504,17 @@ int VoETestManager::DoStandardTest() { } } else { for (int pacsize = 80; pacsize < 1000; pacsize += 80) { - // Set codec - // from VoE 4.0, we need the specify the right rate - if (!_stricmp("ilbc", cinst.plname)) { + // Set codec. From VoE 4.0, we need the specify the right rate. + if (!_stricmp("ilbc", codec_instance.plname)) { if ((pacsize == 160) || (pacsize == 320)) { - cinst.rate = 15200; + codec_instance.rate = 15200; } else { - cinst.rate = 13300; + codec_instance.rate = 13300; } } - cinst.pacsize = pacsize; - if (-1 != codec->SetSendCodec(0, cinst)) { + codec_instance.pacsize = pacsize; + if (-1 != voe_codec_->SetSendCodec(0, codec_instance)) { TEST_LOG("%d ", pacsize); fflush(NULL); SLEEP(CODEC_TEST_TIME); @@ -1501,197 +1525,218 @@ int VoETestManager::DoStandardTest() { } } - TEST_MUSTPASS(codec->GetCodec(0, cinst)); - TEST_LOG("Setting codec to first in list: %s \n", cinst.plname); - TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); + TEST_MUSTPASS(voe_codec_->GetCodec(0, codec_instance)); + TEST_LOG("Setting codec to first in list: %s \n", codec_instance.plname); + TEST_MUSTPASS(voe_codec_->SetSendCodec(0, codec_instance)); TEST_LOG("Voice Activity Detection calls\n"); TEST_LOG("Must be OFF by default\n"); - bool VADtest = true; + bool vad_test = true; VadModes vadMode = kVadAggressiveHigh; - bool disabledDTX = true; - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(VADtest); + bool disabled_dtx = true; + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(!disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(VADtest); + TEST_MUSTPASS(!disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(!disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(VADtest); + TEST_MUSTPASS(!disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(!disabledDTX); + TEST_MUSTPASS(!disabled_dtx); TEST_LOG("Turn ON VAD\n"); - TEST_MUSTPASS(codec->SetVADStatus(0, true)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true)); TEST_LOG("Should be ON now\n"); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(!VADtest); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(!vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(!VADtest); + TEST_MUSTPASS(disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(!vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(!VADtest); + TEST_MUSTPASS(disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(!vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(disabledDTX); + TEST_MUSTPASS(disabled_dtx); TEST_LOG("Testing Type settings\n"); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadAggressiveLow)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadAggressiveLow)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveLow != vadMode); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadAggressiveMid)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadAggressiveMid)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveMid != vadMode); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadAggressiveMid)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadAggressiveMid)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveMid != vadMode); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadAggressiveMid)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadAggressiveMid)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveMid != vadMode); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadAggressiveHigh, true)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadAggressiveHigh, true)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveHigh != vadMode); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadAggressiveHigh, true)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadAggressiveHigh, true)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveHigh != vadMode); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadAggressiveHigh, true)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadAggressiveHigh, true)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveHigh != vadMode); - TEST_MUSTPASS(!disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(!disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveHigh != vadMode); - TEST_MUSTPASS(!disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(!disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadAggressiveHigh != vadMode); - TEST_MUSTPASS(!disabledDTX); - TEST_MUSTPASS(codec->SetVADStatus(0, true, kVadConventional)); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(!disabled_dtx); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true, kVadConventional)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); + TEST_MUSTPASS(disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(disabledDTX); + TEST_MUSTPASS(disabled_dtx); - // VAD is always on when DTX is on, so we need to turn off DTX too + // VAD is always on when DTX is on, so we need to turn off DTX too. TEST_LOG("Turn OFF VAD\n"); - TEST_MUSTPASS(codec->SetVADStatus(0, false, kVadConventional, true)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, false, kVadConventional, true)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(VADtest); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(!disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(VADtest); + TEST_MUSTPASS(!disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(!disabledDTX); - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(VADtest); + TEST_MUSTPASS(!disabled_dtx); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(vad_test); TEST_MUSTPASS(kVadConventional != vadMode); - TEST_MUSTPASS(!disabledDTX); + TEST_MUSTPASS(!disabled_dtx); #if defined(WEBRTC_CODEC_ISAC) TEST_LOG("Test extended iSAC APIs\n"); TEST_LOG("Start by selecting iSAC 30ms adaptive mode\n"); - strcpy(cinst.plname, "isac"); - cinst.pltype = 103; - cinst.plfreq = 16000; - cinst.channels = 1; - cinst.rate = -1; // adaptive rate - cinst.pacsize = 480; + strcpy(codec_instance.plname, "isac"); + codec_instance.pltype = 103; + codec_instance.plfreq = 16000; + codec_instance.channels = 1; + codec_instance.rate = -1; // Adaptive rate. + codec_instance.pacsize = 480; TEST_LOG(" testing SetISACInitTargetRate:\n"); - TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); - TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 5000)); - TEST_MUSTPASS(!codec->SetISACInitTargetRate(0, 33000)); - TEST_MUSTPASS(codec->SetISACInitTargetRate(0, 32000)); + TEST_MUSTPASS(voe_codec_->SetSendCodec(0, codec_instance)); + TEST_MUSTPASS(!voe_codec_->SetISACInitTargetRate(0, 5000)); + TEST_MUSTPASS(!voe_codec_->SetISACInitTargetRate(0, 33000)); + TEST_MUSTPASS(voe_codec_->SetISACInitTargetRate(0, 32000)); TEST_LOG("Speak and ensure that iSAC sounds OK (target = 32kbps)...\n"); SLEEP(3000); - TEST_MUSTPASS(codec->SetISACInitTargetRate(0, 10000)); + TEST_MUSTPASS(voe_codec_->SetISACInitTargetRate(0, 10000)); TEST_LOG("Speak and ensure that iSAC sounds OK (target = 10kbps)...\n"); SLEEP(3000); - TEST_MUSTPASS(codec->SetISACInitTargetRate(0, 10000, true)); - TEST_MUSTPASS(codec->SetISACInitTargetRate(0, 10000, false)); - TEST_MUSTPASS(codec->SetISACInitTargetRate(0, 0)); + TEST_MUSTPASS(voe_codec_->SetISACInitTargetRate(0, 10000, true)); + TEST_MUSTPASS(voe_codec_->SetISACInitTargetRate(0, 10000, false)); + TEST_MUSTPASS(voe_codec_->SetISACInitTargetRate(0, 0)); TEST_LOG("Speak and ensure that iSAC sounds OK (target = default)...\n"); SLEEP(3000); TEST_LOG(" testing SetISACMaxPayloadSize:\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(0, 50)); - TEST_MUSTPASS(!codec->SetISACMaxPayloadSize(0, 650)); - TEST_MUSTPASS(codec->SetISACMaxPayloadSize(0, 120)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(!voe_codec_->SetISACMaxPayloadSize(0, 50)); + TEST_MUSTPASS(!voe_codec_->SetISACMaxPayloadSize(0, 650)); + TEST_MUSTPASS(voe_codec_->SetISACMaxPayloadSize(0, 120)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("Speak and ensure that iSAC sounds OK" "(max payload size = 100 bytes)...\n"); SLEEP(3000); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(codec->SetISACMaxPayloadSize(0, 400)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_codec_->SetISACMaxPayloadSize(0, 400)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG(" testing SetISACMaxRate:\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(!codec->SetISACMaxRate(0, 31900)); - TEST_MUSTPASS(!codec->SetISACMaxRate(0, 53500)); - TEST_MUSTPASS(codec->SetISACMaxRate(0, 32000)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(!voe_codec_->SetISACMaxRate(0, 31900)); + TEST_MUSTPASS(!voe_codec_->SetISACMaxRate(0, 53500)); + TEST_MUSTPASS(voe_codec_->SetISACMaxRate(0, 32000)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("Speak and ensure that iSAC sounds OK (max rate = 32 kbps)...\n"); SLEEP(3000); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(codec->SetISACMaxRate(0, 53400)); // restore no limitation - TEST_MUSTPASS(base->StartSend(0)); - if (file) { + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_codec_->SetISACMaxRate(0, 53400)); // restore no limitation + TEST_MUSTPASS(voe_base_->StartSend(0)); + if (voe_file_) { TEST_LOG("==> Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone( 0, AudioFilename(), true, true)); } #else TEST_LOG("Skipping extended iSAC API tests - " "WEBRTC_CODEC_ISAC not defined\n"); #endif // #if defined(WEBRTC_CODEC_ISAC) - // Tests on AMR setencformat and setdecformat - // These should fail - TEST_MUSTPASS(!codec->SetAMREncFormat(0, kRfc3267BwEfficient)); - TEST_MUSTPASS(!codec->SetAMRDecFormat(0, kRfc3267BwEfficient)); - TEST_MUSTPASS(!codec->SetAMREncFormat(0, kRfc3267OctetAligned)); - TEST_MUSTPASS(!codec->SetAMRDecFormat(0, kRfc3267OctetAligned)); - TEST_MUSTPASS(!codec->SetAMREncFormat(0, kRfc3267FileStorage)); - TEST_MUSTPASS(!codec->SetAMRDecFormat(0, kRfc3267FileStorage)); + // Tests on AMR setencformat and setdecformat: the calls should fail. + TEST_MUSTPASS(!voe_codec_->SetAMREncFormat(0, kRfc3267BwEfficient)); + TEST_MUSTPASS(!voe_codec_->SetAMRDecFormat(0, kRfc3267BwEfficient)); + TEST_MUSTPASS(!voe_codec_->SetAMREncFormat(0, kRfc3267OctetAligned)); + TEST_MUSTPASS(!voe_codec_->SetAMRDecFormat(0, kRfc3267OctetAligned)); + TEST_MUSTPASS(!voe_codec_->SetAMREncFormat(0, kRfc3267FileStorage)); + TEST_MUSTPASS(!voe_codec_->SetAMRDecFormat(0, kRfc3267FileStorage)); - // Tests on AMRWB setencformat and setdecformat - // These should fail - TEST_MUSTPASS(!codec->SetAMRWbEncFormat(0, kRfc3267BwEfficient)); - TEST_MUSTPASS(!codec->SetAMRWbDecFormat(0, kRfc3267BwEfficient)); - TEST_MUSTPASS(!codec->SetAMRWbEncFormat(0, kRfc3267OctetAligned)); - TEST_MUSTPASS(!codec->SetAMRWbDecFormat(0, kRfc3267OctetAligned)); - TEST_MUSTPASS(!codec->SetAMRWbEncFormat(0, kRfc3267FileStorage)); - TEST_MUSTPASS(!codec->SetAMRWbDecFormat(0, kRfc3267FileStorage)); + // Tests on AMRWB setencformat and setdecformat: the calls should fail. + TEST_MUSTPASS(!voe_codec_->SetAMRWbEncFormat(0, kRfc3267BwEfficient)); + TEST_MUSTPASS(!voe_codec_->SetAMRWbDecFormat(0, kRfc3267BwEfficient)); + TEST_MUSTPASS(!voe_codec_->SetAMRWbEncFormat(0, kRfc3267OctetAligned)); + TEST_MUSTPASS(!voe_codec_->SetAMRWbDecFormat(0, kRfc3267OctetAligned)); + TEST_MUSTPASS(!voe_codec_->SetAMRWbEncFormat(0, kRfc3267FileStorage)); + TEST_MUSTPASS(!voe_codec_->SetAMRWbDecFormat(0, kRfc3267FileStorage)); TEST_LOG("Turn on VAD,G711 and set packet size to 30 ms:\n"); - strcpy(cinst.plname, "pcmu"); - cinst.pacsize = 160; - cinst.pltype = 0; - cinst.plfreq = 8000; - cinst.channels = 1; - cinst.rate = 64000; - TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); + strcpy(codec_instance.plname, "pcmu"); + codec_instance.pacsize = 160; + codec_instance.pltype = 0; + codec_instance.plfreq = 8000; + codec_instance.channels = 1; + codec_instance.rate = 64000; + TEST_MUSTPASS(voe_codec_->SetSendCodec(0, codec_instance)); // The test here is confusing, what are we expecting? VADtest = false? - TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX)); - TEST_MUSTPASS(VADtest); - TEST_MUSTPASS(codec->SetVADStatus(0, false, vadMode, true)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, vad_test, vadMode, disabled_dtx)); + TEST_MUSTPASS(vad_test); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, false, vadMode, true)); - // Set back to preferred codec - TEST_MUSTPASS(codec->GetCodec(0, cinst)); - TEST_MUSTPASS(codec->SetSendCodec(0, cinst)); + // Set back to preferred codec. + TEST_MUSTPASS(voe_codec_->GetCodec(0, codec_instance)); + TEST_MUSTPASS(voe_codec_->SetSendCodec(0, codec_instance)); #else TEST_LOG("\n\n+++ Codec tests NOT ENABLED +++\n"); #endif // #ifdef _TEST_CODEC_ + return 0; +} + +int VoETestManager::DoStandardTest() { + TEST_LOG("\n\n+++ Base tests +++\n\n"); + + if (TestTraceApi() != 0) return -1; + if (TestHardwareBeforeInitializing() != 0) return -1; + + if (SetUp() != 0) return -1; + + if (TestRtpRtcpBeforeStreaming() != 0) return -1; + if (TestHardwareBeforeStreaming() != 0) return -1; + if (TestCodecsBeforeStreaming() != 0) return -1; + if (TestNetworkBeforeStreaming() != 0) return -1; + + FakeExternalTransport channel0_transport(voe_network_); + if (TestStartStreaming(channel0_transport) != 0) return -1; + + if (TestStartPlaying() != 0) return -1; + if (TestHoldAndNetEq() != 0) return -1; + if (TestCodecs() != 0) return -1; + ///////////////////////// // Start another channel @@ -1700,18 +1745,19 @@ int VoETestManager::DoStandardTest() { " RTP/RTCP tests +++ \n\n"); TEST_LOG("Create one more channel and start it up\n"); - TEST_MUSTPASS(!(1==base->CreateChannel())); + TEST_MUSTPASS(!(1==voe_base_->CreateChannel())); #ifdef WEBRTC_EXTERNAL_TRANSPORT - my_transportation ch1transport(netw); - TEST_MUSTPASS(netw->RegisterExternalTransport(1, ch1transport)); + FakeExternalTransport ch1transport(voe_network_); + TEST_MUSTPASS(voe_network_->RegisterExternalTransport(1, ch1transport)); #else - TEST_MUSTPASS(base->SetSendDestination(1, 8002, "127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(1, 8002)); + TEST_MUSTPASS(voe_base_->SetSendDestination(1, 8002, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(1, 8002)); #endif - TEST_MUSTPASS(base->StartReceive(1)); - TEST_MUSTPASS(base->StartPlayout(1)); - TEST_MUSTPASS(rtp_rtcp->SetLocalSSRC(1, 5678)); // ensures SSSR_ch1 = 5678 - TEST_MUSTPASS(base->StartSend(1)); + TEST_MUSTPASS(voe_base_->StartReceive(1)); + TEST_MUSTPASS(voe_base_->StartPlayout(1)); + // Ensures SSSR_ch1 = 5678. + TEST_MUSTPASS(voe_rtp_rtcp_->SetLocalSSRC(1, 5678)); + TEST_MUSTPASS(voe_base_->StartSend(1)); SLEEP(2000); #else TEST_LOG("\n\n+++ Preparing another channel NOT NEEDED +++ \n"); @@ -1732,29 +1778,30 @@ int VoETestManager::DoStandardTest() { SLEEP(8000); + char char_buffer[256]; TEST_LOG("Check that we have gotten RTCP packet, and collected CName\n"); - TEST_MUSTPASS(rtp_rtcp->GetRemoteRTCP_CNAME(0, tmpStr)); - TEST_LOG("default cname is %s", tmpStr); - TEST_MUSTPASS(_stricmp("Niklas", tmpStr)); + TEST_MUSTPASS(voe_rtp_rtcp_->GetRemoteRTCP_CNAME(0, char_buffer)); + TEST_LOG("default cname is %s", char_buffer); + TEST_MUSTPASS(_stricmp("Niklas", char_buffer)); TEST_LOG("Check that we have received the right SSRC\n"); unsigned int ssrc1; - TEST_MUSTPASS(rtp_rtcp->GetLocalSSRC(0, ssrc1)); + TEST_MUSTPASS(voe_rtp_rtcp_->GetLocalSSRC(0, ssrc1)); TEST_LOG("SSRC chan 0 = %lu \n", (long unsigned int) ssrc1); - TEST_MUSTPASS(rtp_rtcp->GetRemoteSSRC(0, ssrc1)); + TEST_MUSTPASS(voe_rtp_rtcp_->GetRemoteSSRC(0, ssrc1)); // the originally set 1234 should be maintained TEST_MUSTPASS(1234 != ssrc1); // RTCP APP tests TEST_LOG("Check RTCP APP send/receive \n"); - TEST_MUSTPASS(rtp_rtcp->RegisterRTCPObserver(0, myRtcpAppHandler)); + TEST_MUSTPASS(voe_rtp_rtcp_->RegisterRTCPObserver(0, myRtcpAppHandler)); SLEEP(100); // send RTCP APP packet (fill up data message to multiple of 32 bits) const char* data = "application-dependent data------"; // multiple of 32byte unsigned short lenBytes(static_cast (strlen(data))); unsigned int name = static_cast (0x41424344); // 'ABCD'; unsigned char subType = 1; - TEST_MUSTPASS(rtp_rtcp->SendApplicationDefinedRTCPPacket(0, + TEST_MUSTPASS(voe_rtp_rtcp_->SendApplicationDefinedRTCPPacket(0, subType, name, data, @@ -1769,9 +1816,9 @@ int VoETestManager::DoStandardTest() { lenBytes); // disable the callback and verify that no callback is received this time myRtcpAppHandler.Reset(); - TEST_MUSTPASS(rtp_rtcp->DeRegisterRTCPObserver(0)); + TEST_MUSTPASS(voe_rtp_rtcp_->DeRegisterRTCPObserver(0)); - TEST_MUSTPASS(rtp_rtcp->SendApplicationDefinedRTCPPacket(0, + TEST_MUSTPASS(voe_rtp_rtcp_->SendApplicationDefinedRTCPPacket(0, subType, name, data, @@ -1789,31 +1836,31 @@ int VoETestManager::DoStandardTest() { // fail tests // invalid channel - TEST_MUSTPASS(-1 != rtp_rtcp->InsertExtraRTPPacket(-1, + TEST_MUSTPASS(-1 != voe_rtp_rtcp_->InsertExtraRTPPacket(-1, 0, false, payloadData, 8)); // invalid payload type - TEST_MUSTPASS(-1 != rtp_rtcp->InsertExtraRTPPacket(0, + TEST_MUSTPASS(-1 != voe_rtp_rtcp_->InsertExtraRTPPacket(0, -1, false, payloadData, 8)); // invalid payload type - TEST_MUSTPASS(-1 != rtp_rtcp->InsertExtraRTPPacket(0, + TEST_MUSTPASS(-1 != voe_rtp_rtcp_->InsertExtraRTPPacket(0, 128, false, payloadData, 8)); // invalid pointer - TEST_MUSTPASS(-1 != rtp_rtcp->InsertExtraRTPPacket(0, + TEST_MUSTPASS(-1 != voe_rtp_rtcp_->InsertExtraRTPPacket(0, 99, false, NULL, 8)); // invalid size - TEST_MUSTPASS(-1 != rtp_rtcp->InsertExtraRTPPacket(0, + TEST_MUSTPASS(-1 != voe_rtp_rtcp_->InsertExtraRTPPacket(0, 99, false, payloadData, @@ -1821,12 +1868,12 @@ int VoETestManager::DoStandardTest() { // transmit some extra RTP packets for (int pt = 0; pt < 128; pt++) { - TEST_MUSTPASS(rtp_rtcp->InsertExtraRTPPacket(0, + TEST_MUSTPASS(voe_rtp_rtcp_->InsertExtraRTPPacket(0, pt, false, payloadData, 8)); - TEST_MUSTPASS(rtp_rtcp->InsertExtraRTPPacket(0, + TEST_MUSTPASS(voe_rtp_rtcp_->InsertExtraRTPPacket(0, pt, true, payloadData, @@ -1838,44 +1885,44 @@ int VoETestManager::DoStandardTest() { #endif TEST_LOG("Enable the RTP observer\n"); - TEST_MUSTPASS(rtp_rtcp->RegisterRTPObserver(0, rtpObserver)); - TEST_MUSTPASS(rtp_rtcp->RegisterRTPObserver(1, rtpObserver)); + TEST_MUSTPASS(voe_rtp_rtcp_->RegisterRTPObserver(0, rtpObserver)); + TEST_MUSTPASS(voe_rtp_rtcp_->RegisterRTPObserver(1, rtpObserver)); rtpObserver.Reset(); // Create two RTP-dump files (3 seconds long). // Verify using rtpplay or NetEqRTPplay when test is done. TEST_LOG("Creating two RTP-dump files...\n"); - TEST_MUSTPASS(rtp_rtcp->StartRTPDump(0, + TEST_MUSTPASS(voe_rtp_rtcp_->StartRTPDump(0, GetFilename("dump_in_3sec.rtp"), kRtpIncoming)); MARK(); - TEST_MUSTPASS(rtp_rtcp->StartRTPDump(0, + TEST_MUSTPASS(voe_rtp_rtcp_->StartRTPDump(0, GetFilename("dump_out_3sec.rtp"), kRtpOutgoing)); MARK(); SLEEP(3000); - TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0, kRtpIncoming)); + TEST_MUSTPASS(voe_rtp_rtcp_->StopRTPDump(0, kRtpIncoming)); MARK(); - TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0, kRtpOutgoing)); + TEST_MUSTPASS(voe_rtp_rtcp_->StopRTPDump(0, kRtpOutgoing)); MARK(); rtpObserver.Reset(); TEST_LOG("Verify the OnIncomingSSRCChanged callback\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(rtp_rtcp->SetLocalSSRC(0, 7777)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_rtp_rtcp_->SetLocalSSRC(0, 7777)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(500); TEST_MUSTPASS(rtpObserver._SSRC[0] != 7777); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(rtp_rtcp->SetLocalSSRC(0, 1234)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_rtp_rtcp_->SetLocalSSRC(0, 1234)); + TEST_MUSTPASS(voe_base_->StartSend(0)); SLEEP(500); TEST_MUSTPASS(rtpObserver._SSRC[0] != 1234); rtpObserver.Reset(); - if (file) { + if (voe_file_) { TEST_LOG("Start playing a file as microphone again...\n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); @@ -1883,11 +1930,11 @@ int VoETestManager::DoStandardTest() { #ifdef WEBRTC_CODEC_RED TEST_LOG("Enabling FEC \n"); - TEST_MUSTPASS(rtp_rtcp->SetFECStatus(0, true)); + TEST_MUSTPASS(voe_rtp_rtcp_->SetFECStatus(0, true)); SLEEP(2000); TEST_LOG("Disabling FEC\n"); - TEST_MUSTPASS(rtp_rtcp->SetFECStatus(0, false)); + TEST_MUSTPASS(voe_rtp_rtcp_->SetFECStatus(0, false)); SLEEP(2000); #else TEST_LOG("Skipping FEC tests - WEBRTC_CODEC_RED not defined \n"); @@ -1902,7 +1949,7 @@ int VoETestManager::DoStandardTest() { TEST_LOG("\n\n+++ Delete extra channel +++ \n\n"); TEST_LOG("Delete channel 1, stopping everything\n"); - TEST_MUSTPASS(base->DeleteChannel(1)); + TEST_MUSTPASS(voe_base_->DeleteChannel(1)); #else TEST_LOG("\n\n+++ Delete extra channel NOT NEEDED +++ \n"); #endif // #if defined(WEBRTC_VOICE_ENGINE_CONFERENCING) && (define...... @@ -1912,37 +1959,40 @@ int VoETestManager::DoStandardTest() { #ifdef _TEST_HARDWARE_ TEST_LOG("\n\n+++ More hardware tests +++\n\n"); + int nRec = 0, nPlay = 0; + char device_name[128] = {0}; + char guid_name[128] = {0}; #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) #ifdef _WIN32 // should works also while already recording - TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(-1)); // should works also while already playing - TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(-1)); #else - TEST_MUSTPASS(hardware->SetRecordingDevice(0)); - TEST_MUSTPASS(hardware->SetPlayoutDevice(0)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(0)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(0)); #endif - TEST_MUSTPASS(hardware->GetRecordingDeviceName(0, devName, guidName)); - TEST_MUSTPASS(hardware->GetPlayoutDeviceName(0, devName, guidName)); + TEST_MUSTPASS(voe_hardware_->GetRecordingDeviceName(0, device_name, guid_name)); + TEST_MUSTPASS(voe_hardware_->GetPlayoutDeviceName(0, device_name, guid_name)); - TEST_MUSTPASS(hardware->GetNumOfRecordingDevices(nRec)); - TEST_MUSTPASS(hardware->GetNumOfPlayoutDevices(nPlay)); + TEST_MUSTPASS(voe_hardware_->GetNumOfRecordingDevices(nRec)); + TEST_MUSTPASS(voe_hardware_->GetNumOfPlayoutDevices(nPlay)); #endif int load = -1; #if defined(_WIN32) - TEST_MUSTPASS(hardware->GetCPULoad(load)); + TEST_MUSTPASS(voe_hardware_->GetCPULoad(load)); TEST_MUSTPASS(load == -1); TEST_LOG("VE CPU load = %d\n", load); #else - TEST_MUSTPASS(!hardware->GetCPULoad(load)); + TEST_MUSTPASS(!voe_hardware_->GetCPULoad(load)); #endif #if !defined(WEBRTC_MAC) && !defined(WEBRTC_ANDROID) // Not supported on Mac yet load = -1; - TEST_MUSTPASS(hardware->GetSystemCPULoad(load)); + TEST_MUSTPASS(voe_hardware_->GetSystemCPULoad(load)); TEST_MUSTPASS(load == -1); TEST_LOG("System CPU load = %d\n", load); #endif @@ -1950,31 +2000,32 @@ int VoETestManager::DoStandardTest() { #ifdef MAC_IPHONE // Reset sound device TEST_LOG("Reset sound device \n"); - TEST_MUSTPASS(hardware->ResetAudioDevice()); + TEST_MUSTPASS(voe_hardware_->ResetAudioDevice()); SLEEP(2000); #endif // #ifdef MAC_IPHONE TEST_LOG("\nBuilt-in WASAPI AEC tests\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); - TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); + AudioLayers givenLayer; + TEST_MUSTPASS(voe_hardware_->GetAudioDeviceLayer(givenLayer)); if (givenLayer != kAudioWindowsCore) { - TEST_MUSTFAIL(hardware->EnableBuiltInAEC(true)); - TEST_MUSTFAIL(hardware->EnableBuiltInAEC(false)); + TEST_MUSTFAIL(voe_hardware_->EnableBuiltInAEC(true)); + TEST_MUSTFAIL(voe_hardware_->EnableBuiltInAEC(false)); } else { - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); // Can't be set after StartSend(). - TEST_MUSTFAIL(hardware->EnableBuiltInAEC(true)); - TEST_MUSTFAIL(hardware->EnableBuiltInAEC(false)); + TEST_MUSTFAIL(voe_hardware_->EnableBuiltInAEC(true)); + TEST_MUSTFAIL(voe_hardware_->EnableBuiltInAEC(false)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(hardware->EnableBuiltInAEC(true)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_hardware_->EnableBuiltInAEC(true)); // Can't be called before StartPlayout(). - TEST_MUSTFAIL(base->StartSend(0)); + TEST_MUSTFAIL(voe_base_->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("Processing capture data with built-in AEC...\n"); SLEEP(2000); @@ -1982,48 +2033,48 @@ int VoETestManager::DoStandardTest() { int num_devs = 0; char dev_name[128] = { 0 }; char guid_name[128] = { 0 }; - TEST_MUSTPASS(hardware->GetNumOfRecordingDevices(num_devs)); + TEST_MUSTPASS(voe_hardware_->GetNumOfRecordingDevices(num_devs)); for (int dev_index = 0; dev_index < num_devs; ++dev_index) { - TEST_MUSTPASS(hardware->GetRecordingDeviceName(dev_index, + TEST_MUSTPASS(voe_hardware_->GetRecordingDeviceName(dev_index, dev_name, guid_name)); TEST_LOG("%d: %s\n", dev_index, dev_name); - TEST_MUSTPASS(hardware->SetRecordingDevice(dev_index)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(dev_index)); SLEEP(2000); } - TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); - TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(-1)); TEST_LOG("Looping through render devices, restarting for each " "device...\n"); - TEST_MUSTPASS(hardware->GetNumOfPlayoutDevices(num_devs)); + TEST_MUSTPASS(voe_hardware_->GetNumOfPlayoutDevices(num_devs)); for (int dev_index = 0; dev_index < num_devs; ++dev_index) { - TEST_MUSTPASS(hardware->GetPlayoutDeviceName(dev_index, + TEST_MUSTPASS(voe_hardware_->GetPlayoutDeviceName(dev_index, dev_name, guid_name)); TEST_LOG("%d: %s\n", dev_index, dev_name); - TEST_MUSTPASS(hardware->SetPlayoutDevice(dev_index)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(dev_index)); SLEEP(2000); } TEST_LOG("Using default devices...\n"); - TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); - TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetRecordingDevice(-1)); + TEST_MUSTPASS(voe_hardware_->SetPlayoutDevice(-1)); SLEEP(2000); // Possible, but not recommended before StopSend(). - TEST_MUSTPASS(base->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); SLEEP(2000); // To verify that there is no garbage audio. TEST_LOG("Disabling built-in AEC.\n"); - TEST_MUSTPASS(hardware->EnableBuiltInAEC(false)); + TEST_MUSTPASS(voe_hardware_->EnableBuiltInAEC(false)); } - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); #else TEST_LOG("\n\n+++ More hardware tests NOT ENABLED +++\n"); #endif @@ -2036,7 +2087,7 @@ int VoETestManager::DoStandardTest() { TEST_LOG("Making sure Dtmf Feedback is enabled by default \n"); bool dtmfFeedback = false, dtmfDirectFeedback = true; - TEST_MUSTPASS(dtmf->GetDtmfFeedbackStatus(dtmfFeedback, + TEST_MUSTPASS(voe_dtmf_->GetDtmfFeedbackStatus(dtmfFeedback, dtmfDirectFeedback)); TEST_MUSTPASS(!dtmfFeedback); TEST_MUSTPASS(dtmfDirectFeedback); @@ -2054,7 +2105,7 @@ int VoETestManager::DoStandardTest() { ci.pltype = 0; ci.rate = 64000; strcpy(ci.plname, "PCMU"); - TEST_MUSTPASS(codec->SetSendCodec(0, ci)); + TEST_MUSTPASS(voe_codec_->SetSendCodec(0, ci)); // Loop the different detections methods TelephoneEventDetectionMethods detMethod = kInBand; @@ -2090,18 +2141,18 @@ int VoETestManager::DoStandardTest() { " ONCE \n"); detMethod = kInAndOutOfBand; } - TEST_MUSTPASS(dtmf->RegisterTelephoneEventDetection(0, detMethod, *d)); + TEST_MUSTPASS(voe_dtmf_->RegisterTelephoneEventDetection(0, detMethod, *d)); #else TEST_LOG("Skipping Dtmf detection tests - WEBRTC_DTMF_DETECTION not" " defined or _INSTRUMENTATION_TESTING_ defined \n"); #endif - TEST_MUSTPASS(dtmf->SetDtmfFeedbackStatus(false)); + TEST_MUSTPASS(voe_dtmf_->SetDtmfFeedbackStatus(false)); TEST_LOG("Sending in-band telephone events:"); for (int i = 0; i < 16; i++) { TEST_LOG("\n %d ", i); fflush(NULL); - TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, i, false, 160, 10)); + TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, i, false, 160, 10)); SLEEP(500); } #ifdef WEBRTC_CODEC_AVT @@ -2109,24 +2160,24 @@ int VoETestManager::DoStandardTest() { for (int i = 0; i < 16; i++) { TEST_LOG("\n %d ", i); fflush(NULL); - TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, i, true)); + TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, i, true)); SLEEP(500); } // Testing 2 non-Dtmf events int num = 32; TEST_LOG("\n %d ", num); fflush(NULL); - TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, num, true)); + TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, num, true)); SLEEP(500); num = 110; TEST_LOG("\n %d ", num); fflush(NULL); - TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, num, true)); + TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, num, true)); SLEEP(500); ANL(); #endif #if (defined(WEBRTC_DTMF_DETECTION) && !defined(_INSTRUMENTATION_TESTING_)) - TEST_MUSTPASS(dtmf->DeRegisterTelephoneEventDetection(0)); + TEST_MUSTPASS(voe_dtmf_->DeRegisterTelephoneEventDetection(0)); TEST_LOG("Detected %d events \n", d->counter); int expectedCount = 32; // For 0 == h if (1 == h) expectedCount = 18; @@ -2136,32 +2187,32 @@ int VoETestManager::DoStandardTest() { } // for loop TEST_LOG("Testing no detection after disabling:"); -TEST_MUSTPASS(dtmf->DeRegisterTelephoneEventDetection(0)); +TEST_MUSTPASS(voe_dtmf_->DeRegisterTelephoneEventDetection(0)); TEST_LOG(" 0"); -TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, 0, false)); +TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, 0, false)); SLEEP(500); TEST_LOG(" 1"); -TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, 1, true)); +TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, 1, true)); SLEEP(500); TEST_LOG("\nDtmf tones sent: 2, detected: %d \n", d->counter); TEST_MUSTPASS(0 != d->counter); delete d; -TEST_MUSTPASS(codec->GetCodec(0, ci)); +TEST_MUSTPASS(voe_codec_->GetCodec(0, ci)); TEST_LOG("Back to first codec in list: %s\n", ci.plname); -TEST_MUSTPASS(codec->SetSendCodec(0, ci)); +TEST_MUSTPASS(voe_codec_->SetSendCodec(0, ci)); #endif #ifndef MAC_IPHONE #ifdef WEBRTC_CODEC_AVT TEST_LOG("Disabling Dtmf playout (no tone should be heard) \n"); - TEST_MUSTPASS(dtmf->SetDtmfPlayoutStatus(0, false)); - TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, 0, true)); + TEST_MUSTPASS(voe_dtmf_->SetDtmfPlayoutStatus(0, false)); + TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, 0, true)); SLEEP(500); TEST_LOG("Enabling Dtmf playout (tone should be heard) \n"); - TEST_MUSTPASS(dtmf->SetDtmfPlayoutStatus(0, true)); - TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, 0, true)); + TEST_MUSTPASS(voe_dtmf_->SetDtmfPlayoutStatus(0, true)); + TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, 0, true)); SLEEP(500); #endif #endif @@ -2175,21 +2226,21 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("Changing Dtmf payload type \n"); // Start by modifying the receiving side - if (codec) { - int nc = codec->NumOfCodecs(); + if (voe_codec_) { + int nc = voe_codec_->NumOfCodecs(); for (int i = 0; i < nc; i++) { - TEST_MUSTPASS(codec->GetCodec(i, c2)); + TEST_MUSTPASS(voe_codec_->GetCodec(i, c2)); if (!_stricmp("telephone-event", c2.plname)) { c2.pltype = 88; // use 88 instead of default 106 - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); - TEST_MUSTPASS(codec->SetRecPayloadType(0, c2)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); + TEST_MUSTPASS(voe_codec_->SetRecPayloadType(0, c2)); + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone( 0, AudioFilename(), true, true)); break; } @@ -2199,18 +2250,18 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); SLEEP(500); // Next, we must modify the sending side as well - TEST_MUSTPASS(dtmf->SetSendTelephoneEventPayloadType(0, c2.pltype)); + TEST_MUSTPASS(voe_dtmf_->SetSendTelephoneEventPayloadType(0, c2.pltype)); TEST_LOG("Outband Dtmf test with modified Dtmf payload:"); for (int i = 0; i < 16; i++) { TEST_LOG(" %d", i); fflush(NULL); - TEST_MUSTPASS(dtmf->SendTelephoneEvent(0, i, true)); + TEST_MUSTPASS(voe_dtmf_->SendTelephoneEvent(0, i, true)); SLEEP(500); } ANL(); #endif - TEST_MUSTPASS(dtmf->SetDtmfFeedbackStatus(true, false)); + TEST_MUSTPASS(voe_dtmf_->SetDtmfFeedbackStatus(true, false)); #else TEST_LOG("\n\n+++ Dtmf tests NOT ENABLED +++\n"); #endif // #ifdef _TEST_DTMF_ @@ -2224,21 +2275,21 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); // Speaker volume test unsigned int vol = 1000; TEST_LOG("Saving Speaker volume\n"); - TEST_MUSTPASS(volume->GetSpeakerVolume(vol)); + TEST_MUSTPASS(voe_volume_control_->GetSpeakerVolume(vol)); TEST_MUSTPASS(!(vol <= 255)); TEST_LOG("Setting speaker volume to 0\n"); - TEST_MUSTPASS(volume->SetSpeakerVolume(0)); + TEST_MUSTPASS(voe_volume_control_->SetSpeakerVolume(0)); SLEEP(1000); TEST_LOG("Setting speaker volume to 255\n"); - TEST_MUSTPASS(volume->SetSpeakerVolume(255)); + TEST_MUSTPASS(voe_volume_control_->SetSpeakerVolume(255)); SLEEP(1000); TEST_LOG("Setting speaker volume back to saved value\n"); - TEST_MUSTPASS(volume->SetSpeakerVolume(vol)); + TEST_MUSTPASS(voe_volume_control_->SetSpeakerVolume(vol)); SLEEP(1000); #endif // #if !defined(MAC_IPHONE) - if (file) { + if (voe_file_) { TEST_LOG("==> Talk into the microphone \n"); - TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); + TEST_MUSTPASS(voe_file_->StopPlayingFileAsMicrophone(0)); SLEEP(1000); } @@ -2247,39 +2298,39 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #if defined(_TEST_AUDIO_PROCESSING_) && defined(WEBRTC_VOICE_ENGINE_AGC) bool agcTemp(true); AgcModes agcModeTemp(kAgcAdaptiveAnalog); - TEST_MUSTPASS(apm->GetAgcStatus(agcTemp, agcModeTemp)); // current state + TEST_MUSTPASS(voe_apm_->GetAgcStatus(agcTemp, agcModeTemp)); // current state TEST_LOG("Turn off AGC\n"); - TEST_MUSTPASS(apm->SetAgcStatus(false)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(false)); #endif TEST_LOG("Saving Mic volume\n"); - TEST_MUSTPASS(volume->GetMicVolume(vol)); + TEST_MUSTPASS(voe_volume_control_->GetMicVolume(vol)); TEST_MUSTPASS(!(vol <= 255)); TEST_LOG("Setting Mic volume to 0\n"); - TEST_MUSTPASS(volume->SetMicVolume(0)); + TEST_MUSTPASS(voe_volume_control_->SetMicVolume(0)); SLEEP(1000); TEST_LOG("Setting Mic volume to 255\n"); - TEST_MUSTPASS(volume->SetMicVolume(255)); + TEST_MUSTPASS(voe_volume_control_->SetMicVolume(255)); SLEEP(1000); TEST_LOG("Setting Mic volume back to saved value\n"); - TEST_MUSTPASS(volume->SetMicVolume(vol)); + TEST_MUSTPASS(voe_volume_control_->SetMicVolume(vol)); SLEEP(1000); #if defined(_TEST_AUDIO_PROCESSING_) && defined(WEBRTC_VOICE_ENGINE_AGC) TEST_LOG("Reset AGC to previous state\n"); - TEST_MUSTPASS(apm->SetAgcStatus(agcTemp, agcModeTemp)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(agcTemp, agcModeTemp)); #endif #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) // Input mute test TEST_LOG("Enabling input muting\n"); bool mute = true; - TEST_MUSTPASS(volume->GetInputMute(0, mute)); + TEST_MUSTPASS(voe_volume_control_->GetInputMute(0, mute)); TEST_MUSTPASS(mute); - TEST_MUSTPASS(volume->SetInputMute(0, true)); - TEST_MUSTPASS(volume->GetInputMute(0, mute)); + TEST_MUSTPASS(voe_volume_control_->SetInputMute(0, true)); + TEST_MUSTPASS(voe_volume_control_->GetInputMute(0, mute)); TEST_MUSTPASS(!mute); SLEEP(1000); TEST_LOG("Disabling input muting\n"); - TEST_MUSTPASS(volume->SetInputMute(0, false)); - TEST_MUSTPASS(volume->GetInputMute(0, mute)); + TEST_MUSTPASS(voe_volume_control_->SetInputMute(0, false)); + TEST_MUSTPASS(voe_volume_control_->GetInputMute(0, mute)); TEST_MUSTPASS(mute); SLEEP(1000); @@ -2287,34 +2338,34 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); // System output mute test TEST_LOG("Enabling system output muting\n"); bool outputMute = true; - TEST_MUSTPASS(volume->GetSystemOutputMute(outputMute)); + TEST_MUSTPASS(voe_volume_control_->GetSystemOutputMute(outputMute)); TEST_MUSTPASS(outputMute); - TEST_MUSTPASS(volume->SetSystemOutputMute(true)); - TEST_MUSTPASS(volume->GetSystemOutputMute(outputMute)); + TEST_MUSTPASS(voe_volume_control_->SetSystemOutputMute(true)); + TEST_MUSTPASS(voe_volume_control_->GetSystemOutputMute(outputMute)); TEST_MUSTPASS(!outputMute); SLEEP(1000); TEST_LOG("Disabling system output muting\n"); - TEST_MUSTPASS(volume->SetSystemOutputMute(false)); - TEST_MUSTPASS(volume->GetSystemOutputMute(outputMute)); + TEST_MUSTPASS(voe_volume_control_->SetSystemOutputMute(false)); + TEST_MUSTPASS(voe_volume_control_->GetSystemOutputMute(outputMute)); TEST_MUSTPASS(outputMute); SLEEP(1000); // System Input mute test TEST_LOG("Enabling system input muting\n"); bool inputMute = true; - TEST_MUSTPASS(volume->GetSystemInputMute(inputMute)); + TEST_MUSTPASS(voe_volume_control_->GetSystemInputMute(inputMute)); TEST_MUSTPASS(inputMute); - TEST_MUSTPASS(volume->SetSystemInputMute(true)); + TEST_MUSTPASS(voe_volume_control_->SetSystemInputMute(true)); // This is needed to avoid error using pulse SLEEP(100); - TEST_MUSTPASS(volume->GetSystemInputMute(inputMute)); + TEST_MUSTPASS(voe_volume_control_->GetSystemInputMute(inputMute)); TEST_MUSTPASS(!inputMute); SLEEP(1000); TEST_LOG("Disabling system input muting\n"); - TEST_MUSTPASS(volume->SetSystemInputMute(false)); + TEST_MUSTPASS(voe_volume_control_->SetSystemInputMute(false)); // This is needed to avoid error using pulse SLEEP(100); - TEST_MUSTPASS(volume->GetSystemInputMute(inputMute)); + TEST_MUSTPASS(voe_volume_control_->GetSystemInputMute(inputMute)); TEST_MUSTPASS(inputMute); SLEEP(1000); #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) @@ -2329,11 +2380,11 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); for (int t = 0; t < 5; t++) { SLEEP(1000); - TEST_MUSTPASS(volume->GetSpeechInputLevel(inputLevel)); - TEST_MUSTPASS(volume->GetSpeechOutputLevel(0, outputLevel)); - TEST_MUSTPASS(volume->GetSpeechInputLevelFullRange( + TEST_MUSTPASS(voe_volume_control_->GetSpeechInputLevel(inputLevel)); + TEST_MUSTPASS(voe_volume_control_->GetSpeechOutputLevel(0, outputLevel)); + TEST_MUSTPASS(voe_volume_control_->GetSpeechInputLevelFullRange( inputLevelFullRange)); - TEST_MUSTPASS(volume->GetSpeechOutputLevelFullRange( + TEST_MUSTPASS(voe_volume_control_->GetSpeechOutputLevelFullRange( 0, outputLevelFullRange)); TEST_LOG(" warped levels (0-9) : in=%5d, out=%5d\n", inputLevel, outputLevel); @@ -2341,9 +2392,9 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); inputLevelFullRange, outputLevelFullRange); } #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) - if (file) { + if (voe_file_) { TEST_LOG("==> Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); @@ -2354,44 +2405,50 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); // Channel scaling test TEST_LOG("Channel scaling\n"); float scaling = -1.0; - TEST_MUSTPASS(volume->GetChannelOutputVolumeScaling(0, scaling)); + TEST_MUSTPASS(voe_volume_control_->GetChannelOutputVolumeScaling(0, scaling)); TEST_MUSTPASS(1.0 != scaling); - TEST_MUSTPASS(volume->SetChannelOutputVolumeScaling(0, (float)0.1)); - TEST_MUSTPASS(volume->GetChannelOutputVolumeScaling(0, scaling)); + TEST_MUSTPASS(voe_volume_control_->SetChannelOutputVolumeScaling(0, + (float)0.1)); + TEST_MUSTPASS(voe_volume_control_->GetChannelOutputVolumeScaling(0, scaling)); TEST_MUSTPASS(!((scaling > 0.099) && (scaling < 0.101))); SLEEP(1000); - TEST_MUSTPASS(volume->SetChannelOutputVolumeScaling(0, (float)1.0)); - TEST_MUSTPASS(volume->GetChannelOutputVolumeScaling(0, scaling)); + TEST_MUSTPASS(voe_volume_control_->SetChannelOutputVolumeScaling(0, + (float)1.0)); + TEST_MUSTPASS(voe_volume_control_->GetChannelOutputVolumeScaling(0, scaling)); TEST_MUSTPASS(1.0 != scaling); #endif // #if !defined(MAC_IPHONE) #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) // Channel panning test TEST_LOG("Channel panning\n"); float left = -1.0, right = -1.0; - TEST_MUSTPASS(volume->GetOutputVolumePan(0, left, right)); + TEST_MUSTPASS(voe_volume_control_->GetOutputVolumePan(0, left, right)); TEST_MUSTPASS(!((left == 1.0) && (right == 1.0))); TEST_LOG("Panning to left\n"); - TEST_MUSTPASS(volume->SetOutputVolumePan(0, (float)0.8, (float)0.1)); - TEST_MUSTPASS(volume->GetOutputVolumePan(0, left, right)); + TEST_MUSTPASS(voe_volume_control_->SetOutputVolumePan(0, (float)0.8, + (float)0.1)); + TEST_MUSTPASS(voe_volume_control_->GetOutputVolumePan(0, left, right)); TEST_MUSTPASS(!((left > 0.799) && (left < 0.801))); TEST_MUSTPASS(!((right > 0.099) && (right < 0.101))); SLEEP(1000); TEST_LOG("Back to center\n"); - TEST_MUSTPASS(volume->SetOutputVolumePan(0, (float)1.0, (float)1.0)); + TEST_MUSTPASS(voe_volume_control_->SetOutputVolumePan(0, (float)1.0, + (float)1.0)); SLEEP(1000); left = -1.0; right = -1.0; - TEST_MUSTPASS(volume->GetOutputVolumePan(0, left, right)); + TEST_MUSTPASS(voe_volume_control_->GetOutputVolumePan(0, left, right)); TEST_MUSTPASS(!((left == 1.0) && (right == 1.0))); TEST_LOG("Panning channel to right\n"); - TEST_MUSTPASS(volume->SetOutputVolumePan(0, (float)0.1, (float)0.8)); + TEST_MUSTPASS(voe_volume_control_->SetOutputVolumePan(0, (float)0.1, + (float)0.8)); SLEEP(100); - TEST_MUSTPASS(volume->GetOutputVolumePan(0, left, right)); + TEST_MUSTPASS(voe_volume_control_->GetOutputVolumePan(0, left, right)); TEST_MUSTPASS(!((left > 0.099) && (left < 0.101))); TEST_MUSTPASS(!((right > 0.799) && (right < 0.801))); SLEEP(1000); TEST_LOG("Channel back to center\n"); - TEST_MUSTPASS(volume->SetOutputVolumePan(0, (float)1.0, (float)1.0)); + TEST_MUSTPASS(voe_volume_control_->SetOutputVolumePan(0, (float)1.0, + (float)1.0)); SLEEP(1000); #else TEST_LOG("Skipping stereo tests\n"); @@ -2411,33 +2468,33 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("Must be OFF by default\n"); test = true; AgcModes agcMode = kAgcAdaptiveAnalog; - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); #else TEST_LOG("Must be ON by default\n"); test = false; AgcModes agcMode = kAgcAdaptiveAnalog; - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(!test); TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode); TEST_LOG("Turn off AGC\n"); // must set value in first call! - TEST_MUSTPASS(apm->SetAgcStatus(false, kAgcDefault)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(false, kAgcDefault)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode); #endif // #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)) TEST_LOG("Turn ON AGC\n"); #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)) - TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveDigital)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true, kAgcAdaptiveDigital)); #else - TEST_MUSTPASS(apm->SetAgcStatus(true)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true)); #endif TEST_LOG("Should be ON now\n"); - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(!test); #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)) TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); @@ -2448,28 +2505,28 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)) TEST_LOG("Testing Type settings\n"); // Should fail - TEST_MUSTPASS(!apm->SetAgcStatus(true, kAgcAdaptiveAnalog)); + TEST_MUSTPASS(!voe_apm_->SetAgcStatus(true, kAgcAdaptiveAnalog)); // Should fail - TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcFixedDigital)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true, kAgcFixedDigital)); // Should fail - TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveDigital)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true, kAgcAdaptiveDigital)); TEST_LOG("Turn off AGC\n"); - TEST_MUSTPASS(apm->SetAgcStatus(false)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(false)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); #else TEST_LOG("Testing Mode settings\n"); - TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcFixedDigital)); - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true, kAgcFixedDigital)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(kAgcFixedDigital != agcMode); - TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveDigital)); - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true, kAgcAdaptiveDigital)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); - TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveAnalog)); - TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true, kAgcAdaptiveAnalog)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode); #endif // #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)) TEST_LOG("rxAGC calls\n"); @@ -2479,51 +2536,51 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); bool rxAGCTemp(false); AgcModes rxAGCModeTemp(kAgcAdaptiveAnalog); // Store current state - TEST_MUSTPASS(apm->GetAgcStatus(rxAGCTemp, rxAGCModeTemp)); + TEST_MUSTPASS(voe_apm_->GetAgcStatus(rxAGCTemp, rxAGCModeTemp)); TEST_LOG("Turn off near-end AGC\n"); - TEST_MUSTPASS(apm->SetAgcStatus(false)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(false)); TEST_LOG("rxAGC Must be OFF by default\n"); test = true; AgcModes rxAGCMode = kAgcAdaptiveDigital; - TEST_MUSTPASS(apm->GetRxAgcStatus(0, test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetRxAgcStatus(0, test, agcMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(kAgcAdaptiveDigital != rxAGCMode); TEST_LOG("Turn off rxAGC\n"); // must set value in first call! - TEST_MUSTPASS(apm->SetRxAgcStatus(0, false, kAgcDefault)); + TEST_MUSTPASS(voe_apm_->SetRxAgcStatus(0, false, kAgcDefault)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(apm->GetRxAgcStatus(0, test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetRxAgcStatus(0, test, agcMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(kAgcAdaptiveDigital != rxAGCMode); TEST_LOG("Turn ON AGC\n"); - TEST_MUSTPASS(apm->SetRxAgcStatus(0, true)); + TEST_MUSTPASS(voe_apm_->SetRxAgcStatus(0, true)); TEST_LOG("Should be ON now\n"); - TEST_MUSTPASS(apm->GetRxAgcStatus(0, test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetRxAgcStatus(0, test, agcMode)); TEST_MUSTPASS(!test); TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); TEST_LOG("Testing Type settings\n"); // Should fail - TEST_MUSTPASS(!apm->SetRxAgcStatus(0, true, kAgcAdaptiveAnalog)); - TEST_MUSTPASS(apm->SetRxAgcStatus(0, true, kAgcFixedDigital)); - TEST_MUSTPASS(apm->GetRxAgcStatus(0, test, agcMode)); + TEST_MUSTPASS(!voe_apm_->SetRxAgcStatus(0, true, kAgcAdaptiveAnalog)); + TEST_MUSTPASS(voe_apm_->SetRxAgcStatus(0, true, kAgcFixedDigital)); + TEST_MUSTPASS(voe_apm_->GetRxAgcStatus(0, test, agcMode)); TEST_MUSTPASS(kAgcFixedDigital != agcMode); - TEST_MUSTPASS(apm->SetRxAgcStatus(0, true, kAgcAdaptiveDigital)); - TEST_MUSTPASS(apm->GetRxAgcStatus(0, test, agcMode)); + TEST_MUSTPASS(voe_apm_->SetRxAgcStatus(0, true, kAgcAdaptiveDigital)); + TEST_MUSTPASS(voe_apm_->GetRxAgcStatus(0, test, agcMode)); TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); TEST_LOG("Turn off AGC\n"); - TEST_MUSTPASS(apm->SetRxAgcStatus(0, false)); + TEST_MUSTPASS(voe_apm_->SetRxAgcStatus(0, false)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(apm->GetRxAgcStatus(0, test, agcMode)); + TEST_MUSTPASS(voe_apm_->GetRxAgcStatus(0, test, agcMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); // recover the old AGC mode - TEST_MUSTPASS(apm->SetAgcStatus(rxAGCTemp, rxAGCModeTemp)); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(rxAGCTemp, rxAGCModeTemp)); #else TEST_LOG("Skipping AGC tests - WEBRTC_VOICE_ENGINE_AGC not defined \n"); @@ -2540,84 +2597,84 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); EcModes ecMode = kEcAec; AecmModes aecmMode = kAecmSpeakerphone; bool enabledCNG(false); - TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); + TEST_MUSTPASS(voe_apm_->GetEcStatus(test, ecMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(ecModeDefault != ecMode); - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_LOG("default AECM: mode=%d CNG: mode=%d\n", aecmMode, enabledCNG); TEST_MUSTPASS(kAecmSpeakerphone != aecmMode); TEST_MUSTPASS(enabledCNG != true); - TEST_MUSTPASS(apm->SetAecmMode(kAecmQuietEarpieceOrHeadset, false)); - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->SetAecmMode(kAecmQuietEarpieceOrHeadset, false)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_LOG("change AECM to mode=%d CNG to false\n", aecmMode); TEST_MUSTPASS(aecmMode != kAecmQuietEarpieceOrHeadset); TEST_MUSTPASS(enabledCNG != false); TEST_LOG("Turn ON EC\n"); - TEST_MUSTPASS(apm->SetEcStatus(true, ecModeDefault)); + TEST_MUSTPASS(voe_apm_->SetEcStatus(true, ecModeDefault)); TEST_LOG("Should be ON now\n"); - TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); + TEST_MUSTPASS(voe_apm_->GetEcStatus(test, ecMode)); TEST_MUSTPASS(!test); TEST_MUSTPASS(ecModeDefault != ecMode); #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) - TEST_MUSTPASS(apm->SetEcStatus(true, kEcAec)); - TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); + TEST_MUSTPASS(voe_apm_->SetEcStatus(true, kEcAec)); + TEST_MUSTPASS(voe_apm_->GetEcStatus(test, ecMode)); TEST_MUSTPASS(kEcAec != ecMode); - TEST_MUSTPASS(apm->SetEcStatus(true, kEcConference)); - TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); + TEST_MUSTPASS(voe_apm_->SetEcStatus(true, kEcConference)); + TEST_MUSTPASS(voe_apm_->GetEcStatus(test, ecMode)); TEST_MUSTPASS(kEcAec != ecMode); // the samplefreq for AudioProcessing is 32k, so it wont work to // activate AECM - TEST_MUSTPASS(apm->SetEcStatus(true, kEcAecm)); - TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); + TEST_MUSTPASS(voe_apm_->SetEcStatus(true, kEcAecm)); + TEST_MUSTPASS(voe_apm_->GetEcStatus(test, ecMode)); TEST_MUSTPASS(kEcAecm != ecMode); #endif // set kEcAecm mode TEST_LOG("Testing AECM Mode settings\n"); - TEST_MUSTPASS(apm->SetEcStatus(true, kEcAecm)); - TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); + TEST_MUSTPASS(voe_apm_->SetEcStatus(true, kEcAecm)); + TEST_MUSTPASS(voe_apm_->GetEcStatus(test, ecMode)); TEST_LOG("EC: enabled=%d, ECmode=%d\n", test, ecMode); TEST_MUSTPASS(test != true); TEST_MUSTPASS(ecMode != kEcAecm); // AECM mode, get and set - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_MUSTPASS(aecmMode != kAecmQuietEarpieceOrHeadset); TEST_MUSTPASS(enabledCNG != false); - TEST_MUSTPASS(apm->SetAecmMode(kAecmEarpiece, true)); - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->SetAecmMode(kAecmEarpiece, true)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_LOG("AECM: mode=%d CNG: mode=%d\n", aecmMode, enabledCNG); TEST_MUSTPASS(aecmMode != kAecmEarpiece); TEST_MUSTPASS(enabledCNG != true); - TEST_MUSTPASS(apm->SetAecmMode(kAecmEarpiece, false)); - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->SetAecmMode(kAecmEarpiece, false)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_LOG("AECM: mode=%d CNG: mode=%d\n", aecmMode, enabledCNG); TEST_MUSTPASS(aecmMode != kAecmEarpiece); TEST_MUSTPASS(enabledCNG != false); - TEST_MUSTPASS(apm->SetAecmMode(kAecmLoudEarpiece, true)); - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->SetAecmMode(kAecmLoudEarpiece, true)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_LOG("AECM: mode=%d CNG: mode=%d\n", aecmMode, enabledCNG); TEST_MUSTPASS(aecmMode != kAecmLoudEarpiece); TEST_MUSTPASS(enabledCNG != true); - TEST_MUSTPASS(apm->SetAecmMode(kAecmSpeakerphone, false)); - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->SetAecmMode(kAecmSpeakerphone, false)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_LOG("AECM: mode=%d CNG: mode=%d\n", aecmMode, enabledCNG); TEST_MUSTPASS(aecmMode != kAecmSpeakerphone); TEST_MUSTPASS(enabledCNG != false); - TEST_MUSTPASS(apm->SetAecmMode(kAecmLoudSpeakerphone, true)); - TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG)); + TEST_MUSTPASS(voe_apm_->SetAecmMode(kAecmLoudSpeakerphone, true)); + TEST_MUSTPASS(voe_apm_->GetAecmMode(aecmMode, enabledCNG)); TEST_LOG("AECM: mode=%d CNG: mode=%d\n", aecmMode, enabledCNG); TEST_MUSTPASS(aecmMode != kAecmLoudSpeakerphone); TEST_MUSTPASS(enabledCNG != true); TEST_LOG("Turn OFF AEC\n"); - TEST_MUSTPASS(apm->SetEcStatus(false)); + TEST_MUSTPASS(voe_apm_->SetEcStatus(false)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); + TEST_MUSTPASS(voe_apm_->GetEcStatus(test, ecMode)); TEST_MUSTPASS(test); #else TEST_LOG("Skipping echo cancellation tests -" @@ -2631,81 +2688,81 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); test = true; NsModes nsMode = kNsVeryHighSuppression; - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(nsModeDefault != nsMode); TEST_LOG("Turn ON NS\n"); - TEST_MUSTPASS(apm->SetNsStatus(true)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(true)); TEST_LOG("Should be ON now\n"); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(!test); TEST_MUSTPASS(nsModeDefault != nsMode); TEST_LOG("Testing Mode settings\n"); - TEST_MUSTPASS(apm->SetNsStatus(true, kNsLowSuppression)); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(true, kNsLowSuppression)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(kNsLowSuppression != nsMode); - TEST_MUSTPASS(apm->SetNsStatus(true, kNsModerateSuppression)); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(true, kNsModerateSuppression)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(kNsModerateSuppression != nsMode); - TEST_MUSTPASS(apm->SetNsStatus(true, kNsHighSuppression)); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(true, kNsHighSuppression)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(kNsHighSuppression != nsMode); - TEST_MUSTPASS(apm->SetNsStatus(true, kNsVeryHighSuppression)); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(true, kNsVeryHighSuppression)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(kNsVeryHighSuppression != nsMode); - TEST_MUSTPASS(apm->SetNsStatus(true, kNsConference)); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(true, kNsConference)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(kNsHighSuppression != nsMode); - TEST_MUSTPASS(apm->SetNsStatus(true, kNsDefault)); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(true, kNsDefault)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(nsModeDefault != nsMode); TEST_LOG("Turn OFF NS\n"); - TEST_MUSTPASS(apm->SetNsStatus(false)); + TEST_MUSTPASS(voe_apm_->SetNsStatus(false)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(apm->GetNsStatus(test, nsMode)); + TEST_MUSTPASS(voe_apm_->GetNsStatus(test, nsMode)); TEST_MUSTPASS(test); TEST_LOG("rxNS calls\n"); TEST_LOG("rxNS Must be OFF by default\n"); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(test); TEST_MUSTPASS(nsModeDefault != nsMode); TEST_LOG("Turn ON rxNS\n"); - TEST_MUSTPASS(apm->SetRxNsStatus(0, true)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, true)); TEST_LOG("Should be ON now\n"); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(!test); TEST_MUSTPASS(nsModeDefault != nsMode); TEST_LOG("Testing Mode settings\n"); - TEST_MUSTPASS(apm->SetRxNsStatus(0, true, kNsLowSuppression)); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, true, kNsLowSuppression)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(kNsLowSuppression != nsMode); - TEST_MUSTPASS(apm->SetRxNsStatus(0, true, kNsModerateSuppression)); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, true, kNsModerateSuppression)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(kNsModerateSuppression != nsMode); - TEST_MUSTPASS(apm->SetRxNsStatus(0, true, kNsHighSuppression)); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, true, kNsHighSuppression)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(kNsHighSuppression != nsMode); - TEST_MUSTPASS(apm->SetRxNsStatus(0, true, kNsVeryHighSuppression)); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, true, kNsVeryHighSuppression)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(kNsVeryHighSuppression != nsMode); - TEST_MUSTPASS(apm->SetRxNsStatus(0, true, kNsConference)); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, true, kNsConference)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(kNsHighSuppression != nsMode); - TEST_MUSTPASS(apm->SetRxNsStatus(0, true, kNsDefault)); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, true, kNsDefault)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(nsModeDefault != nsMode); TEST_LOG("Turn OFF NS\n"); - TEST_MUSTPASS(apm->SetRxNsStatus(0, false)); + TEST_MUSTPASS(voe_apm_->SetRxNsStatus(0, false)); TEST_LOG("Should be OFF now\n"); - TEST_MUSTPASS(apm->GetRxNsStatus(0, test, nsMode)); + TEST_MUSTPASS(voe_apm_->GetRxNsStatus(0, test, nsMode)); TEST_MUSTPASS(test); #else @@ -2716,12 +2773,12 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #ifdef WEBRTC_VOICE_ENGINE_ECHO bool enabled = false; TEST_LOG("EC Metrics calls\n"); - TEST_MUSTPASS(apm->GetEcMetricsStatus(enabled)); // check default + TEST_MUSTPASS(voe_apm_->GetEcMetricsStatus(enabled)); // check default TEST_MUSTPASS(enabled != false); - TEST_MUSTPASS(apm->SetEcMetricsStatus(true)); // enable EC metrics + TEST_MUSTPASS(voe_apm_->SetEcMetricsStatus(true)); // enable EC metrics // must enable AEC to get valid echo metrics - TEST_MUSTPASS(apm->SetEcStatus(true, kEcAec)); - TEST_MUSTPASS(apm->GetEcMetricsStatus(enabled)); + TEST_MUSTPASS(voe_apm_->SetEcStatus(true, kEcAec)); + TEST_MUSTPASS(voe_apm_->GetEcMetricsStatus(enabled)); TEST_MUSTPASS(enabled != true); TEST_LOG("Speak into microphone and check metrics for 10 seconds...\n"); @@ -2730,13 +2787,13 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); int delay_std = 0; for (int t = 0; t < 5; t++) { SLEEP(2000); - TEST_MUSTPASS(apm->GetEchoMetrics(ERL, ERLE, RERL, A_NLP)); - TEST_MUSTPASS(apm->GetEcDelayMetrics(delay_median, delay_std)); + TEST_MUSTPASS(voe_apm_->GetEchoMetrics(ERL, ERLE, RERL, A_NLP)); + TEST_MUSTPASS(voe_apm_->GetEcDelayMetrics(delay_median, delay_std)); TEST_LOG(" Echo : ERL=%5d, ERLE=%5d, RERL=%5d, A_NLP=%5d [dB], " " delay median=%3d, delay std=%3d [ms]\n", ERL, ERLE, RERL, A_NLP, delay_median, delay_std); } - TEST_MUSTPASS(apm->SetEcMetricsStatus(false)); // disable echo metrics + TEST_MUSTPASS(voe_apm_->SetEcMetricsStatus(false)); // disable echo metrics #else TEST_LOG("Skipping Echo Control metrics tests -" " WEBRTC_VOICE_ENGINE_ECHO not defined \n"); @@ -2746,47 +2803,47 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #endif // #if (!defined(MAC_IPHONE) && !d... // VAD/DTX indication TEST_LOG("Get voice activity indication \n"); - if (codec) { + if (voe_codec_) { bool v = true, dummy2; VadModes dummy1; - TEST_MUSTPASS(codec->GetVADStatus(0, v, dummy1, dummy2)); + TEST_MUSTPASS(voe_codec_->GetVADStatus(0, v, dummy1, dummy2)); TEST_MUSTPASS(v); // Make sure VAD is disabled } - TEST_MUSTPASS(1 != apm->VoiceActivityIndicator(0)); - if (codec && volume) { + TEST_MUSTPASS(1 != voe_apm_->VoiceActivityIndicator(0)); + if (voe_codec_ && voe_volume_control_) { TEST_LOG("RX VAD detections may vary depending on current signal" " and mic input \n"); #if !defined(WEBRTC_ANDROID) && !defined(MAC_IPHONE) RxCallback rxc; - TEST_MUSTPASS(apm->RegisterRxVadObserver(0, rxc)); + TEST_MUSTPASS(voe_apm_->RegisterRxVadObserver(0, rxc)); #endif - TEST_MUSTPASS(codec->SetVADStatus(0, true)); - TEST_MUSTPASS(volume->SetInputMute(0, true)); - if (file) { - TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, true)); + TEST_MUSTPASS(voe_volume_control_->SetInputMute(0, true)); + if (voe_file_) { + TEST_MUSTPASS(voe_file_->StopPlayingFileAsMicrophone(0)); } SLEEP(500); // After sleeping we should have detected silence - TEST_MUSTPASS(0 != apm->VoiceActivityIndicator(0)); + TEST_MUSTPASS(0 != voe_apm_->VoiceActivityIndicator(0)); #if !defined(WEBRTC_ANDROID) && !defined(MAC_IPHONE) TEST_MUSTPASS(0 != rxc._vadDecision); #endif - if (file) { + if (voe_file_) { TEST_LOG("Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone( 0, AudioFilename(), true, true)); } else { TEST_LOG("==> Make sure you talk into the microphone \n"); } - TEST_MUSTPASS(codec->SetVADStatus(0, false)); - TEST_MUSTPASS(volume->SetInputMute(0, false)); + TEST_MUSTPASS(voe_codec_->SetVADStatus(0, false)); + TEST_MUSTPASS(voe_volume_control_->SetInputMute(0, false)); SLEEP(500); // Sleep time selected by looking in mic play file, after // sleep we should have detected voice - TEST_MUSTPASS(1 != apm->VoiceActivityIndicator(0)); + TEST_MUSTPASS(1 != voe_apm_->VoiceActivityIndicator(0)); #if !defined(WEBRTC_ANDROID) && !defined(MAC_IPHONE) TEST_MUSTPASS(1 != rxc._vadDecision); TEST_LOG("Disabling RX VAD detection, make sure you see no " "detections\n"); - TEST_MUSTPASS(apm->DeRegisterRxVadObserver(0)); + TEST_MUSTPASS(voe_apm_->DeRegisterRxVadObserver(0)); SLEEP(2000); #endif } else { @@ -2846,25 +2903,25 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); //Stop the current file TEST_LOG("Stop playing file as microphone \n"); - TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); + TEST_MUSTPASS(voe_file_->StopPlayingFileAsMicrophone(0)); TEST_LOG("==> Talk into the microphone \n"); SLEEP(1000); TEST_LOG("Record mic for 3 seconds in PCM format\n"); - TEST_MUSTPASS(file->StartRecordingMicrophone(recName)); + TEST_MUSTPASS(voe_file_->StartRecordingMicrophone(recName)); SLEEP(3000); - TEST_MUSTPASS(file->StopRecordingMicrophone()); + TEST_MUSTPASS(voe_file_->StopRecordingMicrophone()); TEST_LOG("Play out the recorded file...\n"); - TEST_MUSTPASS(file->StartPlayingFileLocally(0, recName)); + TEST_MUSTPASS(voe_file_->StartPlayingFileLocally(0, recName)); SLEEP(2000); #ifndef _INSTRUMENTATION_TESTING_ TEST_LOG("After 2 seconds we should still be playing\n"); - TEST_MUSTPASS(!file->IsPlayingFileLocally(0)); + TEST_MUSTPASS(!voe_file_->IsPlayingFileLocally(0)); #endif TEST_LOG("Set scaling\n"); - TEST_MUSTPASS(file->ScaleLocalFilePlayout(0,(float)0.11)); + TEST_MUSTPASS(voe_file_->ScaleLocalFilePlayout(0,(float)0.11)); SLEEP(1100); TEST_LOG("After 3.1 seconds we should NOT be playing\n"); - TEST_MUSTPASS(file->IsPlayingFileLocally(0)); + TEST_MUSTPASS(voe_file_->IsPlayingFileLocally(0)); CodecInst codec; TEST_LOG("Record speaker for 3 seconds to wav file\n"); @@ -2875,48 +2932,48 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); codec.pacsize = 160; codec.pltype = 0; codec.rate = 64000; - TEST_MUSTPASS(file->StartRecordingPlayout(0,recName,&codec)); + TEST_MUSTPASS(voe_file_->StartRecordingPlayout(0,recName,&codec)); SLEEP(3000); - TEST_MUSTPASS(file->StopRecordingPlayout(0)); + TEST_MUSTPASS(voe_file_->StopRecordingPlayout(0)); TEST_LOG("Play file as mic, looping for 3 seconds\n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, recName, 1, 0, kFileFormatWavFile)); SLEEP(3000); TEST_LOG("After 3 seconds we should still be playing\n"); - TEST_MUSTPASS(!file->IsPlayingFileAsMicrophone(0)); + TEST_MUSTPASS(!voe_file_->IsPlayingFileAsMicrophone(0)); SLEEP(600); TEST_LOG("After 3.6 seconds we should still be playing\n"); - TEST_MUSTPASS(!file->IsPlayingFileAsMicrophone(0)); + TEST_MUSTPASS(!voe_file_->IsPlayingFileAsMicrophone(0)); TEST_LOG("Set scaling\n"); - TEST_MUSTPASS(file->ScaleFileAsMicrophonePlayout(0,(float)0.11)); + TEST_MUSTPASS(voe_file_->ScaleFileAsMicrophonePlayout(0,(float)0.11)); SLEEP(200); TEST_LOG("Stop playing file as microphone\n"); - TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); + TEST_MUSTPASS(voe_file_->StopPlayingFileAsMicrophone(0)); TEST_LOG("==> Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, AudioFilename(), + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); #else TEST_LOG("\n\n+++ File tests NOT ENABLED +++\n"); #endif // #ifdef _TEST_FILE_ #ifdef _XTENDED_TEST_FILE_ // Create unique trace files for this test - TEST_MUSTPASS(base->SetTraceFileName(GetFilename("VoEFile_trace.txt"))); - TEST_MUSTPASS(base->SetDebugTraceFileName(GetFilename( + TEST_MUSTPASS(voe_base_->SetTraceFileName(GetFilename("VoEFile_trace.txt"))); + TEST_MUSTPASS(voe_base_->SetDebugTraceFileName(GetFilename( "VoEFile_trace_debug.txt"))); // turn off default AGC during these tests - TEST_MUSTPASS(apm->SetAgcStatus(false)); - int res = xtend.TestFile(file); + TEST_MUSTPASS(voe_apm_->SetAgcStatus(false)); + int res = xtend.TestFile(voe_file_); #ifndef MAC_IPHONE - TEST_MUSTPASS(apm->SetAgcStatus(true)); // restore AGC state + TEST_MUSTPASS(voe_apm_->SetAgcStatus(true)); // restore AGC state #endif - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->Terminate()); return res; #endif @@ -2937,7 +2994,7 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); SLEEP(200); // Make sure we have received packets - TEST_MUSTPASS(netw->GetSourceInfo(0, + TEST_MUSTPASS(voe_network_->GetSourceInfo(0, sourceRtpPort, sourceRtcpPort, sourceIp)); @@ -2947,7 +3004,7 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_MUSTPASS(8000 != sourceRtpPort); TEST_MUSTPASS(8001 != sourceRtcpPort); - TEST_MUSTPASS(netw->GetSourceFilter(0, + TEST_MUSTPASS(voe_network_->GetSourceFilter(0, filterPort, filterPortRTCP, filterIp)); @@ -2956,11 +3013,11 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_MUSTPASS(_stricmp(filterIp, "")); TEST_LOG("Set filter port to %d => should hear audio\n", sourceRtpPort); - TEST_MUSTPASS(netw->SetSourceFilter(0, + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, sourceRtpPort, sourceRtcpPort, "0.0.0.0")); - TEST_MUSTPASS(netw->GetSourceFilter(0, + TEST_MUSTPASS(voe_network_->GetSourceFilter(0, filterPort, filterPortRTCP, filterIp)); @@ -2970,66 +3027,69 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); SLEEP(1000); TEST_LOG("Set filter port to %d => should *not* hear audio\n", sourceRtpPort + 10); - TEST_MUSTPASS(netw->SetSourceFilter(0, sourceRtpPort+10)); - TEST_MUSTPASS(netw->GetSourceFilter(0, + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, sourceRtpPort+10)); + TEST_MUSTPASS(voe_network_->GetSourceFilter(0, filterPort, filterPortRTCP, filterIp)); TEST_MUSTPASS(sourceRtpPort+10 != filterPort); SLEEP(1000); TEST_LOG("Disable port filter => should hear audio again\n"); - TEST_MUSTPASS(netw->SetSourceFilter(0, 0)); + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, 0)); SLEEP(1000); - if (rtp_rtcp) { - TEST_MUSTPASS(rtp_rtcp->SetRTCP_CNAME(0, "Tomas")); + if (voe_rtp_rtcp_) { + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTCP_CNAME(0, "Tomas")); } TEST_LOG("Set filter IP to %s => should hear audio\n", sourceIp); - TEST_MUSTPASS(netw->SetSourceFilter(0, 0, sourceRtcpPort+10, sourceIp)); - TEST_MUSTPASS(netw->GetSourceFilter(0, + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, 0, sourceRtcpPort+10, + sourceIp)); + TEST_MUSTPASS(voe_network_->GetSourceFilter(0, filterPort, filterPortRTCP, filterIp)); TEST_MUSTPASS(_stricmp(filterIp, sourceIp)); SLEEP(1000); TEST_LOG("Set filter IP to 10.10.10.10 => should *not* hear audio\n"); - TEST_MUSTPASS(netw->SetSourceFilter(0, 0, sourceRtcpPort+10, + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, 0, sourceRtcpPort+10, "10.10.10.10")); - TEST_MUSTPASS(netw->GetSourceFilter(0, filterPort, filterPort, filterIp)); + TEST_MUSTPASS(voe_network_->GetSourceFilter(0, filterPort, filterPort, + filterIp)); TEST_MUSTPASS(_stricmp(filterIp, "10.10.10.10")); SLEEP(1000); TEST_LOG("Disable IP filter => should hear audio again\n"); - TEST_MUSTPASS(netw->SetSourceFilter(0, 0, sourceRtcpPort+10, "0.0.0.0")); + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, 0, sourceRtcpPort+10, + "0.0.0.0")); SLEEP(1000); TEST_LOG("Set filter IP to 10.10.10.10 => should *not* hear audio\n"); - TEST_MUSTPASS(netw->SetSourceFilter(0, 0, sourceRtcpPort+10, + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, 0, sourceRtcpPort+10, "10.10.10.10")); SLEEP(1000); - if (rtp_rtcp) { + if (voe_rtp_rtcp_) { char tmpStr[64]; SLEEP(2000); TEST_LOG("Checking RTCP port filter with CNAME...\n"); - TEST_MUSTPASS(rtp_rtcp->GetRemoteRTCP_CNAME(0, tmpStr)); + TEST_MUSTPASS(voe_rtp_rtcp_->GetRemoteRTCP_CNAME(0, tmpStr)); TEST_MUSTPASS(!_stricmp("Tomas", tmpStr)); - TEST_MUSTPASS(rtp_rtcp->SetRTCP_CNAME(0, "Niklas")); + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTCP_CNAME(0, "Niklas")); } else { TEST_LOG("Skipping RTCP port filter test since there is no RTP/RTCP " "interface!\n"); } TEST_LOG("Disable IP filter => should hear audio again\n"); - TEST_MUSTPASS(netw->SetSourceFilter(0, 0, 0, NULL)); - TEST_MUSTPASS(netw->GetSourceFilter(0, filterPort, filterPortRTCP, + TEST_MUSTPASS(voe_network_->SetSourceFilter(0, 0, 0, NULL)); + TEST_MUSTPASS(voe_network_->GetSourceFilter(0, filterPort, filterPortRTCP, filterIp)); TEST_MUSTPASS(_stricmp(filterIp, "")); SLEEP(1000); TEST_LOG("Wait 2 seconds for packet timeout...\n"); TEST_LOG("You should see runtime error %d\n", VE_RECEIVE_PACKET_TIMEOUT); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(netw->SetPacketTimeoutNotification(0, true, 2)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_network_->SetPacketTimeoutNotification(0, true, 2)); SLEEP(3000); #if !defined(_INSTRUMENTATION_TESTING_) @@ -3037,10 +3097,10 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_MUSTPASS(obs.code != VE_RECEIVE_PACKET_TIMEOUT); #endif obs.code = -1; - TEST_MUSTPASS(base->StartSend(0)); - if (file) { + TEST_MUSTPASS(voe_base_->StartSend(0)); + if (voe_file_) { TEST_LOG("Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); @@ -3053,18 +3113,18 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #if !defined(_INSTRUMENTATION_TESTING_) TEST_LOG("Disabling observer, no runtime error should be seen...\n"); - TEST_MUSTPASS(base->DeRegisterVoiceEngineObserver()); + TEST_MUSTPASS(voe_base_->DeRegisterVoiceEngineObserver()); obs.code = -1; - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(netw->SetPacketTimeoutNotification(0, true, 2)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_network_->SetPacketTimeoutNotification(0, true, 2)); SLEEP(2500); TEST_MUSTPASS(obs.code != -1); // disable notifications to avoid additional 8082 callbacks - TEST_MUSTPASS(netw->SetPacketTimeoutNotification(0, false, 2)); - TEST_MUSTPASS(base->StartSend(0)); - if (file) { + TEST_MUSTPASS(voe_network_->SetPacketTimeoutNotification(0, false, 2)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + if (voe_file_) { TEST_LOG("Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); @@ -3072,22 +3132,22 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); SLEEP(1000); /// TEST_MUSTPASS(obs.code != -1); TEST_LOG("Enabling observer again\n"); - TEST_MUSTPASS(base->RegisterVoiceEngineObserver(obs)); + TEST_MUSTPASS(voe_base_->RegisterVoiceEngineObserver(obs)); #endif TEST_LOG("Enable dead-or-alive callbacks for 4 seconds (dT=1sec)...\n"); TEST_LOG("You should see ALIVE messages\n"); MyDeadOrAlive obs; - TEST_MUSTPASS(netw->RegisterDeadOrAliveObserver(0, obs)); - TEST_MUSTPASS(netw->SetPeriodicDeadOrAliveStatus(0, true, 1)); + TEST_MUSTPASS(voe_network_->RegisterDeadOrAliveObserver(0, obs)); + TEST_MUSTPASS(voe_network_->SetPeriodicDeadOrAliveStatus(0, true, 1)); SLEEP(4000); // stop sending and flush dead-or-alive states - if (rtp_rtcp) { - TEST_MUSTPASS(rtp_rtcp->SetRTCPStatus(0, false)); + if (voe_rtp_rtcp_) { + TEST_MUSTPASS(voe_rtp_rtcp_->SetRTCPStatus(0, false)); } - TEST_MUSTPASS(base->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); SLEEP(500); TEST_LOG("Disable sending for 4 seconds (dT=1sec)...\n"); @@ -3095,25 +3155,25 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); " sneak in if you are unlucky)\n"); SLEEP(4000); TEST_LOG("Disable dead-or-alive callbacks.\n"); - TEST_MUSTPASS(netw->SetPeriodicDeadOrAliveStatus(0, false)); + TEST_MUSTPASS(voe_network_->SetPeriodicDeadOrAliveStatus(0, false)); TEST_LOG("Enabling external transport\n"); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); // recreate the channel to ensure that we can switch from transport // to external transport - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->CreateChannel()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->CreateChannel()); - TEST_MUSTPASS(netw->RegisterExternalTransport(0, ch0transport)); + TEST_MUSTPASS(voe_network_->RegisterExternalTransport(0, channel0_transport)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - if (file) { + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + if (voe_file_) { TEST_LOG("Start playing a file as microphone again using" " external transport\n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); @@ -3121,21 +3181,21 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); SLEEP(4000); TEST_LOG("Disabling external transport\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); - TEST_MUSTPASS(netw->DeRegisterExternalTransport(0)); + TEST_MUSTPASS(voe_network_->DeRegisterExternalTransport(0)); - TEST_MUSTPASS(base->SetSendDestination(0, 8000, "127.0.0.1")); - TEST_MUSTPASS(base->SetLocalReceiver(0, 8000)); + TEST_MUSTPASS(voe_base_->SetSendDestination(0, 8000, "127.0.0.1")); + TEST_MUSTPASS(voe_base_->SetLocalReceiver(0, 8000)); - TEST_MUSTPASS(base->StartReceive(0)); - TEST_MUSTPASS(base->StartSend(0)); - TEST_MUSTPASS(base->StartPlayout(0)); - if (file) { + TEST_MUSTPASS(voe_base_->StartReceive(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + if (voe_file_) { TEST_LOG("Start playing a file as microphone again using transport\n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); @@ -3155,54 +3215,55 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("\n\n+++ CallReport tests +++\n\n"); #if (defined(WEBRTC_VOICE_ENGINE_ECHO) && defined(WEBRTC_VOICE_ENGINE_NR)) TEST(ResetCallReportStatistics);ANL(); - TEST_MUSTPASS(!report->ResetCallReportStatistics(-2)); - TEST_MUSTPASS(!report->ResetCallReportStatistics(1)); - TEST_MUSTPASS(report->ResetCallReportStatistics(0)); - TEST_MUSTPASS(report->ResetCallReportStatistics(-1)); + TEST_MUSTPASS(!voe_call_report_->ResetCallReportStatistics(-2)); + TEST_MUSTPASS(!voe_call_report_->ResetCallReportStatistics(1)); + TEST_MUSTPASS(voe_call_report_->ResetCallReportStatistics(0)); + TEST_MUSTPASS(voe_call_report_->ResetCallReportStatistics(-1)); bool onOff; - TEST_MUSTPASS(apm->GetEcMetricsStatus(onOff)); + TEST_MUSTPASS(voe_apm_->GetEcMetricsStatus(onOff)); TEST_MUSTPASS(onOff != false); - TEST_MUSTPASS(apm->SetEcMetricsStatus(true)); + TEST_MUSTPASS(voe_apm_->SetEcMetricsStatus(true)); SLEEP(3000); EchoStatistics echo; TEST(GetEchoMetricSummary);ANL(); // all outputs will be -100 in loopback (skip further tests) - TEST_MUSTPASS(report->GetEchoMetricSummary(echo)); + TEST_MUSTPASS(voe_call_report_->GetEchoMetricSummary(echo)); StatVal delays; TEST(GetRoundTripTimeSummary);ANL(); - rtp_rtcp->SetRTCPStatus(0, false); + voe_rtp_rtcp_->SetRTCPStatus(0, false); // All values should be -1 since RTCP is off - TEST_MUSTPASS(report->GetRoundTripTimeSummary(0, delays)); + TEST_MUSTPASS(voe_call_report_->GetRoundTripTimeSummary(0, delays)); TEST_MUSTPASS(delays.min != -1); TEST_MUSTPASS(delays.max != -1); TEST_MUSTPASS(delays.average != -1); - rtp_rtcp->SetRTCPStatus(0, true); + voe_rtp_rtcp_->SetRTCPStatus(0, true); SLEEP(5000); // gives time for RTCP - TEST_MUSTPASS(report->GetRoundTripTimeSummary(0, delays)); + TEST_MUSTPASS(voe_call_report_->GetRoundTripTimeSummary(0, delays)); TEST_MUSTPASS(delays.min == -1); TEST_MUSTPASS(delays.max == -1); TEST_MUSTPASS(delays.average == -1); - rtp_rtcp->SetRTCPStatus(0, false); + voe_rtp_rtcp_->SetRTCPStatus(0, false); int nDead = 0; int nAlive = 0; // -1 will be returned since dead-or-alive is not active TEST(GetDeadOrAliveSummary);ANL(); - TEST_MUSTPASS(report->GetDeadOrAliveSummary(0, nDead, nAlive) != -1); + TEST_MUSTPASS(voe_call_report_->GetDeadOrAliveSummary(0, nDead, + nAlive) != -1); // we don't need these callbacks any longer - TEST_MUSTPASS(netw->DeRegisterDeadOrAliveObserver(0)); - TEST_MUSTPASS(netw->SetPeriodicDeadOrAliveStatus(0, true, 1)); + TEST_MUSTPASS(voe_network_->DeRegisterDeadOrAliveObserver(0)); + TEST_MUSTPASS(voe_network_->SetPeriodicDeadOrAliveStatus(0, true, 1)); SLEEP(2000); // All results should be >= 0 since dead-or-alive is active - TEST_MUSTPASS(report->GetDeadOrAliveSummary(0, nDead, nAlive)); + TEST_MUSTPASS(voe_call_report_->GetDeadOrAliveSummary(0, nDead, nAlive)); TEST_MUSTPASS(nDead == -1);TEST_MUSTPASS(nAlive == -1) - TEST_MUSTPASS(netw->SetPeriodicDeadOrAliveStatus(0, false)); + TEST_MUSTPASS(voe_network_->SetPeriodicDeadOrAliveStatus(0, false)); TEST(WriteReportToFile);ANL(); - TEST_MUSTPASS(!report->WriteReportToFile(NULL)); - TEST_MUSTPASS(report->WriteReportToFile("call_report.txt")); + TEST_MUSTPASS(!voe_call_report_->WriteReportToFile(NULL)); + TEST_MUSTPASS(voe_call_report_->WriteReportToFile("call_report.txt")); #else TEST_LOG("Skipping CallReport tests since both EC and NS are required\n"); #endif @@ -3216,19 +3277,19 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("\n\n+++ Video sync tests +++\n\n"); unsigned int val; - TEST_MUSTPASS(vsync->GetPlayoutTimestamp(0, val)); + TEST_MUSTPASS(voe_vsync_->GetPlayoutTimestamp(0, val)); TEST_LOG("Playout timestamp = %lu\n", (long unsigned int) val); TEST_LOG("Init timestamp and sequence number manually\n"); - TEST_MUSTPASS(!vsync->SetInitTimestamp(0, 12345)); - TEST_MUSTPASS(!vsync->SetInitSequenceNumber(0, 123)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(vsync->SetInitTimestamp(0, 12345)); - TEST_MUSTPASS(vsync->SetInitSequenceNumber(0, 123)); - TEST_MUSTPASS(base->StartSend(0)); - if (file) { + TEST_MUSTPASS(!voe_vsync_->SetInitTimestamp(0, 12345)); + TEST_MUSTPASS(!voe_vsync_->SetInitSequenceNumber(0, 123)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_vsync_->SetInitTimestamp(0, 12345)); + TEST_MUSTPASS(voe_vsync_->SetInitSequenceNumber(0, 123)); + TEST_MUSTPASS(voe_base_->StartSend(0)); + if (voe_file_) { TEST_LOG("Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); @@ -3239,7 +3300,7 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); "they stabilize during this time\n"); int valInt = -1; for (int i = 0; i < 15; i++) { - TEST_MUSTPASS(vsync->GetDelayEstimate(0, valInt)); + TEST_MUSTPASS(voe_vsync_->GetDelayEstimate(0, valInt)); TEST_LOG("Delay estimate = %d ms\n", valInt); #if defined(MAC_IPHONE) TEST_MUSTPASS(valInt <= 30); @@ -3251,9 +3312,9 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("Setting NetEQ min delay to 500 milliseconds and repeat " "the test above\n"); - TEST_MUSTPASS(vsync->SetMinimumPlayoutDelay(0, 500)); + TEST_MUSTPASS(voe_vsync_->SetMinimumPlayoutDelay(0, 500)); for (int i = 0; i < 15; i++) { - TEST_MUSTPASS(vsync->GetDelayEstimate(0, valInt)); + TEST_MUSTPASS(voe_vsync_->GetDelayEstimate(0, valInt)); TEST_LOG("Delay estimate = %d ms\n", valInt); TEST_MUSTPASS(valInt <= 45); SLEEP(1000); @@ -3261,9 +3322,9 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("Setting NetEQ min delay to 0 milliseconds and repeat" " the test above\n"); - TEST_MUSTPASS(vsync->SetMinimumPlayoutDelay(0, 0)); + TEST_MUSTPASS(voe_vsync_->SetMinimumPlayoutDelay(0, 0)); for (int i = 0; i < 15; i++) { - TEST_MUSTPASS(vsync->GetDelayEstimate(0, valInt)); + TEST_MUSTPASS(voe_vsync_->GetDelayEstimate(0, valInt)); TEST_LOG("Delay estimate = %d ms\n", valInt); TEST_MUSTPASS(valInt <= 45); SLEEP(1000); @@ -3271,7 +3332,7 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #if (defined (_WIN32) || (defined(WEBRTC_LINUX)) && !defined(WEBRTC_ANDROID)) valInt = -1; - TEST_MUSTPASS(vsync->GetPlayoutBufferSize(valInt)); + TEST_MUSTPASS(voe_vsync_->GetPlayoutBufferSize(valInt)); TEST_LOG("Soundcard buffer size = %d ms\n", valInt); #endif #else @@ -3291,12 +3352,12 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("Enable SRTP encryption and decryption, you should still hear" " the voice\n"); - TEST_MUSTPASS(encrypt->EnableSRTPSend(0, + TEST_MUSTPASS(voe_encrypt_->EnableSRTPSend(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, encrKey)); - TEST_MUSTPASS(encrypt->EnableSRTPReceive(0, + TEST_MUSTPASS(voe_encrypt_->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, @@ -3304,11 +3365,11 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); SLEEP(2000); TEST_LOG("Disabling decryption, you should hear nothing or garbage\n"); - TEST_MUSTPASS(encrypt->DisableSRTPReceive(0)); + TEST_MUSTPASS(voe_encrypt_->DisableSRTPReceive(0)); SLEEP(2000); TEST_LOG("Enable decryption again, you should hear the voice again\n"); - TEST_MUSTPASS(encrypt->EnableSRTPReceive(0, + TEST_MUSTPASS(voe_encrypt_->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, @@ -3317,22 +3378,22 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("Disabling encryption and enabling decryption, you should" " hear nothing\n"); - TEST_MUSTPASS(encrypt->DisableSRTPSend(0)); + TEST_MUSTPASS(voe_encrypt_->DisableSRTPSend(0)); SLEEP(2000); TEST_LOG("Back to normal\n"); // both SRTP sides are now inactive - TEST_MUSTPASS(encrypt->DisableSRTPReceive(0)); + TEST_MUSTPASS(voe_encrypt_->DisableSRTPReceive(0)); SLEEP(2000); TEST_LOG("Enable SRTP and SRTCP encryption and decryption," " you should still hear the voice\n"); - TEST_MUSTPASS(encrypt->EnableSRTPSend(0, + TEST_MUSTPASS(voe_encrypt_->EnableSRTPSend(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, 20, 4, kEncryptionAndAuthentication, encrKey, true)); - TEST_MUSTPASS(encrypt->EnableSRTPReceive(0, + TEST_MUSTPASS(voe_encrypt_->EnableSRTPReceive(0, kCipherAes128CounterMode, 30, kAuthHmacSha1, @@ -3340,9 +3401,9 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); SLEEP(2000); TEST_LOG("Back to normal\n"); - TEST_MUSTPASS(encrypt->DisableSRTPSend(0)); + TEST_MUSTPASS(voe_encrypt_->DisableSRTPSend(0)); // both SRTP sides are now inactive - TEST_MUSTPASS(encrypt->DisableSRTPReceive(0)); + TEST_MUSTPASS(voe_encrypt_->DisableSRTPReceive(0)); SLEEP(2000); #else @@ -3350,11 +3411,11 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #endif // #ifdef WEBRTC_SRTP TEST_LOG("\nExternal encryption tests:\n"); my_encryption * encObj = new my_encryption; - TEST_MUSTPASS(encrypt->RegisterExternalEncryption(0, *encObj)); + TEST_MUSTPASS(voe_encrypt_->RegisterExternalEncryption(0, *encObj)); TEST_LOG("Encryption enabled but you should still hear the voice\n"); SLEEP(2000); TEST_LOG("Removing encryption object and deleting it\n"); - TEST_MUSTPASS(encrypt->DeRegisterExternalEncryption(0)); + TEST_MUSTPASS(voe_encrypt_->DeRegisterExternalEncryption(0)); delete encObj; SLEEP(2000); #else @@ -3369,20 +3430,20 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #ifdef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT TEST_LOG("Stop playing file as microphone \n"); TEST_LOG("==> Talk into the microphone \n"); - TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); + TEST_MUSTPASS(voe_file_->StopPlayingFileAsMicrophone(0)); TEST_LOG("Enabling external playout\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(xmedia->SetExternalPlayoutStatus(true)); - TEST_MUSTPASS(base->StartPlayout(0)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_xmedia_->SetExternalPlayoutStatus(true)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("Writing 2 secs of play data to vector\n"); int getLen; WebRtc_Word16 speechData[32000]; for (int i = 0; i < 200; i++) { - TEST_MUSTPASS(xmedia->ExternalPlayoutGetData(speechData+i*160, + TEST_MUSTPASS(voe_xmedia_->ExternalPlayoutGetData(speechData+i*160, 16000, 100, getLen)); @@ -3391,18 +3452,18 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); } TEST_LOG("Disabling external playout\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(xmedia->SetExternalPlayoutStatus(false)); - TEST_MUSTPASS(base->StartPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_xmedia_->SetExternalPlayoutStatus(false)); + TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_LOG("Enabling external recording\n"); - TEST_MUSTPASS(xmedia->SetExternalRecordingStatus(true)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_xmedia_->SetExternalRecordingStatus(true)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("Inserting record data from vector\n"); for (int i = 0; i < 200; i++) { - TEST_MUSTPASS(xmedia->ExternalRecordingInsertData(speechData+i*160, + TEST_MUSTPASS(voe_xmedia_->ExternalRecordingInsertData(speechData+i*160, 160, 16000, 20)); @@ -3410,12 +3471,12 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); } TEST_LOG("Disabling external recording\n"); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(xmedia->SetExternalRecordingStatus(false)); - TEST_MUSTPASS(base->StartSend(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_xmedia_->SetExternalRecordingStatus(false)); + TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("==> Start playing a file as microphone again \n"); - TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(0, AudioFilename(), + TEST_MUSTPASS(voe_file_->StartPlayingFileAsMicrophone(0, AudioFilename(), true, true)); #else TEST_LOG("Skipping external rec and playout tests - \ @@ -3423,31 +3484,31 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #endif // WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT TEST_LOG("Enabling playout external media processing => " "played audio should now be affected \n"); - TEST_MUSTPASS(xmedia->RegisterExternalMediaProcessing( + TEST_MUSTPASS(voe_xmedia_->RegisterExternalMediaProcessing( -1, kPlaybackAllChannelsMixed, mobj)); SLEEP(2000); TEST_LOG("Back to normal again \n"); - TEST_MUSTPASS(xmedia->DeRegisterExternalMediaProcessing( + TEST_MUSTPASS(voe_xmedia_->DeRegisterExternalMediaProcessing( -1, kPlaybackAllChannelsMixed)); SLEEP(2000); // Note that we must do per channel here because PlayFileAsMicrophone // is only done on ch 0. TEST_LOG("Enabling recording external media processing => " "played audio should now be affected \n"); - TEST_MUSTPASS(xmedia->RegisterExternalMediaProcessing( + TEST_MUSTPASS(voe_xmedia_->RegisterExternalMediaProcessing( 0, kRecordingPerChannel, mobj)); SLEEP(2000); TEST_LOG("Back to normal again \n"); - TEST_MUSTPASS(xmedia->DeRegisterExternalMediaProcessing( + TEST_MUSTPASS(voe_xmedia_->DeRegisterExternalMediaProcessing( 0, kRecordingPerChannel)); SLEEP(2000); TEST_LOG("Enabling recording external media processing => " "speak and make sure that voice is affected \n"); - TEST_MUSTPASS(xmedia->RegisterExternalMediaProcessing( + TEST_MUSTPASS(voe_xmedia_->RegisterExternalMediaProcessing( -1, kRecordingAllChannelsMixed, mobj)); SLEEP(2000); TEST_LOG("Back to normal again \n"); - TEST_MUSTPASS(xmedia->DeRegisterExternalMediaProcessing( + TEST_MUSTPASS(voe_xmedia_->DeRegisterExternalMediaProcessing( -1, kRecordingAllChannelsMixed)); SLEEP(2000); #else @@ -3461,7 +3522,7 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API NetworkStatistics nStats; - TEST_MUSTPASS(neteqst->GetNetworkStatistics(0, nStats)); + TEST_MUSTPASS(voe_neteq_stats_->GetNetworkStatistics(0, nStats)); TEST_LOG("\nNetwork statistics: \n"); TEST_LOG(" currentAccelerateRate = %hu \n", nStats.currentAccelerateRate); @@ -3489,14 +3550,14 @@ TEST_MUSTPASS(codec->SetSendCodec(0, ci)); TEST_LOG("\n\n+++ Stop streaming +++\n\n"); TEST_LOG("Stop playout, sending and listening \n"); - TEST_MUSTPASS(base->StopPlayout(0)); - TEST_MUSTPASS(base->StopSend(0)); - TEST_MUSTPASS(base->StopReceive(0)); + TEST_MUSTPASS(voe_base_->StopPlayout(0)); + TEST_MUSTPASS(voe_base_->StopSend(0)); + TEST_MUSTPASS(voe_base_->StopReceive(0)); // Exit: TEST_LOG("Delete channel and terminate VE \n"); - TEST_MUSTPASS(base->DeleteChannel(0)); - TEST_MUSTPASS(base->Terminate()); + TEST_MUSTPASS(voe_base_->DeleteChannel(0)); + TEST_MUSTPASS(voe_base_->Terminate()); return 0; } @@ -3645,7 +3706,7 @@ void createSummary(VoiceEngine* ve) { strcat(summaryFilename, "/summary.txt"); #endif - VoEBase* base = VoEBase::GetInterface(ve); + VoEBase* voe_base_ = VoEBase::GetInterface(ve); FILE* stream = fopen(summaryFilename, "wt"); sprintf(str, "WebRTc VoiceEngine "); @@ -3672,7 +3733,7 @@ void createSummary(VoiceEngine* ve) { char version[1024]; char veVersion[24]; - base->GetVersion(version); + voe_base_->GetVersion(version); // find first NL <=> end of VoiceEngine version string int pos = (int) strcspn(version, "\n"); strncpy(veVersion, version, pos); @@ -3875,7 +3936,7 @@ void createSummary(VoiceEngine* ve) { #endif fclose(stream); - base->Release(); + voe_base_->Release(); } /*********Knowledge Base******************/ @@ -3888,7 +3949,7 @@ class ThreadTest { public: ThreadTest( - VoEBase* base); + VoEBase* voe_base_); ~ThreadTest() { delete _myThread; @@ -3907,10 +3968,10 @@ private: //Main function from where StartSend is invoked as a seperate thread. ThreadTest::ThreadTest( - VoEBase* base) + VoEBase* voe_base_) : _stopped(false), -_base(base) +_base(voe_base_) { //Thread Creation _myThread = ThreadWrapper::CreateThread(StartSend, this, kLowPriority); @@ -3941,7 +4002,7 @@ void ThreadTest::Stop() } // Use the following to invoke ThreatTest from the main function. -// ThreadTest* threadtest = new ThreadTest(base); +// ThreadTest* threadtest = new ThreadTest(voe_base_); #endif // An example to create a thread and call VE API's call from that thread. @@ -3963,9 +4024,9 @@ unsigned int WINAPI mainTest::StartSend(void *obj) unsigned int WINAPI mainTest::StartSend() { //base - base->StartSend(0); + voe_base_->StartSend(0); - // TEST_MUSTPASS(base->StartSend(0)); + // TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_LOG("hi hi hi"); return 0; } diff --git a/src/voice_engine/main/test/auto_test/voe_standard_test.h b/src/voice_engine/main/test/auto_test/voe_standard_test.h index becf6afd12..eeaf842cb9 100644 --- a/src/voice_engine/main/test/auto_test/voe_standard_test.h +++ b/src/voice_engine/main/test/auto_test/voe_standard_test.h @@ -273,88 +273,101 @@ class VoETestManager { int DoStandardTest(); const char* AudioFilename() const { - return audioFilename_.c_str(); + return audio_filename_.c_str(); } VoiceEngine* VoiceEnginePtr() const { - return ve; + return voice_engine_; } VoEBase* BasePtr() const { - return base; + return voe_base_; } VoECodec* CodecPtr() const { - return codec; + return voe_codec_; } VoEVolumeControl* VolumeControlPtr() const { - return volume; + return voe_volume_control_; } VoEDtmf* DtmfPtr() const { - return dtmf; + return voe_dtmf_; } VoERTP_RTCP* RTP_RTCPPtr() const { - return rtp_rtcp; + return voe_rtp_rtcp_; } VoEAudioProcessing* APMPtr() const { - return apm; + return voe_apm_; } VoENetwork* NetworkPtr() const { - return netw; + return voe_network_; } VoEFile* FilePtr() const { - return file; + return voe_file_; } VoEHardware* HardwarePtr() const { - return hardware; + return voe_hardware_; } VoEVideoSync* VideoSyncPtr() const { - return vsync; + return voe_vsync_; } VoEEncryption* EncryptionPtr() const { - return encrypt; + return voe_encrypt_; } VoEExternalMedia* ExternalMediaPtr() const { - return xmedia; + return voe_xmedia_; } VoECallReport* CallReportPtr() const { - return report; + return voe_call_report_; } #ifdef _TEST_NETEQ_STATS_ VoENetEqStats* NetEqStatsPtr() const { - return neteqst; + return voe_neteq_stats_; } #endif private: - bool initialized_; - VoiceEngine* ve; - VoEBase* base; - VoECallReport* report; - VoECodec* codec; - VoEDtmf* dtmf; - VoEEncryption* encrypt; - VoEExternalMedia* xmedia; - VoEFile* file; - VoEHardware* hardware; + int TestTraceApi(); + int TestHardwareBeforeInitializing(); + int SetUp(); + int TestRtpRtcpBeforeStreaming(); + int TestHardwareBeforeStreaming(); + int TestCodecsBeforeStreaming(); + int TestNetworkBeforeStreaming(); + int TestStartStreaming(FakeExternalTransport& channel0_transport); + int TestStartPlaying(); + int TestHoldAndNetEq(); + int TestCodecs(); + + bool initialized_; + + VoiceEngine* voice_engine_; + VoEBase* voe_base_; + VoECallReport* voe_call_report_; + VoECodec* voe_codec_; + VoEDtmf* voe_dtmf_; + VoEEncryption* voe_encrypt_; + VoEExternalMedia* voe_xmedia_; + VoEFile* voe_file_; + VoEHardware* voe_hardware_; + VoENetwork* voe_network_; #ifdef _TEST_NETEQ_STATS_ - VoENetEqStats* neteqst; + VoENetEqStats* voe_neteq_stats_; #endif - VoENetwork* netw; - VoERTP_RTCP* rtp_rtcp; - VoEVideoSync* vsync; - VoEVolumeControl* volume; - VoEAudioProcessing* apm; - int instanceCount; - std::string resourcePath_; - std::string audioFilename_; + VoERTP_RTCP* voe_rtp_rtcp_; + VoEVideoSync* voe_vsync_; + VoEVolumeControl* voe_volume_control_; + VoEAudioProcessing* voe_apm_; + + std::string resource_path_; + std::string audio_filename_; }; } // namespace voetest diff --git a/src/voice_engine/main/test/auto_test/voe_test_defines.h b/src/voice_engine/main/test/auto_test/voe_test_defines.h index bc438de49d..cb31a416a9 100644 --- a/src/voice_engine/main/test/auto_test/voe_test_defines.h +++ b/src/voice_engine/main/test/auto_test/voe_test_defines.h @@ -136,16 +136,16 @@ if ((expr)) \ { \ TEST_LOG_ERROR("Error at line:%i, %s \n",__LINE__, #expr); \ - TEST_LOG_ERROR("Error code: %i\n",base->LastError()); \ + TEST_LOG_ERROR("Error code: %i\n",voe_base_->LastError()); \ } \ } #define TEST_ERROR(code) \ { \ - int err = base->LastError(); \ + int err = voe_base_->LastError(); \ if (err != code) \ { \ TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n", -code, err, __LINE__); + code, err, __LINE__); } } #else @@ -157,20 +157,21 @@ code, err, __LINE__); if ((expr)) \ { \ TEST_LOG_ERROR("\nError at line:%i, %s \n",__LINE__, #expr); \ - TEST_LOG_ERROR("Error code: %i\n",base->LastError()); \ + TEST_LOG_ERROR("Error code: %i\n", voe_base_->LastError()); \ PAUSE \ - return -1; \ + return -1; \ } \ } -#define TEST_ERROR(code) \ - { \ - int err = base->LastError(); \ - if (err != code) \ - { \ - TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n", err, code, __LINE__); \ - PAUSE \ - return -1; \ - } \ +#define TEST_ERROR(code) \ + { \ + int err = voe_base_->LastError(); \ + if (err != code) \ + { \ + TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n", \ + err, code, __LINE__); \ + PAUSE \ + return -1; \ + } \ } #endif // #ifdef _INSTRUMENTATION_TESTING_ #define EXCLUDE() \ diff --git a/src/voice_engine/main/test/auto_test/voe_test_interface.h b/src/voice_engine/main/test/auto_test/voe_test_interface.h index 8767339398..87b37a4583 100644 --- a/src/voice_engine/main/test/auto_test/voe_test_interface.h +++ b/src/voice_engine/main/test/auto_test/voe_test_interface.h @@ -59,11 +59,11 @@ enum ExtendedSelection { // External transport (Transport) // ---------------------------------------------------------------------------- -class my_transportation : public Transport { +class FakeExternalTransport : public Transport { public: - my_transportation(VoENetwork* ptr); - virtual ~my_transportation(); - VoENetwork* myNetw; + FakeExternalTransport(VoENetwork* ptr); + virtual ~FakeExternalTransport(); + VoENetwork* my_network_; int SendPacket(int channel, const void *data, int len); int SendRTCPPacket(int channel, const void *data, int len); void SetDelayStatus(bool enabled, unsigned int delayInMs = 100); @@ -71,15 +71,15 @@ class my_transportation : public Transport { static bool Run(void* ptr); bool Process(); private: - ThreadWrapper* _thread; - CriticalSectionWrapper* _lock; - EventWrapper* _event; + ThreadWrapper* thread_; + CriticalSectionWrapper* lock_; + EventWrapper* event_; private: - unsigned char _packetBuffer[1612]; - int _length; - int _channel; - bool _delayIsEnabled; - int _delayTimeInMs; + unsigned char packet_buffer_[1612]; + int length_; + int channel_; + bool delay_is_enabled_; + int delay_time_in_ms_; }; // Main test function