Further cleaned up voe_standard_test.

BUG=
TEST=

Review URL: https://webrtc-codereview.appspot.com/522003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2157 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2012-05-02 07:32:37 +00:00
parent dbb7f91f36
commit 719dba7e79
16 changed files with 443 additions and 584 deletions

View File

@ -0,0 +1,98 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "system_wrappers/interface/critical_section_wrapper.h"
#include "system_wrappers/interface/event_wrapper.h"
#include "system_wrappers/interface/thread_wrapper.h"
#include "voice_engine/main/interface/voe_network.h"
#include "voice_engine/main/source/voice_engine_defines.h"
#include "voice_engine/main/test/auto_test/fakes/fake_external_transport.h"
FakeExternalTransport::FakeExternalTransport(webrtc::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* thread_name = "external_thread";
lock_ = webrtc::CriticalSectionWrapper::CreateCriticalSection();
event_ = webrtc::EventWrapper::Create();
thread_ = webrtc::ThreadWrapper::CreateThread(
Run, this, webrtc::kHighPriority, thread_name);
if (thread_) {
unsigned int id;
thread_->Start(id);
}
}
FakeExternalTransport::~FakeExternalTransport() {
if (thread_) {
thread_->SetNotAlive();
event_->Set();
if (thread_->Stop()) {
delete thread_;
thread_ = NULL;
delete event_;
event_ = NULL;
delete lock_;
lock_ = NULL;
}
}
}
bool FakeExternalTransport::Run(void* ptr) {
return static_cast<FakeExternalTransport*> (ptr)->Process();
}
bool FakeExternalTransport::Process() {
switch (event_->Wait(500)) {
case webrtc::kEventSignaled:
lock_->Enter();
my_network_->ReceivedRTPPacket(channel_, packet_buffer_, length_);
lock_->Leave();
return true;
case webrtc::kEventTimeout:
return true;
case webrtc::kEventError:
break;
}
return true;
}
int FakeExternalTransport::SendPacket(int channel, const void *data, int len) {
lock_->Enter();
if (len < 1612) {
memcpy(packet_buffer_, (const unsigned char*) data, len);
length_ = len;
channel_ = channel;
}
lock_->Leave();
event_->Set(); // Triggers ReceivedRTPPacket() from worker thread.
return len;
}
int FakeExternalTransport::SendRTCPPacket(int channel,
const void *data,
int len) {
if (delay_is_enabled_) {
Sleep(delay_time_in_ms_);
}
my_network_->ReceivedRTCPPacket(channel, data, len);
return len;
}
void FakeExternalTransport::SetDelayStatus(bool enable,
unsigned int delayInMs) {
delay_is_enabled_ = enable;
delay_time_in_ms_ = delayInMs;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKES_FAKE_EXTERNAL_TRANSPORT_H_
#define VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKES_FAKE_EXTERNAL_TRANSPORT_H_
#include "common_types.h"
namespace webrtc {
class CriticalSectionWrapper;
class EventWrapper;
class ThreadWrapper;
class VoENetwork;
}
class FakeExternalTransport : public webrtc::Transport {
public:
explicit FakeExternalTransport(webrtc::VoENetwork* ptr);
virtual ~FakeExternalTransport();
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);
webrtc::VoENetwork* my_network_;
private:
static bool Run(void* ptr);
bool Process();
private:
webrtc::ThreadWrapper* thread_;
webrtc::CriticalSectionWrapper* lock_;
webrtc::EventWrapper* event_;
private:
unsigned char packet_buffer_[1612];
int length_;
int channel_;
bool delay_is_enabled_;
int delay_time_in_ms_;
};
#endif // VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKES_FAKE_EXTERNAL_TRANSPORT_H_

View File

@ -7,8 +7,8 @@
* in the file PATENTS. All contributing project authors may * in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef FAKE_MEDIA_PROCESS_H_ #ifndef VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKE_MEDIA_PROCESS_H_
#define FAKE_MEDIA_PROCESS_H_ #define VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKE_MEDIA_PROCESS_H_
#include <cmath> #include <cmath>
@ -41,4 +41,4 @@ class FakeMediaProcess : public webrtc::VoEMediaProcess {
int frequency; int frequency;
}; };
#endif // FAKE_MEDIA_PROCESS_H_ #endif // VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKE_MEDIA_PROCESS_H_

View File

@ -11,6 +11,22 @@
#include "after_streaming_fixture.h" #include "after_streaming_fixture.h"
#include "voe_standard_test.h" #include "voe_standard_test.h"
class RxCallback : public webrtc::VoERxVadCallback {
public:
RxCallback() :
vad_decision(-1) {
}
virtual void OnRxVad(int, int vadDecision) {
char msg[128];
sprintf(msg, "RX VAD detected decision %d \n", vadDecision);
TEST_LOG("%s", msg);
vad_decision = vadDecision;
}
int vad_decision;
};
class AudioProcessingTest : public AfterStreamingFixture { class AudioProcessingTest : public AfterStreamingFixture {
protected: protected:
// Note: Be careful with this one, it is used in the // Note: Be careful with this one, it is used in the
@ -188,7 +204,7 @@ TEST_F(AudioProcessingTest, ManualTestEcMetrics) {
// TODO(phoglund): Reenable below test when it's no longer flaky. // TODO(phoglund): Reenable below test when it's no longer flaky.
TEST_F(AudioProcessingTest, DISABLED_TestVoiceActivityDetectionWithObserver) { TEST_F(AudioProcessingTest, DISABLED_TestVoiceActivityDetectionWithObserver) {
voetest::RxCallback rx_callback; RxCallback rx_callback;
EXPECT_EQ(0, voe_apm_->RegisterRxVadObserver(channel_, rx_callback)); EXPECT_EQ(0, voe_apm_->RegisterRxVadObserver(channel_, rx_callback));
// The extra sleeps are to allow decisions some time to propagate to the // The extra sleeps are to allow decisions some time to propagate to the
@ -196,12 +212,12 @@ TEST_F(AudioProcessingTest, DISABLED_TestVoiceActivityDetectionWithObserver) {
TryDetectingSilence(); TryDetectingSilence();
Sleep(100); Sleep(100);
EXPECT_EQ(0, rx_callback._vadDecision); EXPECT_EQ(0, rx_callback.vad_decision);
TryDetectingSpeechAfterSilence(); TryDetectingSpeechAfterSilence();
Sleep(100); Sleep(100);
EXPECT_EQ(1, rx_callback._vadDecision); EXPECT_EQ(1, rx_callback.vad_decision);
EXPECT_EQ(0, voe_apm_->DeRegisterRxVadObserver(channel_)); EXPECT_EQ(0, voe_apm_->DeRegisterRxVadObserver(channel_));
} }

View File

@ -8,10 +8,11 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "after_streaming_fixture.h" #include "voice_engine/main/test/auto_test/fakes/fake_external_transport.h"
#include "mock/mock_voe_observer.h" #include "voice_engine/main/test/auto_test/fixtures/after_streaming_fixture.h"
#include "mock/mock_voe_connection_observer.h" #include "voice_engine/main/test/auto_test/voe_test_interface.h"
#include "voe_test_interface.h" #include "voice_engine/main/interface/mock/mock_voe_connection_observer.h"
#include "voice_engine/main/interface/mock/mock_voe_observer.h"
static const int kDefaultRtpPort = 8000; static const int kDefaultRtpPort = 8000;
static const int kDefaultRtcpPort = 8001; static const int kDefaultRtcpPort = 8001;
@ -181,7 +182,7 @@ TEST_F(NetworkTest, CanSwitchToExternalTransport) {
EXPECT_EQ(0, voe_base_->DeleteChannel(channel_)); EXPECT_EQ(0, voe_base_->DeleteChannel(channel_));
channel_ = voe_base_->CreateChannel(); channel_ = voe_base_->CreateChannel();
voetest::FakeExternalTransport external_transport(voe_network_); FakeExternalTransport external_transport(voe_network_);
EXPECT_EQ(0, voe_network_->RegisterExternalTransport( EXPECT_EQ(0, voe_network_->RegisterExternalTransport(
channel_, external_transport)); channel_, external_transport));

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@ -12,6 +12,86 @@
#include "voe_standard_test.h" #include "voe_standard_test.h"
#include "testsupport/fileutils.h" #include "testsupport/fileutils.h"
class TestRtpObserver : public webrtc::VoERTPObserver {
public:
TestRtpObserver();
virtual ~TestRtpObserver();
virtual void OnIncomingCSRCChanged(const int channel,
const unsigned int CSRC,
const bool added);
virtual void OnIncomingSSRCChanged(const int channel,
const unsigned int SSRC);
void Reset();
public:
unsigned int ssrc_[2];
unsigned int csrc_[2][2]; // Stores 2 CSRCs for each channel.
bool added_[2][2];
int size_[2];
};
TestRtpObserver::TestRtpObserver() {
Reset();
}
TestRtpObserver::~TestRtpObserver() {
}
void TestRtpObserver::Reset() {
for (int i = 0; i < 2; i++) {
ssrc_[i] = 0;
csrc_[i][0] = 0;
csrc_[i][1] = 0;
added_[i][0] = false;
added_[i][1] = false;
size_[i] = 0;
}
}
void TestRtpObserver::OnIncomingCSRCChanged(const int channel,
const unsigned int CSRC,
const bool added) {
char msg[128];
sprintf(msg, "=> OnIncomingCSRCChanged(channel=%d, CSRC=%u, added=%d)\n",
channel, CSRC, added);
TEST_LOG("%s", msg);
if (channel > 1)
return; // Not enough memory.
csrc_[channel][size_[channel]] = CSRC;
added_[channel][size_[channel]] = added;
size_[channel]++;
if (size_[channel] == 2)
size_[channel] = 0;
}
void TestRtpObserver::OnIncomingSSRCChanged(const int channel,
const unsigned int SSRC) {
char msg[128];
sprintf(msg, "\n=> OnIncomingSSRCChanged(channel=%d, SSRC=%u)\n", channel,
SSRC);
TEST_LOG("%s", msg);
ssrc_[channel] = SSRC;
}
class RtcpAppHandler : public webrtc::VoERTCPObserver {
public:
void OnApplicationDataReceived(const int channel,
const unsigned char sub_type,
const unsigned int name,
const unsigned char* data,
const unsigned short length_in_bytes);
void Reset();
~RtcpAppHandler() {}
unsigned short length_in_bytes_;
unsigned char data_[256];
unsigned char sub_type_;
unsigned int name_;
};
static const char* const RTCP_CNAME = "Whatever"; static const char* const RTCP_CNAME = "Whatever";
class RtpRtcpTest : public AfterStreamingFixture { class RtpRtcpTest : public AfterStreamingFixture {
@ -41,6 +121,23 @@ class RtpRtcpTest : public AfterStreamingFixture {
int second_channel_; int second_channel_;
}; };
void RtcpAppHandler::OnApplicationDataReceived(
const int /*channel*/, const unsigned char sub_type,
const unsigned int name, const unsigned char* data,
const unsigned short length_in_bytes) {
length_in_bytes_ = length_in_bytes;
memcpy(data_, &data[0], length_in_bytes);
sub_type_ = sub_type;
name_ = name;
}
void RtcpAppHandler::Reset() {
length_in_bytes_ = 0;
memset(data_, 0, sizeof(data_));
sub_type_ = 0;
name_ = 0;
}
TEST_F(RtpRtcpTest, RemoteRtcpCnameHasPropagatedToRemoteSide) { TEST_F(RtpRtcpTest, RemoteRtcpCnameHasPropagatedToRemoteSide) {
// We need to sleep a bit here for the name to propagate. For instance, // We need to sleep a bit here for the name to propagate. For instance,
// 200 milliseconds is not enough, so we'll go with one second here. // 200 milliseconds is not enough, so we'll go with one second here.
@ -68,7 +165,7 @@ TEST_F(RtpRtcpTest, SSRCPropagatesCorrectly) {
} }
TEST_F(RtpRtcpTest, RtcpApplicationDefinedPacketsCanBeSentAndReceived) { TEST_F(RtpRtcpTest, RtcpApplicationDefinedPacketsCanBeSentAndReceived) {
voetest::RtcpAppHandler rtcp_app_handler; RtcpAppHandler rtcp_app_handler;
EXPECT_EQ(0, voe_rtp_rtcp_->RegisterRTCPObserver( EXPECT_EQ(0, voe_rtp_rtcp_->RegisterRTCPObserver(
channel_, rtcp_app_handler)); channel_, rtcp_app_handler));
@ -94,7 +191,7 @@ TEST_F(RtpRtcpTest, RtcpApplicationDefinedPacketsCanBeSentAndReceived) {
} }
TEST_F(RtpRtcpTest, DisabledRtcpObserverDoesNotReceiveData) { TEST_F(RtpRtcpTest, DisabledRtcpObserverDoesNotReceiveData) {
voetest::RtcpAppHandler rtcp_app_handler; RtcpAppHandler rtcp_app_handler;
EXPECT_EQ(0, voe_rtp_rtcp_->RegisterRTCPObserver( EXPECT_EQ(0, voe_rtp_rtcp_->RegisterRTCPObserver(
channel_, rtcp_app_handler)); channel_, rtcp_app_handler));
@ -167,7 +264,7 @@ TEST_F(RtpRtcpTest, DISABLED_CanCreateRtpDumpFilesWithoutError) {
} }
TEST_F(RtpRtcpTest, ObserverGetsNotifiedOnSsrcChange) { TEST_F(RtpRtcpTest, ObserverGetsNotifiedOnSsrcChange) {
voetest::TestRtpObserver rtcp_observer; TestRtpObserver rtcp_observer;
EXPECT_EQ(0, voe_rtp_rtcp_->RegisterRTPObserver( EXPECT_EQ(0, voe_rtp_rtcp_->RegisterRTPObserver(
channel_, rtcp_observer)); channel_, rtcp_observer));
rtcp_observer.Reset(); rtcp_observer.Reset();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@ -31,12 +31,6 @@ namespace voetest {
return -1; \ return -1; \
} }
extern char* GetFilename(char* filename);
extern const char* GetFilename(const char* filename);
extern int GetResource(char* resource, char* dest, int destLen);
extern char* GetResource(char* resource);
extern const char* GetResource(const char* resource);
VoECpuTest::VoECpuTest(VoETestManager& mgr) VoECpuTest::VoECpuTest(VoETestManager& mgr)
: _mgr(mgr) { : _mgr(mgr) {

View File

@ -10,15 +10,15 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <vector> #include <vector>
#include "critical_section_wrapper.h" #include "system_wrappers/interface/critical_section_wrapper.h"
#include "event_wrapper.h" #include "system_wrappers/interface/event_wrapper.h"
#include "thread_wrapper.h"
#include "voe_extended_test.h"
#include "../../source/voice_engine_defines.h" // defines build macros
#include "system_wrappers/interface/ref_count.h" #include "system_wrappers/interface/ref_count.h"
#include "system_wrappers/interface/thread_wrapper.h"
#include "testsupport/fileutils.h"
#include "voice_engine/main/source/voice_engine_defines.h"
#include "voice_engine/main/test/auto_test/voe_extended_test.h"
#if defined(_WIN32) #if defined(_WIN32)
#include <conio.h> #include <conio.h>
@ -53,12 +53,6 @@ extern void* globalJavaVM;
extern void* globalContext; extern void* globalContext;
#endif #endif
extern char* GetFilename(char* filename);
extern const char* GetFilename(const char* filename);
extern int GetResource(char* resource, char* dest, int destLen);
extern char* GetResource(char* resource);
extern const char* GetResource(const char* resource);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// External AudioDeviceModule implementation // External AudioDeviceModule implementation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -106,7 +100,8 @@ int32_t AudioDeviceModuleImpl::Release() {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
ExtendedTestTransport::ExtendedTestTransport(VoENetwork* ptr) : ExtendedTestTransport::ExtendedTestTransport(VoENetwork* ptr) :
myNetw(ptr), _thread(NULL), _lock(NULL), _event(NULL), _length(0), _channel(0) { myNetw(ptr), _thread(NULL), _lock(NULL), _event(NULL), _length(0),
_channel(0) {
const char* threadName = "voe_extended_test_external_thread"; const char* threadName = "voe_extended_test_external_thread";
_lock = CriticalSectionWrapper::CreateCriticalSection(); _lock = CriticalSectionWrapper::CreateCriticalSection();
_event = EventWrapper::Create(); _event = EventWrapper::Create();
@ -353,14 +348,14 @@ int VoEExtendedTest::TestBase() {
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST(SetTraceFileName - SetDebugTraceFileName); ANL(); TEST(SetTraceFileName - SetDebugTraceFileName); ANL();
TEST_MUSTPASS(VoiceEngine::SetTraceFile(NULL)); MARK(); TEST_MUSTPASS(VoiceEngine::SetTraceFile(NULL)); MARK();
// don't use these files // don't use these files
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("" std::string output_path = webrtc::test::OutputPath();
"VoEBase_trace_dont_use.txt"))); MARK(); TEST_MUSTPASS(VoiceEngine::SetTraceFile(
(output_path + "VoEBase_trace_dont_use.txt").c_str())); MARK();
// use these instead // use these instead
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("" TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename(""
"VoEBase_trace.txt"))); MARK(); (output_path + "VoEBase_trace.txt").c_str())); MARK();
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStream | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStream |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -1472,7 +1467,7 @@ int VoEExtendedTest::TestBase() {
TEST(SetTraceFilter); ANL(); TEST(SetTraceFilter); ANL();
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("" TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename(""
"VoEBase_trace_filter.txt"))); MARK(); "VoEBase_trace_filter.txt").c_str())); MARK();
SLEEP(100); SLEEP(100);
// Test a few different filters, verify in trace file // Test a few different filters, verify in trace file
@ -1572,7 +1567,8 @@ int VoEExtendedTest::TestCallReport() {
} }
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("VoECallReport_trace.txt"))); TEST_MUSTPASS(VoiceEngine::SetTraceFile(
GetFilename("VoECallReport_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -1712,7 +1708,8 @@ int VoEExtendedTest::TestCodec() {
VoEFile* file = _mgr.FilePtr(); VoEFile* file = _mgr.FilePtr();
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("VoECodec_trace.txt"))); TEST_MUSTPASS(VoiceEngine::SetTraceFile(
GetFilename("VoECodec_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -3011,8 +3008,9 @@ int VoEExtendedTest::TestCodec() {
TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(voe_base_->StartPlayout(0));
TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(voe_base_->StartSend(0));
TEST_MUSTPASS(voe_base_->StartReceive(0)); TEST_MUSTPASS(voe_base_->StartReceive(0));
std::string output_path = webrtc::test::OutputPath();
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
0, GetFilename("audio_long16.pcm"), true , true)); 0, (output_path + "audio_long16.pcm").c_str(), true , true));
cinst.channels = 1; cinst.channels = 1;
TEST_LOG("Testing codec: Switch between iSAC-wb and iSAC-swb \n"); TEST_LOG("Testing codec: Switch between iSAC-wb and iSAC-swb \n");
TEST_LOG("Testing codec: iSAC wideband \n"); TEST_LOG("Testing codec: iSAC wideband \n");
@ -3075,8 +3073,9 @@ int VoEExtendedTest::TestDtmf() {
VoECodec* codec = _mgr.CodecPtr(); VoECodec* codec = _mgr.CodecPtr();
VoEVolumeControl* volume = _mgr.VolumeControlPtr(); VoEVolumeControl* volume = _mgr.VolumeControlPtr();
//#ifdef _USE_EXTENDED_TRACE_ std::string output_path = webrtc::test::OutputPath();
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("VoEDtmf_trace.txt"))); TEST_MUSTPASS(VoiceEngine::SetTraceFile(
(output_path + "VoEDtmf_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -3467,7 +3466,7 @@ int VoEExtendedTest::TestEncryption() {
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile( TEST_MUSTPASS(VoiceEngine::SetTraceFile(
GetFilename("VoEEncryption_trace.txt"))); GetFilename("VoEEncryption_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -3984,7 +3983,7 @@ int VoEExtendedTest::TestExternalMedia() {
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile( TEST_MUSTPASS(VoiceEngine::SetTraceFile(
GetFilename("VoEExternalMedia_trace.txt"))); GetFilename("VoEExternalMedia_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter( TEST_MUSTPASS(VoiceEngine::SetTraceFilter(
kTraceStateInfo | kTraceStateInfo | kTraceWarning | kTraceStateInfo | kTraceStateInfo | kTraceWarning |
kTraceError | kTraceCritical | kTraceApiCall | kTraceError | kTraceCritical | kTraceApiCall |
@ -4101,7 +4100,7 @@ int VoEExtendedTest::TestFile() {
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile( TEST_MUSTPASS(VoiceEngine::SetTraceFile(
GetFilename("VoEFile_trace.txt"))); MARK(); GetFilename("VoEFile_trace.txt").c_str())); MARK();
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -4131,43 +4130,47 @@ int VoEExtendedTest::TestFile() {
ANL(); ANL();
voe_base_->StopPlayout(0); voe_base_->StopPlayout(0);
std::string output_path = webrtc::test::OutputPath();
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long16.pcm")));MARK(); 0, (output_path + "audio_long16.pcm").c_str()));MARK();
voe_base_->StartPlayout(0); voe_base_->StartPlayout(0);
MARK(); // file should be mixed in and played out MARK(); // file should be mixed in and played out
SLEEP(dT); SLEEP(dT);
TEST_MUSTPASS(!file->StartPlayingFileLocally( TEST_MUSTPASS(!file->StartPlayingFileLocally(
0, GetResource("audio_long16.pcm"))); 0, (output_path + "audio_long16.pcm").c_str()));
MARK(); // should fail (must stop first) MARK(); // should fail (must stop first)
TEST_MUSTPASS(voe_base_->LastError() != VE_ALREADY_PLAYING); TEST_MUSTPASS(voe_base_->LastError() != VE_ALREADY_PLAYING);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long16.pcm"))); 0, (output_path + "audio_long16.pcm").c_str()));
MARK(); // should work again (restarts file) MARK(); // should work again (restarts file)
SLEEP(dT); SLEEP(dT);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long16.pcm"), false, kFileFormatPcm16kHzFile)); 0, (output_path + "audio_long16.pcm").c_str(),
false, kFileFormatPcm16kHzFile));
MARK(); MARK();
SLEEP(dT); SLEEP(dT);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long8.pcm"), false, kFileFormatPcm8kHzFile)); 0, (output_path + "audio_long8.pcm").c_str(),
false, kFileFormatPcm8kHzFile));
MARK(); MARK();
SLEEP(dT); SLEEP(dT);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long16.wav"), false, kFileFormatPcm8kHzFile)); 0, (output_path + "audio_long16.wav").c_str(),
false, kFileFormatPcm8kHzFile));
MARK(); MARK();
SLEEP(dT); SLEEP(dT);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long8mulaw.wav"), false, 0, (output_path + "audio_long8mulaw.wav").c_str(), false,
kFileFormatPcm8kHzFile)); kFileFormatPcm8kHzFile));
MARK(); MARK();
SLEEP(dT); SLEEP(dT);
@ -4176,34 +4179,34 @@ int VoEExtendedTest::TestFile() {
// TEST_MUSTPASS(file->StopPlayingFileLocally(0)); MARK(); // TEST_MUSTPASS(file->StopPlayingFileLocally(0)); MARK();
// TEST_MUSTPASS(file->StartPlayingFileLocally( // TEST_MUSTPASS(file->StartPlayingFileLocally(
// 0, GetResource("audio_short16.pcm"), true, // 0, (output_path + "audio_short16.pcm").c_str(), true,
// kFileFormatPcm16kHzFile)); MARK(); // loop // kFileFormatPcm16kHzFile)); MARK(); // loop
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_short16.pcm"), false, 0, (output_path + "audio_short16.pcm").c_str(), false,
kFileFormatPcm16kHzFile, 1.0, 0, 2000)); kFileFormatPcm16kHzFile, 1.0, 0, 2000));
MARK(); // play segment MARK(); // play segment
SLEEP(2500); SLEEP(2500);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
TEST_MUSTPASS(!file->StartPlayingFileLocally( TEST_MUSTPASS(!file->StartPlayingFileLocally(
0, GetResource("audio_short16.pcm"), false, 0, (output_path + "audio_short16.pcm").c_str(), false,
kFileFormatPcm16kHzFile, 1.0, 2000, 1000)); kFileFormatPcm16kHzFile, 1.0, 2000, 1000));
MARK(); // invalid segment MARK(); // invalid segment
TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE); TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE);
TEST_MUSTPASS(!file->StartPlayingFileLocally( TEST_MUSTPASS(!file->StartPlayingFileLocally(
0, GetResource("audio_short16.pcm"), false, 0, (output_path + "audio_short16.pcm").c_str(), false,
kFileFormatPcm16kHzFile, 1.0, 21000, 30000)); kFileFormatPcm16kHzFile, 1.0, 21000, 30000));
MARK(); // start > file size MARK(); // start > file size
TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE); TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE);
TEST_MUSTPASS(!file->StartPlayingFileLocally( TEST_MUSTPASS(!file->StartPlayingFileLocally(
0, GetResource("audio_short16.pcm"), false, 0, (output_path + "audio_short16.pcm").c_str(), false,
kFileFormatPcm16kHzFile, 1.0, 100, 100)); kFileFormatPcm16kHzFile, 1.0, 100, 100));
MARK(); // invalid segment MARK(); // invalid segment
TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE); TEST_MUSTPASS(voe_base_->LastError() != VE_BAD_FILE);
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long16.pcm"))); 0, (output_path + "audio_long16.pcm").c_str()));
MARK(); // should work again (restarts file) MARK(); // should work again (restarts file)
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
MARK(); MARK();
@ -4220,7 +4223,7 @@ int VoEExtendedTest::TestFile() {
TEST_MUSTPASS(0 != file->IsPlayingFileLocally(0)); TEST_MUSTPASS(0 != file->IsPlayingFileLocally(0));
MARK(); // inactive MARK(); // inactive
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long16.pcm"))); 0, (output_path + "audio_long16.pcm").c_str()));
MARK(); MARK();
TEST_MUSTPASS(1 != file->IsPlayingFileLocally(0)); TEST_MUSTPASS(1 != file->IsPlayingFileLocally(0));
MARK(); // active MARK(); // active
@ -4315,27 +4318,27 @@ int VoEExtendedTest::TestFile() {
" 3 in 8 kHz no mix, 4 in 8 kHz mix \n"); " 3 in 8 kHz no mix, 4 in 8 kHz mix \n");
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
ch, GetResource("audio_long16.pcm"))); ch, (output_path + "audio_long16.pcm").c_str()));
MARK(); // don't mix MARK(); // don't mix
SLEEP(2000); SLEEP(2000);
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
ch, GetResource("audio_long16.wav"), false, true, ch, (output_path + "audio_long16.wav").c_str(), false, true,
kFileFormatWavFile)); kFileFormatWavFile));
MARK(); // mix MARK(); // mix
SLEEP(2000); SLEEP(2000);
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
ch, GetResource("audio_long8.pcm"), false, false, ch, (output_path + "audio_long8.pcm").c_str(), false, false,
kFileFormatPcm8kHzFile)); kFileFormatPcm8kHzFile));
MARK(); // don't mix MARK(); // don't mix
SLEEP(2000); SLEEP(2000);
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch));
MARK(); MARK();
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
ch, GetResource("audio_long8.pcm"), false, true, ch, (output_path + "audio_long8.pcm").c_str(), false, true,
kFileFormatPcm8kHzFile)); kFileFormatPcm8kHzFile));
MARK(); // mix MARK(); // mix
SLEEP(2000); SLEEP(2000);
@ -4348,7 +4351,7 @@ int VoEExtendedTest::TestFile() {
ANL(); ANL();
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
ch, GetResource("audio_long16.pcm"))); ch, (output_path + "audio_long16.pcm").c_str()));
TEST_MUSTPASS(1 != file->IsPlayingFileAsMicrophone(ch)); TEST_MUSTPASS(1 != file->IsPlayingFileAsMicrophone(ch));
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(ch));
TEST_MUSTPASS(0 != file->IsPlayingFileAsMicrophone(ch)); TEST_MUSTPASS(0 != file->IsPlayingFileAsMicrophone(ch));
@ -4356,7 +4359,7 @@ int VoEExtendedTest::TestFile() {
ANL(); ANL();
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
ch, GetResource("audio_long16.pcm"))); ch, (output_path + "audio_long16.pcm").c_str()));
TEST_MUSTPASS(file->ScaleFileAsMicrophonePlayout(ch, 1.0)); TEST_MUSTPASS(file->ScaleFileAsMicrophonePlayout(ch, 1.0));
MARK(); MARK();
SLEEP(1000); SLEEP(1000);
@ -4386,7 +4389,7 @@ int VoEExtendedTest::TestFile() {
ANL(); ANL();
TEST_MUSTPASS(file->StartRecordingPlayout(0, TEST_MUSTPASS(file->StartRecordingPlayout(0,
GetFilename("rec_play16.pcm"))); (output_path + "rec_play16.pcm").c_str()));
MARK(); MARK();
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingPlayout(0)); TEST_MUSTPASS(file->StopRecordingPlayout(0));
@ -4394,16 +4397,16 @@ int VoEExtendedTest::TestFile() {
fcomp.plfreq = 8000; fcomp.plfreq = 8000;
strcpy(fcomp.plname, "L16"); strcpy(fcomp.plname, "L16");
TEST_MUSTPASS(file->StartRecordingPlayout(0, GetFilename("rec_play8.wav"), TEST_MUSTPASS(file->StartRecordingPlayout(0,
&fcomp)); (output_path + "rec_play8.wav").c_str(), &fcomp));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingPlayout(0)); TEST_MUSTPASS(file->StopRecordingPlayout(0));
MARK(); MARK();
fcomp.plfreq = 16000; fcomp.plfreq = 16000;
strcpy(fcomp.plname, "L16"); strcpy(fcomp.plname, "L16");
TEST_MUSTPASS(file->StartRecordingPlayout(0, GetFilename("rec_play16.wav"), TEST_MUSTPASS(file->StartRecordingPlayout(0,
&fcomp)); (output_path + "rec_play16.wav").c_str(), &fcomp));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingPlayout(0)); TEST_MUSTPASS(file->StopRecordingPlayout(0));
MARK(); MARK();
@ -4416,7 +4419,7 @@ int VoEExtendedTest::TestFile() {
fcomp.channels = 1; fcomp.channels = 1;
TEST_MUSTPASS(file->StartRecordingPlayout(0, TEST_MUSTPASS(file->StartRecordingPlayout(0,
GetFilename("rec_play_pcmu.wav"), (output_path + "rec_play_pcmu.wav").c_str(),
&fcomp)); &fcomp));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingPlayout(0)); TEST_MUSTPASS(file->StopRecordingPlayout(0));
@ -4426,7 +4429,7 @@ int VoEExtendedTest::TestFile() {
fcomp.plfreq = 8000; fcomp.plfreq = 8000;
strcpy(fcomp.plname, "PCMA"); strcpy(fcomp.plname, "PCMA");
TEST_MUSTPASS(file->StartRecordingPlayout(0, TEST_MUSTPASS(file->StartRecordingPlayout(0,
GetFilename("rec_play_pcma.wav"), (output_path + "rec_play_pcma.wav").c_str(),
&fcomp)); &fcomp));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingPlayout(0)); TEST_MUSTPASS(file->StopRecordingPlayout(0));
@ -4438,14 +4441,14 @@ int VoEExtendedTest::TestFile() {
fcomp.plfreq = 8000; fcomp.plfreq = 8000;
strcpy(fcomp.plname, "ILBC"); strcpy(fcomp.plname, "ILBC");
TEST_MUSTPASS(file->StartRecordingPlayout(0, TEST_MUSTPASS(file->StartRecordingPlayout(0,
GetFilename("rec_play.ilbc"), (output_path + "rec_play.ilbc").c_str(),
&fcomp)); &fcomp));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingPlayout(0)); TEST_MUSTPASS(file->StopRecordingPlayout(0));
MARK(); MARK();
TEST_MUSTPASS(file->StartRecordingPlayout( TEST_MUSTPASS(file->StartRecordingPlayout(
-1, GetFilename("rec_play16_mixed.pcm"))); -1, (output_path + "rec_play16_mixed.pcm").c_str()));
MARK(); MARK();
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingPlayout(-1)); TEST_MUSTPASS(file->StopRecordingPlayout(-1));
@ -4454,7 +4457,8 @@ int VoEExtendedTest::TestFile() {
// TEST_MUSTPASS(file->StopPlayingFileLocally(0)); // Why should this work? // TEST_MUSTPASS(file->StopPlayingFileLocally(0)); // Why should this work?
TEST_LOG("\nplaying out...\n"); TEST_LOG("\nplaying out...\n");
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetFilename("rec_play.ilbc"), false, kFileFormatCompressedFile)); 0, (output_path + "rec_play.ilbc").c_str(), false,
kFileFormatCompressedFile));
MARK(); MARK();
SLEEP(2000); SLEEP(2000);
@ -4467,14 +4471,16 @@ int VoEExtendedTest::TestFile() {
TEST(StopRecordingMicrophone); TEST(StopRecordingMicrophone);
ANL(); ANL();
TEST_MUSTPASS(file->StartRecordingMicrophone(GetFilename("rec_mic16.pcm"))); TEST_MUSTPASS(file->StartRecordingMicrophone(
(output_path + "rec_mic16.pcm").c_str()));
MARK(); MARK();
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingMicrophone()); TEST_MUSTPASS(file->StopRecordingMicrophone());
MARK(); MARK();
voe_base_->StopSend(0); voe_base_->StopSend(0);
TEST_MUSTPASS(file->StartRecordingMicrophone(GetFilename("rec_mic16.pcm"))); TEST_MUSTPASS(file->StartRecordingMicrophone(
(output_path + "rec_mic16.pcm").c_str()));
MARK(); // record without sending as well MARK(); // record without sending as well
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingMicrophone()); TEST_MUSTPASS(file->StopRecordingMicrophone());
@ -4484,7 +4490,7 @@ int VoEExtendedTest::TestFile() {
fcomp.plfreq = 8000; fcomp.plfreq = 8000;
strcpy(fcomp.plname, "L16"); strcpy(fcomp.plname, "L16");
TEST_MUSTPASS(file->StartRecordingMicrophone( TEST_MUSTPASS(file->StartRecordingMicrophone(
GetFilename("rec_play8.wav"), &fcomp)); (output_path + "rec_play8.wav").c_str(), &fcomp));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingMicrophone()); TEST_MUSTPASS(file->StopRecordingMicrophone());
MARK(); MARK();
@ -4492,7 +4498,7 @@ int VoEExtendedTest::TestFile() {
fcomp.plfreq = 16000; fcomp.plfreq = 16000;
strcpy(fcomp.plname, "L16"); strcpy(fcomp.plname, "L16");
TEST_MUSTPASS(file->StartRecordingMicrophone( TEST_MUSTPASS(file->StartRecordingMicrophone(
GetFilename("rec_play16.wav"), &fcomp)); (output_path + "rec_play16.wav").c_str(), &fcomp));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->StopRecordingMicrophone()); TEST_MUSTPASS(file->StopRecordingMicrophone());
MARK(); MARK();
@ -4521,9 +4527,9 @@ int VoEExtendedTest::TestFile() {
strcpy(fcomp.plname, "L16"); strcpy(fcomp.plname, "L16");
TEST_LOG("Recording microphone to L16, please speak \n"); TEST_LOG("Recording microphone to L16, please speak \n");
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
0, GetResource("audio_long16.pcm"), true , true)); 0, (output_path + "audio_long16.pcm").c_str(), true , true));
TEST_MUSTPASS(file->StartRecordingMicrophone( TEST_MUSTPASS(file->StartRecordingMicrophone(
GetFilename("rec_play_ch.wav"), &fcomp)); (output_path + "rec_play_ch.wav").c_str(), &fcomp));
MARK(); MARK();
SLEEP(3000); SLEEP(3000);
TEST_MUSTPASS(file->StopRecordingMicrophone()); TEST_MUSTPASS(file->StopRecordingMicrophone());
@ -4531,14 +4537,15 @@ int VoEExtendedTest::TestFile() {
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0));
TEST_LOG("Playing recording file, you should only hear what you said \n"); TEST_LOG("Playing recording file, you should only hear what you said \n");
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetFilename("rec_play_ch.wav"), false, kFileFormatWavFile)); 0, (output_path + "rec_play_ch.wav").c_str(),
false, kFileFormatWavFile));
SLEEP(2500); SLEEP(2500);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
TEST_LOG("Recording microphone 0 to L16, please speak \n"); TEST_LOG("Recording microphone 0 to L16, please speak \n");
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
-1, GetResource("audio_long16.pcm"), true , true)); -1, (output_path + "audio_long16.pcm").c_str(), true , true));
TEST_MUSTPASS(file->StartRecordingMicrophone( TEST_MUSTPASS(file->StartRecordingMicrophone(
GetFilename("rec_play_ch_0.wav"), &fcomp)); (output_path + "rec_play_ch_0.wav").c_str(), &fcomp));
MARK(); MARK();
SLEEP(3000); SLEEP(3000);
TEST_MUSTPASS(file->StopRecordingMicrophone()); TEST_MUSTPASS(file->StopRecordingMicrophone());
@ -4547,7 +4554,8 @@ int VoEExtendedTest::TestFile() {
TEST_LOG("Playing recording file, you should hear what you said and" TEST_LOG("Playing recording file, you should hear what you said and"
" audio_long16.pcm \n"); " audio_long16.pcm \n");
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetFilename("rec_play_ch_0.wav"), false, kFileFormatWavFile)); 0, (output_path + "rec_play_ch_0.wav").c_str(),
false, kFileFormatWavFile));
SLEEP(2500); SLEEP(2500);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
TEST_LOG("Recording microphone to ilbc, please speak \n"); TEST_LOG("Recording microphone to ilbc, please speak \n");
@ -4558,9 +4566,9 @@ int VoEExtendedTest::TestFile() {
fcomp.channels = 1; fcomp.channels = 1;
fcomp.pltype = 97; fcomp.pltype = 97;
TEST_MUSTPASS(file->StartPlayingFileAsMicrophone( TEST_MUSTPASS(file->StartPlayingFileAsMicrophone(
0, GetResource("audio_long16.pcm"), true , true)); 0, (output_path + "audio_long16.pcm").c_str(), true , true));
TEST_MUSTPASS(file->StartRecordingMicrophone( TEST_MUSTPASS(file->StartRecordingMicrophone(
GetFilename("rec_play_ch_0.ilbc"), &fcomp)); (output_path + "rec_play_ch_0.ilbc").c_str(), &fcomp));
MARK(); MARK();
SLEEP(3000); SLEEP(3000);
TEST_MUSTPASS(file->StopRecordingMicrophone()); TEST_MUSTPASS(file->StopRecordingMicrophone());
@ -4568,7 +4576,7 @@ int VoEExtendedTest::TestFile() {
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0));
TEST_LOG("Playing recording file, you should only hear what you said \n"); TEST_LOG("Playing recording file, you should only hear what you said \n");
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetFilename("rec_play_ch_0.ilbc"), false, 0, (output_path + "rec_play_ch_0.ilbc").c_str(), false,
kFileFormatCompressedFile)); kFileFormatCompressedFile));
SLEEP(2500); SLEEP(2500);
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
@ -4632,8 +4640,8 @@ int VoEExtendedTest::TestFile() {
ANL(); ANL();
TEST_MUSTPASS(file->ConvertPCMToWAV( TEST_MUSTPASS(file->ConvertPCMToWAV(
GetResource("audio_long16.pcm"), (output_path + "audio_long16.pcm").c_str(),
GetFilename("singleUserDemoConv.wav"))); (output_path + "singleUserDemoConv.wav").c_str()));
MARK(); MARK();
TEST_MUSTPASS(!file->ConvertPCMToWAV((InStream*)NULL, TEST_MUSTPASS(!file->ConvertPCMToWAV((InStream*)NULL,
(OutStream*)NULL));MARK(); // invalid stream handles (OutStream*)NULL));MARK(); // invalid stream handles
@ -4644,8 +4652,8 @@ int VoEExtendedTest::TestFile() {
ANL(); ANL();
TEST_MUSTPASS(file->ConvertWAVToPCM( TEST_MUSTPASS(file->ConvertWAVToPCM(
GetResource("audio_long16.wav"), (output_path + "audio_long16.wav").c_str(),
GetFilename("singleUserDemoConv.pcm"))); (output_path + "singleUserDemoConv.pcm").c_str()));
MARK(); MARK();
TEST_MUSTPASS(!file->ConvertWAVToPCM((InStream*)NULL, (OutStream*)NULL)); TEST_MUSTPASS(!file->ConvertWAVToPCM((InStream*)NULL, (OutStream*)NULL));
MARK(); // invalid stream handles MARK(); // invalid stream handles
@ -4658,8 +4666,8 @@ int VoEExtendedTest::TestFile() {
fcomp.plfreq = 16000; fcomp.plfreq = 16000;
strcpy(fcomp.plname, "L16"); strcpy(fcomp.plname, "L16");
TEST_MUSTPASS(!file->ConvertPCMToCompressed( TEST_MUSTPASS(!file->ConvertPCMToCompressed(
GetResource("audio_long16.pcm"), (output_path + "audio_long16.pcm").c_str(),
GetFilename("singleUserDemoConv16_dummy.wav"), &fcomp)); (output_path + "singleUserDemoConv16_dummy.wav").c_str(), &fcomp));
MARK(); // should not be supported MARK(); // should not be supported
fcomp.plfreq = 8000; fcomp.plfreq = 8000;
@ -4669,19 +4677,19 @@ int VoEExtendedTest::TestFile() {
fcomp.pltype = 97; fcomp.pltype = 97;
fcomp.channels = 1; fcomp.channels = 1;
TEST_MUSTPASS(file->ConvertPCMToCompressed( TEST_MUSTPASS(file->ConvertPCMToCompressed(
GetResource("audio_long16.pcm"), (output_path + "audio_long16.pcm").c_str(),
GetFilename("singleUserDemoConv.ilbc"), &fcomp));MARK(); (output_path + "singleUserDemoConv.ilbc").c_str(), &fcomp));MARK();
AOK();ANL(); AOK();ANL();
TEST(ConvertCompressedToPCM); TEST(ConvertCompressedToPCM);
ANL(); ANL();
TEST_MUSTPASS(file->ConvertCompressedToPCM( TEST_MUSTPASS(file->ConvertCompressedToPCM(
GetFilename("singleUserDemoConv.ilbc"), (output_path + "singleUserDemoConv.ilbc").c_str(),
GetFilename("singleUserDemoConv_ilbc.pcm")));MARK(); (output_path + "singleUserDemoConv_ilbc.pcm").c_str()));MARK();
TEST_MUSTPASS(!file->ConvertCompressedToPCM( TEST_MUSTPASS(!file->ConvertCompressedToPCM(
GetResource("audio_long16.pcm"), (output_path + "audio_long16.pcm").c_str(),
GetFilename("singleUserDemoConv_dummy.pcm")));MARK(); (output_path + "singleUserDemoConv_dummy.pcm").c_str()));MARK();
AOK();ANL(); AOK();ANL();
#if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID) #if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)
@ -4696,15 +4704,18 @@ int VoEExtendedTest::TestFile() {
int dur; int dur;
TEST_MUSTPASS(file->GetFileDuration( TEST_MUSTPASS(file->GetFileDuration(
GetResource("audio_long16.pcm"), dur)); (output_path + "audio_long16.pcm").c_str(), dur));
TEST_MUSTPASS(file->GetFileDuration( TEST_MUSTPASS(file->GetFileDuration(
GetResource("audio_long8.pcm"), dur, kFileFormatPcm8kHzFile)); (output_path + "audio_long8.pcm").c_str(),
dur, kFileFormatPcm8kHzFile));
TEST_MUSTPASS(file->GetFileDuration( TEST_MUSTPASS(file->GetFileDuration(
GetResource("audio_long16.pcm"), dur, kFileFormatPcm16kHzFile)); (output_path + "audio_long16.pcm").c_str(),
dur, kFileFormatPcm16kHzFile));
TEST_MUSTPASS(file->GetFileDuration( TEST_MUSTPASS(file->GetFileDuration(
GetResource("audio_long16.wav"), dur, kFileFormatPcm8kHzFile)); (output_path + "audio_long16.wav").c_str(),
dur, kFileFormatPcm8kHzFile));
TEST_MUSTPASS(file->GetFileDuration( TEST_MUSTPASS(file->GetFileDuration(
GetFilename("singleUserDemoConv.ilbc"), dur, (output_path + "singleUserDemoConv.ilbc").c_str(), dur,
kFileFormatCompressedFile)); kFileFormatCompressedFile));
AOK(); AOK();
@ -4716,7 +4727,7 @@ int VoEExtendedTest::TestFile() {
int pos; int pos;
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource("audio_long16.pcm"))); 0, (output_path + "audio_long16.pcm").c_str()));
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(file->GetPlaybackPosition(0, pos)); TEST_MUSTPASS(file->GetPlaybackPosition(0, pos));
MARK(); // position should be ~1000 MARK(); // position should be ~1000
@ -4740,7 +4751,8 @@ int VoEExtendedTest::TestFile() {
for (int i = 0; i < 7; i++) { for (int i = 0; i < 7; i++) {
TEST_LOG("Playing file %s, in %s KHz \n", localFiles[i], freq[i]); TEST_LOG("Playing file %s, in %s KHz \n", localFiles[i], freq[i]);
TEST_MUSTPASS(file->StartPlayingFileLocally( TEST_MUSTPASS(file->StartPlayingFileLocally(
0, GetResource(localFiles[i]),false, kFileFormatWavFile, 1)); 0, (output_path + localFiles[i]).c_str(),
false, kFileFormatWavFile, 1));
SLEEP(4500); // The file should not end SLEEP(4500); // The file should not end
TEST_MUSTPASS(file->StopPlayingFileLocally(0)); TEST_MUSTPASS(file->StopPlayingFileLocally(0));
} }
@ -4939,8 +4951,8 @@ int VoEExtendedTest::TestHardware() {
VoEHardware* hardware = _mgr.HardwarePtr(); VoEHardware* hardware = _mgr.HardwarePtr();
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename( TEST_MUSTPASS(VoiceEngine::SetTraceFile((output_path +
"VoEHardware_trace.txt"))); "VoEHardware_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -5275,8 +5287,8 @@ int VoEExtendedTest::TestNetwork() {
VoENetwork* netw = _mgr.NetworkPtr(); VoENetwork* netw = _mgr.NetworkPtr();
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename( TEST_MUSTPASS(VoiceEngine::SetTraceFile((output_path +
"VoENetwork_trace.txt"))); "VoENetwork_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -6825,8 +6837,8 @@ int VoEExtendedTest::TestRTP_RTCP() {
#endif #endif
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename( TEST_MUSTPASS(VoiceEngine::SetTraceFile((output_path +
"VoERTP_RTCP_trace.txt"))); "VoERTP_RTCP_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -7054,11 +7066,12 @@ int VoEExtendedTest::TestRTP_RTCP() {
MARK(); MARK();
TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0, kRtpOutgoing)); TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0, kRtpOutgoing));
MARK(); MARK();
TEST_MUSTPASS(rtp_rtcp->StartRTPDump(0, GetFilename("dump_in_1sec.rtp"), std::string output_path = webrtc::test::OutputPath();
kRtpIncoming)); TEST_MUSTPASS(rtp_rtcp->StartRTPDump(
0, (output_path + "dump_in_1sec.rtp").c_str(), kRtpIncoming));
MARK(); MARK();
TEST_MUSTPASS(rtp_rtcp->StartRTPDump(0, GetFilename("dump_out_2sec.rtp"), TEST_MUSTPASS(rtp_rtcp->StartRTPDump(
kRtpOutgoing)); 0, (output_path + "dump_out_2sec.rtp").c_str(), kRtpOutgoing));
MARK(); MARK();
SLEEP(1000); SLEEP(1000);
TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0, kRtpIncoming)); TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0, kRtpIncoming));
@ -7073,7 +7086,7 @@ int VoEExtendedTest::TestRTP_RTCP() {
// //
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
TEST_MUSTPASS(rtp_rtcp->StartRTPDump(0, TEST_MUSTPASS(rtp_rtcp->StartRTPDump(0,
GetFilename("dump_in_200ms.rtp"))); (output_path + "dump_in_200ms.rtp").c_str()));
MARK(); MARK();
SLEEP(200); SLEEP(200);
TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0)); TEST_MUSTPASS(rtp_rtcp->StopRTPDump(0));
@ -7452,8 +7465,8 @@ int VoEExtendedTest::TestVideoSync()
} }
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename( TEST_MUSTPASS(VoiceEngine::SetTraceFile((output_path +
"VoEVideoSync_trace.txt"))); "VoEVideoSync_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -7554,7 +7567,7 @@ int VoEExtendedTest::TestVolumeControl()
#ifdef _USE_EXTENDED_TRACE_ #ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile( TEST_MUSTPASS(VoiceEngine::SetTraceFile(
GetFilename("VoEVolumeControl_trace.txt"))); (output_path + "VoEVolumeControl_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -7682,7 +7695,9 @@ int VoEExtendedTest::TestAPM() {
VoEAudioProcessing* apm = _mgr.APMPtr(); VoEAudioProcessing* apm = _mgr.APMPtr();
//#ifdef _USE_EXTENDED_TRACE_ //#ifdef _USE_EXTENDED_TRACE_
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("apm_trace.txt"))); std::string output_path = webrtc::test::OutputPath();
TEST_MUSTPASS(VoiceEngine::SetTraceFile(
(output_path + "apm_trace.txt").c_str()));
TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo | TEST_MUSTPASS(VoiceEngine::SetTraceFilter(kTraceStateInfo |
kTraceStateInfo | kTraceStateInfo |
kTraceWarning | kTraceWarning |
@ -8364,7 +8379,8 @@ int VoEExtendedTest::TestAPM() {
//////////////////////////// ////////////////////////////
// StopDebugRecording // StopDebugRecording
TEST_LOG("StartDebugRecording"); TEST_LOG("StartDebugRecording");
TEST_MUSTPASS(apm->StartDebugRecording(GetFilename("apm_debug.txt"))); TEST_MUSTPASS(apm->StartDebugRecording(
(output_path + "apm_debug.txt").c_str()));
SLEEP(1000); SLEEP(1000);
TEST_LOG("StopDebugRecording"); TEST_LOG("StopDebugRecording");
TEST_MUSTPASS(apm->StopDebugRecording()); TEST_MUSTPASS(apm->StopDebugRecording());

View File

@ -11,302 +11,41 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "engine_configurations.h" #include "engine_configurations.h"
#if defined(_WIN32) #if defined(_WIN32)
#include <conio.h> // exists only on windows #include <conio.h> // Exists only on windows.
#include <tchar.h> #include <tchar.h>
#endif #endif
#include "voe_standard_test.h" #include "voice_engine/main/test/auto_test/voe_standard_test.h"
#if defined (_ENABLE_VISUAL_LEAK_DETECTOR_) && defined(_DEBUG) && \ #if defined (_ENABLE_VISUAL_LEAK_DETECTOR_) && defined(_DEBUG) && \
defined(_WIN32) && !defined(_INSTRUMENTATION_TESTING_) defined(_WIN32) && !defined(_INSTRUMENTATION_TESTING_)
#include "vld.h" #include "vld.h"
#endif #endif
#ifdef MAC_IPHONE #include "system_wrappers/interface/critical_section_wrapper.h"
#include "../../source/voice_engine_defines.h" // defines build macros #include "system_wrappers/interface/event_wrapper.h"
#else #include "system_wrappers/interface/thread_wrapper.h"
#include "../../source/voice_engine_defines.h" // defines build macros #include "voice_engine/main/source/voice_engine_defines.h"
#endif #include "voice_engine/main/test/auto_test/automated_mode.h"
#include "automated_mode.h"
#include "critical_section_wrapper.h"
#include "event_wrapper.h"
#include "thread_wrapper.h"
#ifdef _TEST_NETEQ_STATS_ #ifdef _TEST_NETEQ_STATS_
#include "../../interface/voe_neteq_stats.h" // Not available in delivery folder #include "voice_engine/main/interface/voe_neteq_stats.h"
#endif #endif
#include "voe_extended_test.h" #include "voice_engine/main/test/auto_test/voe_cpu_test.h"
#include "voe_stress_test.h" #include "voice_engine/main/test/auto_test/voe_extended_test.h"
#include "voe_unit_test.h" #include "voice_engine/main/test/auto_test/voe_stress_test.h"
#include "voe_cpu_test.h" #include "voice_engine/main/test/auto_test/voe_unit_test.h"
using namespace webrtc; using namespace webrtc;
namespace voetest { namespace voetest {
#ifdef MAC_IPHONE
// Defined in iPhone specific test file
int GetDocumentsDir(char* buf, int bufLen);
char* GetFilename(char* filename);
const char* GetFilename(const char* filename);
int GetResource(char* resource, char* dest, int destLen);
char* GetResource(char* resource);
const char* GetResource(const char* resource);
// #ifdef MAC_IPHONE
#elif defined(WEBRTC_ANDROID)
char filenameStr[2][256];
int currentStr = 0;
char* GetFilename(char* filename) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/sdcard/%s", filename);
return filenameStr[currentStr];
}
const char* GetFilename(const char* filename) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/sdcard/%s", filename);
return filenameStr[currentStr];
}
int GetResource(char* resource, char* dest, int destLen) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/sdcard/%s", resource);
strncpy(dest, filenameStr[currentStr], destLen-1);
return 0;
}
char* GetResource(char* resource) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/sdcard/%s", resource);
return filenameStr[currentStr];
}
const char* GetResource(const char* resource) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/sdcard/%s", resource);
return filenameStr[currentStr];
}
#else
char filenameStr[2][256];
int currentStr = 0;
char* GetFilename(char* filename) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/tmp/%s", filename);
return filenameStr[currentStr];
}
const char* GetFilename(const char* filename) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/tmp/%s", filename);
return filenameStr[currentStr];
}
int GetResource(char* resource, char* dest, int destLen) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/tmp/%s", resource);
strncpy(dest, filenameStr[currentStr], destLen - 1);
return 0;
}
char* GetResource(char* resource) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/tmp/%s", resource);
return filenameStr[currentStr];
}
const char* GetResource(const char* resource) {
currentStr = !currentStr;
sprintf(filenameStr[currentStr], "/tmp/%s", resource);
return filenameStr[currentStr];
}
#endif
#if !defined(MAC_IPHONE)
const char* summaryFilename = "/tmp/VoiceEngineSummary.txt";
#endif
// For iPhone the summary filename is created in createSummary
int dummy = 0; // Dummy used in different functions to avoid warnings int dummy = 0; // Dummy used in different functions to avoid warnings
TestRtpObserver::TestRtpObserver() {
Reset();
}
TestRtpObserver::~TestRtpObserver() {
}
void TestRtpObserver::Reset() {
for (int i = 0; i < 2; i++) {
ssrc_[i] = 0;
csrc_[i][0] = 0;
csrc_[i][1] = 0;
added_[i][0] = false;
added_[i][1] = false;
size_[i] = 0;
}
}
void TestRtpObserver::OnIncomingCSRCChanged(const int channel,
const unsigned int CSRC,
const bool added) {
char msg[128];
sprintf(msg, "=> OnIncomingCSRCChanged(channel=%d, CSRC=%u, added=%d)\n",
channel, CSRC, added);
TEST_LOG("%s", msg);
if (channel > 1)
return; // Not enough memory.
csrc_[channel][size_[channel]] = CSRC;
added_[channel][size_[channel]] = added;
size_[channel]++;
if (size_[channel] == 2)
size_[channel] = 0;
}
void TestRtpObserver::OnIncomingSSRCChanged(const int channel,
const unsigned int SSRC) {
char msg[128];
sprintf(msg, "\n=> OnIncomingSSRCChanged(channel=%d, SSRC=%u)\n", channel,
SSRC);
TEST_LOG("%s", msg);
ssrc_[channel] = SSRC;
}
void MyDeadOrAlive::OnPeriodicDeadOrAlive(const int /*channel*/,
const bool alive) {
if (alive) {
TEST_LOG("ALIVE\n");
} else {
TEST_LOG("DEAD\n");
}
fflush(NULL);
}
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_) {
unsigned int id;
thread_->Start(id);
}
}
FakeExternalTransport::~FakeExternalTransport() {
if (thread_) {
thread_->SetNotAlive();
event_->Set();
if (thread_->Stop()) {
delete thread_;
thread_ = NULL;
delete event_;
event_ = NULL;
delete lock_;
lock_ = NULL;
}
}
}
bool FakeExternalTransport::Run(void* ptr) {
return static_cast<FakeExternalTransport*> (ptr)->Process();
}
bool FakeExternalTransport::Process() {
switch (event_->Wait(500)) {
case kEventSignaled:
lock_->Enter();
my_network_->ReceivedRTPPacket(channel_, packet_buffer_, length_);
lock_->Leave();
return true;
case kEventTimeout:
return true;
case kEventError:
break;
}
return true;
}
int FakeExternalTransport::SendPacket(int channel, const void *data, int len) {
lock_->Enter();
if (len < 1612) {
memcpy(packet_buffer_, (const unsigned char*) data, len);
length_ = len;
channel_ = channel;
}
lock_->Leave();
event_->Set(); // triggers ReceivedRTPPacket() from worker thread
return len;
}
int FakeExternalTransport::SendRTCPPacket(int channel, const void *data, int len) {
if (delay_is_enabled_) {
Sleep(delay_time_in_ms_);
}
my_network_->ReceivedRTCPPacket(channel, data, len);
return len;
}
void FakeExternalTransport::SetDelayStatus(bool enable, unsigned int delayInMs) {
delay_is_enabled_ = enable;
delay_time_in_ms_ = delayInMs;
}
ErrorObserver::ErrorObserver() {
code = -1;
}
void ErrorObserver::CallbackOnError(const int channel, const int errCode) {
code = errCode;
#ifndef _INSTRUMENTATION_TESTING_
TEST_LOG("\n************************\n");
TEST_LOG(" RUNTIME ERROR: %d \n", errCode);
TEST_LOG("************************\n");
#endif
}
void MyTraceCallback::Print(const TraceLevel level,
const char *traceString,
const int length) {
if (traceString) {
char* tmp = new char[length];
memcpy(tmp, traceString, length);
TEST_LOG("%s", tmp);
TEST_LOG("\n");
delete[] tmp;
}
}
void RtcpAppHandler::OnApplicationDataReceived(
const int /*channel*/, const unsigned char sub_type,
const unsigned int name, const unsigned char* data,
const unsigned short length_in_bytes) {
length_in_bytes_ = length_in_bytes;
memcpy(data_, &data[0], length_in_bytes);
sub_type_ = sub_type;
name_ = name;
}
void RtcpAppHandler::Reset() {
length_in_bytes_ = 0;
memset(data_, 0, sizeof(data_));
sub_type_ = 0;
name_ = 0;
}
void SubAPIManager::DisplayStatus() const { void SubAPIManager::DisplayStatus() const {
TEST_LOG("Supported sub APIs:\n\n"); TEST_LOG("Supported sub APIs:\n\n");
if (_base) if (_base)

View File

@ -62,110 +62,6 @@ extern char mobileLogMsg[640];
namespace voetest { namespace voetest {
void createSummary(VoiceEngine* ve);
void prepareDelivery();
class TestRtpObserver : public VoERTPObserver {
public:
TestRtpObserver();
virtual ~TestRtpObserver();
virtual void OnIncomingCSRCChanged(const int channel,
const unsigned int CSRC,
const bool added);
virtual void OnIncomingSSRCChanged(const int channel,
const unsigned int SSRC);
void Reset();
public:
unsigned int ssrc_[2];
unsigned int csrc_[2][2]; // Stores 2 CSRCs for each channel.
bool added_[2][2];
int size_[2];
};
class MyTraceCallback : public TraceCallback {
public:
void Print(const TraceLevel level, const char *traceString, const int length);
};
class MyDeadOrAlive : public VoEConnectionObserver {
public:
void OnPeriodicDeadOrAlive(const int channel, const bool alive);
};
class ErrorObserver : public VoiceEngineObserver {
public:
ErrorObserver();
void CallbackOnError(const int channel, const int errCode);
public:
int code;
};
class RtcpAppHandler : public VoERTCPObserver {
public:
void OnApplicationDataReceived(const int channel,
const unsigned char sub_type,
const unsigned int name,
const unsigned char* data,
const unsigned short length_in_bytes);
void Reset();
~RtcpAppHandler() {}
unsigned short length_in_bytes_;
unsigned char data_[256];
unsigned char sub_type_;
unsigned int name_;
};
class DtmfCallback : public VoETelephoneEventObserver {
public:
int counter;
DtmfCallback() {
counter = 0;
}
virtual void OnReceivedTelephoneEventInband(int channel,
int eventCode,
bool endOfEvent) {
char msg[128];
if (endOfEvent)
sprintf(msg, "(event=%d, [END])", eventCode);
else
sprintf(msg, "(event=%d, [START])", eventCode);
TEST_LOG("%s", msg);
if (!endOfEvent)
counter++; // cound start of event only
fflush(NULL);
}
virtual void OnReceivedTelephoneEventOutOfBand(int channel,
int eventCode,
bool endOfEvent) {
char msg[128];
if (endOfEvent)
sprintf(msg, "(event=%d, [END])", eventCode);
else
sprintf(msg, "(event=%d, [START])", eventCode);
TEST_LOG("%s", msg);
if (!endOfEvent)
counter++; // cound start of event only
fflush(NULL);
}
};
class RxCallback : public VoERxVadCallback {
public:
RxCallback() :
_vadDecision(-1) {
}
virtual void OnRxVad(int, int vadDecision) {
char msg[128];
sprintf(msg, "RX VAD detected decision %d \n", vadDecision);
TEST_LOG("%s", msg);
_vadDecision = vadDecision;
}
int _vadDecision;
};
class SubAPIManager { class SubAPIManager {
public: public:
SubAPIManager() SubAPIManager()

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@ -47,12 +47,6 @@ namespace voetest {
#define PAUSE_OR_SLEEP(x) SLEEP(x); #define PAUSE_OR_SLEEP(x) SLEEP(x);
#endif #endif
extern char* GetFilename(char* filename);
extern const char* GetFilename(const char* filename);
extern int GetResource(char* resource, char* dest, int destLen);
extern char* GetResource(char* resource);
extern const char* GetResource(const char* resource);
const char* VoEStressTest::_key = "====YUtFWRAAAAADBtIHgAAAAAEAAAAcAAAAAQBHU0ds" const char* VoEStressTest::_key = "====YUtFWRAAAAADBtIHgAAAAAEAAAAcAAAAAQBHU0ds"
"b2JhbCBJUCBTb3VuZAAC\nAAAAIwAAAExpY2Vuc2VkIHRvIE5vcnRlbCBOZXR3cm9rcwAAAAA" "b2JhbCBJUCBTb3VuZAAC\nAAAAIwAAAExpY2Vuc2VkIHRvIE5vcnRlbCBOZXR3cm9rcwAAAAA"
"xAAAAZxZ7/u0M\niFYyTwSwko5Uutf7mh8S0O4rYZYTFidbzQeuGonuL17F/2oD/2pfDp3jL4" "xAAAAZxZ7/u0M\niFYyTwSwko5Uutf7mh8S0O4rYZYTFidbzQeuGonuL17F/2oD/2pfDp3jL4"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@ -17,15 +17,8 @@
#include "common_types.h" #include "common_types.h"
namespace webrtc {
class CriticalSectionWrapper;
class EventWrapper;
class ThreadWrapper;
class VoENetwork;
}
namespace voetest { namespace voetest {
// TODO(andrew): using directives are not permitted. // TODO(andrew): Using directives not permitted.
using namespace webrtc; using namespace webrtc;
// TestType enumerator // TestType enumerator
@ -55,33 +48,6 @@ enum ExtendedSelection {
XSEL_AudioProcessing, XSEL_AudioProcessing,
}; };
// ----------------------------------------------------------------------------
// External transport (Transport)
// ----------------------------------------------------------------------------
class FakeExternalTransport : public Transport {
public:
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);
private:
static bool Run(void* ptr);
bool Process();
private:
ThreadWrapper* thread_;
CriticalSectionWrapper* lock_;
EventWrapper* event_;
private:
unsigned char packet_buffer_[1612];
int length_;
int channel_;
bool delay_is_enabled_;
int delay_time_in_ms_;
};
// Main test function // Main test function
int runAutoTest(TestType testType, ExtendedSelection extendedSel); int runAutoTest(TestType testType, ExtendedSelection extendedSel);

View File

@ -19,6 +19,7 @@
#endif #endif
#include "system_wrappers/interface/thread_wrapper.h" #include "system_wrappers/interface/thread_wrapper.h"
#include "testsupport/fileutils.h"
#include "voice_engine/main/source/voice_engine_defines.h" #include "voice_engine/main/source/voice_engine_defines.h"
#include "voice_engine/main/test/auto_test/fakes/fake_media_process.h" #include "voice_engine/main/test/auto_test/fakes/fake_media_process.h"
@ -35,19 +36,6 @@ namespace voetest {
return -1; \ return -1; \
} }
extern char* GetFilename(char* filename);
extern const char* GetFilename(const char* filename);
extern int GetResource(char* resource, char* dest, int destLen);
extern char* GetResource(char* resource);
extern const char* GetResource(const char* resource);
const char* VoEUnitTest::_key = "====YUtFWRAAAAADBtIHgAAAAAEAAAAcAAAAAQBHU0dsb2"
"JhbCBJUCBTb3VuZAAC\nAAAAIwAAAExpY2Vuc2VkIHRvIE5vcnRlbCBOZXR3cm9rcwAAAAAxA"
"AAAZxZ7/u0M\niFYyTwSwko5Uutf7mh8S0O4rYZYTFidbzQeuGonuL17F/2oD/2pfDp3jL4Rf"
"3z/A\nnlJsEJgEtASkDNFuwLILjGY0pzjjAYQp3pCl6z6k2MtE06AirdjGLYCjENpq/opX\nO"
"rs3sIuwdYK5va/aFcsjBDmlsGCUM48RDYG9s23bIHYafXUC4ofOaubbZPWiPTmL\nEVJ8WH4F"
"9pgNjALc14oJXfON7r/3\n=EsLx";
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// >>> R E A D M E F I R S T <<< // >>> R E A D M E F I R S T <<<
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -286,8 +274,9 @@ int VoEUnitTest::StartMedia(int channel, int rtpPort, bool listen, bool playout,
true, mixWithMic)); true, mixWithMic));
} }
if (localFile) { if (localFile) {
std::string inputFile = webrtc::test::OutputPath() + "audio_short16.pcm";
CHECK(file->StartPlayingFileLocally(channel, CHECK(file->StartPlayingFileLocally(channel,
GetResource("audio_short16.pcm"), inputFile.c_str(),
false, false,
kFileFormatPcm16kHzFile)); kFileFormatPcm16kHzFile));
} }
@ -369,7 +358,9 @@ int VoEUnitTest::MixerTest() {
// Set trace // Set trace
// //
VoiceEngine::SetTraceFile(GetFilename("UnitTest_Mixer_trace.txt")); std::string outputDir = webrtc::test::OutputPath();
std::string traceFile = outputDir + "UnitTest_Mixer_trace.txt";
VoiceEngine::SetTraceFile(outputDir.c_str());
VoiceEngine::SetTraceFilter(kTraceStateInfo | kTraceWarning | kTraceError | VoiceEngine::SetTraceFilter(kTraceStateInfo | kTraceWarning | kTraceError |
kTraceCritical | kTraceApiCall | kTraceMemory | kTraceCritical | kTraceApiCall | kTraceMemory |
kTraceInfo); kTraceInfo);
@ -416,7 +407,8 @@ int VoEUnitTest::MixerTest() {
Sleep(testTime); Sleep(testTime);
Test("(ch 0) Playing 16kHz file locally <=> mixing at 16kHz..."); Test("(ch 0) Playing 16kHz file locally <=> mixing at 16kHz...");
CHECK(file->StartPlayingFileLocally(0, GetResource("audio_long16.pcm"), std::string inputFile = outputDir + "audio_long16.pcm";
CHECK(file->StartPlayingFileLocally(0, inputFile.c_str(),
false, kFileFormatPcm16kHzFile)); false, kFileFormatPcm16kHzFile));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
@ -720,15 +712,18 @@ int VoEUnitTest::MixerTest() {
Sleep(testTime); Sleep(testTime);
Test("(ch 0) Recording of playout to 16kHz PCM file..."); Test("(ch 0) Recording of playout to 16kHz PCM file...");
std::string recordedPlayoutFile = webrtc::test::OutputPath() +
"RecordedPlayout16kHz.pcm";
CHECK(file->StartRecordingPlayout( CHECK(file->StartRecordingPlayout(
0, GetFilename("RecordedPlayout16kHz.pcm"), NULL)); 0, recordedPlayoutFile.c_str(), NULL));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopRecordingPlayout(0)); CHECK(file->StopRecordingPlayout(0));
Test("(ch 0) Playing out the recorded file..."); Test("(ch 0) Playing out the recorded file...");
CHECK(volume->SetInputMute(0, true)); CHECK(volume->SetInputMute(0, true));
CHECK(file->StartPlayingFileLocally( CHECK(file->StartPlayingFileLocally(
0, GetFilename("RecordedPlayout16kHz.pcm"))); 0, recordedPlayoutFile.c_str()));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
CHECK(volume->SetInputMute(0, false)); CHECK(volume->SetInputMute(0, false));
@ -739,14 +734,14 @@ int VoEUnitTest::MixerTest() {
Test("(ch 0) Recording of playout to 16kHz PCM file..."); Test("(ch 0) Recording of playout to 16kHz PCM file...");
CHECK(file->StartRecordingPlayout( CHECK(file->StartRecordingPlayout(
0, GetFilename("RecordedPlayout16kHz.pcm"), NULL)); 0, recordedPlayoutFile.c_str(), NULL));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopRecordingPlayout(0)); CHECK(file->StopRecordingPlayout(0));
Test("(ch 0) Playing out the recorded file..."); Test("(ch 0) Playing out the recorded file...");
CHECK(volume->SetInputMute(0, true)); CHECK(volume->SetInputMute(0, true));
CHECK(file->StartPlayingFileLocally( CHECK(file->StartPlayingFileLocally(
0, GetFilename("RecordedPlayout16kHz.pcm"))); 0, recordedPlayoutFile.c_str()));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
CHECK(volume->SetInputMute(0, false)); CHECK(volume->SetInputMute(0, false));
@ -757,14 +752,14 @@ int VoEUnitTest::MixerTest() {
Test("(ch 0) Recording of playout to 16kHz PCM file..."); Test("(ch 0) Recording of playout to 16kHz PCM file...");
CHECK(file->StartRecordingPlayout( CHECK(file->StartRecordingPlayout(
0, GetFilename("RecordedPlayout16kHz.pcm"), NULL)); 0, recordedPlayoutFile.c_str(), NULL));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopRecordingPlayout(0)); CHECK(file->StopRecordingPlayout(0));
Test("(ch 0) Playing out the recorded file..."); Test("(ch 0) Playing out the recorded file...");
CHECK(volume->SetInputMute(0, true)); CHECK(volume->SetInputMute(0, true));
CHECK(file->StartPlayingFileLocally( CHECK(file->StartPlayingFileLocally(
0, GetFilename("RecordedPlayout16kHz.pcm"))); 0, recordedPlayoutFile.c_str()));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
CHECK(volume->SetInputMute(0, false)); CHECK(volume->SetInputMute(0, false));
@ -778,14 +773,14 @@ int VoEUnitTest::MixerTest() {
Test("(ch 0) Recording of playout to 16kHz PCM file..."); Test("(ch 0) Recording of playout to 16kHz PCM file...");
CHECK(file->StartRecordingPlayout( CHECK(file->StartRecordingPlayout(
0, GetFilename("RecordedPlayout16kHz.pcm"), NULL)); 0, recordedPlayoutFile.c_str(), NULL));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopRecordingPlayout(0)); CHECK(file->StopRecordingPlayout(0));
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
Test("(ch 0) Playing out the recorded file..."); Test("(ch 0) Playing out the recorded file...");
CHECK(file->StartPlayingFileLocally( CHECK(file->StartPlayingFileLocally(
0, GetFilename("RecordedPlayout16kHz.pcm"))); 0, recordedPlayoutFile.c_str()));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
@ -802,7 +797,7 @@ int VoEUnitTest::MixerTest() {
Test("(ch -1) Speak while recording all channels to add mixer input on " Test("(ch -1) Speak while recording all channels to add mixer input on "
"channel 0..."); "channel 0...");
CHECK(file->StartRecordingPlayout( CHECK(file->StartRecordingPlayout(
-1, GetFilename("RecordedPlayout16kHz.pcm"), NULL)); -1, recordedPlayoutFile.c_str(), NULL));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopRecordingPlayout(-1)); CHECK(file->StopRecordingPlayout(-1));
CHECK(file->StopPlayingFileLocally(1)); CHECK(file->StopPlayingFileLocally(1));
@ -810,7 +805,7 @@ int VoEUnitTest::MixerTest() {
Test("(ch 0) Playing out the recorded file..."); Test("(ch 0) Playing out the recorded file...");
CHECK(volume->SetInputMute(0, true)); CHECK(volume->SetInputMute(0, true));
CHECK(file->StartPlayingFileLocally( CHECK(file->StartPlayingFileLocally(
0, GetFilename("RecordedPlayout16kHz.pcm"))); 0, recordedPlayoutFile.c_str()));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
CHECK(volume->SetInputMute(0, false)); CHECK(volume->SetInputMute(0, false));
@ -845,15 +840,15 @@ int VoEUnitTest::MixerTest() {
Test("(ch 0) Playing out the recorded file for the left channel (10%%)..."); Test("(ch 0) Playing out the recorded file for the left channel (10%%)...");
CHECK(volume->SetInputMute(0, true)); CHECK(volume->SetInputMute(0, true));
CHECK(file->StartPlayingFileLocally( std::string leftFilename = outputDir + "RecordedPlayout_Left_16kHz.pcm";
0, GetFilename("RecordedPlayout_Left_16kHz.pcm"))); CHECK(file->StartPlayingFileLocally(0, leftFilename.c_str()));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
Test("(ch 0) Playing out the recorded file for the right channel (100%%) =>" Test("(ch 0) Playing out the recorded file for the right channel (100%%) =>"
" should sound louder than the left channel..."); " should sound louder than the left channel...");
CHECK(file->StartPlayingFileLocally( std::string rightFilename = outputDir + "RecordedPlayout_Right_16kHz.pcm";
0, GetFilename("RecordedPlayout_Right_16kHz.pcm"))); CHECK(file->StartPlayingFileLocally(0, rightFilename.c_str()));
Sleep(testTime); Sleep(testTime);
CHECK(file->StopPlayingFileLocally(0)); CHECK(file->StopPlayingFileLocally(0));
CHECK(volume->SetInputMute(0, false)); CHECK(volume->SetInputMute(0, false));

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@ -11,7 +11,7 @@
#ifndef WEBRTC_VOICE_ENGINE_VOE_UNIT_TEST_H #ifndef WEBRTC_VOICE_ENGINE_VOE_UNIT_TEST_H
#define WEBRTC_VOICE_ENGINE_VOE_UNIT_TEST_H #define WEBRTC_VOICE_ENGINE_VOE_UNIT_TEST_H
#include "voe_standard_test.h" #include "voice_engine/main/test/auto_test/voe_standard_test.h"
namespace voetest { namespace voetest {
@ -52,7 +52,6 @@ class VoEUnitTest : public Encryption {
private: private:
VoETestManager& _mgr; VoETestManager& _mgr;
static const char* _key;
private: private:
bool _listening[32]; bool _listening[32];

View File

@ -30,6 +30,8 @@
], ],
'sources': [ 'sources': [
'auto_test/automated_mode.cc', 'auto_test/automated_mode.cc',
'auto_test/fakes/fake_external_transport.cc',
'auto_test/fakes/fake_external_transport.h',
'auto_test/fixtures/after_initialization_fixture.cc', 'auto_test/fixtures/after_initialization_fixture.cc',
'auto_test/fixtures/after_initialization_fixture.h', 'auto_test/fixtures/after_initialization_fixture.h',
'auto_test/fixtures/after_streaming_fixture.cc', 'auto_test/fixtures/after_streaming_fixture.cc',

View File

@ -403,14 +403,14 @@ void TelephoneEventObserver::OnReceivedTelephoneEventOutOfBand(int channel,
class RxCallback : public VoERxVadCallback class RxCallback : public VoERxVadCallback
{ {
public: public:
RxCallback() : _vadDecision(-1) {}; RxCallback() : vad_decision(-1) {};
virtual void OnRxVad(int , int vadDecision) virtual void OnRxVad(int , int vadDecision)
{ {
_vadDecision = vadDecision; vad_decision = vadDecision;
} }
int _vadDecision; int vad_decision;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -3495,7 +3495,7 @@ void CWinTestDlg::OnTimer(UINT_PTR nIDEvent)
if (_rxVad && _veApmPtr && _rxVadObserverPtr) if (_rxVad && _veApmPtr && _rxVadObserverPtr)
{ {
SetDlgItemInt(IDC_EDIT_RXVAD, _rxVadObserverPtr->_vadDecision); SetDlgItemInt(IDC_EDIT_RXVAD, _rxVadObserverPtr->vad_decision);
} }
if (_veHardwarePtr) if (_veHardwarePtr)