Replace ANDROID with WEBRTC_ANDROID

Review URL: http://webrtc-codereview.appspot.com/91010

git-svn-id: http://webrtc.googlecode.com/svn/trunk@283 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@google.com 2011-08-01 17:36:09 +00:00
parent b5c49ff8af
commit f1ed5ad038
7 changed files with 71 additions and 71 deletions

View File

@ -198,7 +198,7 @@ int VoEAudioProcessingImpl::SetAgcStatus(bool enable, AgcModes mode)
return -1; return -1;
} }
#if defined(MAC_IPHONE) || defined(ATA) || defined(ANDROID) #if defined(MAC_IPHONE) || defined(ATA) || defined(WEBRTC_ANDROID)
if (mode == kAgcAdaptiveAnalog) if (mode == kAgcAdaptiveAnalog)
{ {
_engineStatistics.SetLastError( _engineStatistics.SetLastError(

View File

@ -702,7 +702,7 @@ int VoEHardwareImpl::SetLoudspeakerStatus(bool enable)
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError); _engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);
return -1; return -1;
} }
#if defined(ANDROID) #if defined(WEBRTC_ANDROID)
if (_audioDevicePtr->SetLoudspeakerStatus(enable) < 0) if (_audioDevicePtr->SetLoudspeakerStatus(enable) < 0)
{ {
_engineStatistics.SetLastError(VE_IGNORED_FUNCTION, kTraceError, _engineStatistics.SetLastError(VE_IGNORED_FUNCTION, kTraceError,
@ -725,7 +725,7 @@ int VoEHardwareImpl::GetLoudspeakerStatus(bool& enabled)
"GetLoudspeakerStatus()"); "GetLoudspeakerStatus()");
IPHONE_NOT_SUPPORTED(); IPHONE_NOT_SUPPORTED();
#if defined(ANDROID) #if defined(WEBRTC_ANDROID)
if (!_engineStatistics.Initialized()) if (!_engineStatistics.Initialized())
{ {
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError); _engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);

View File

@ -10,7 +10,7 @@
#include "voice_engine_impl.h" #include "voice_engine_impl.h"
#include "trace.h" #include "trace.h"
#ifdef ANDROID #ifdef WEBRTC_ANDROID
#include "audio_device.h" // SetAndroidObjects #include "audio_device.h" // SetAndroidObjects
#endif #endif
@ -300,7 +300,7 @@ bool VoiceEngine::Delete(VoiceEngine*& voiceEngine, bool ignoreRefCounters)
int VoiceEngine::SetAndroidObjects(void* javaVM, void* env, void* context) int VoiceEngine::SetAndroidObjects(void* javaVM, void* env, void* context)
{ {
#ifdef ANDROID #ifdef WEBRTC_ANDROID
return AudioDeviceModule::SetAndroidObjects(javaVM, env, context); return AudioDeviceModule::SetAndroidObjects(javaVM, env, context);
#else #else
return -1; return -1;

View File

@ -48,7 +48,7 @@ extern char micFile[256];
extern const char* micFile; extern const char* micFile;
#endif #endif
#ifdef ANDROID #ifdef WEBRTC_ANDROID
// Global pointers // Global pointers
extern void* globalJavaVM; extern void* globalJavaVM;
extern void* globalContext; extern void* globalContext;
@ -433,7 +433,7 @@ int VoEExtendedTest::TestBase()
TEST_MUSTPASS(base->Init()); TEST_MUSTPASS(base->Init());
MARK(); MARK();
TEST_MUSTPASS(base->Terminate()); TEST_MUSTPASS(base->Terminate());
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// verify AEC recording // verify AEC recording
TEST_MUSTPASS(base->Init()); TEST_MUSTPASS(base->Init());
MARK(); // verify output dat-files MARK(); // verify output dat-files
@ -3452,7 +3452,7 @@ int VoEExtendedTest::TestDtmf()
SLEEP(1000); SLEEP(1000);
// Switch codec // Switch codec
CodecInst ci; CodecInst ci;
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
ci.channels = 1; ci.channels = 1;
ci.pacsize = 480; ci.pacsize = 480;
ci.plfreq = 16000; ci.plfreq = 16000;
@ -4720,7 +4720,7 @@ int VoEExtendedTest::TestFile()
// Record mixed (speaker + microphone) signal to file // Record mixed (speaker + microphone) signal to file
#if !defined(MAC_IPHONE) && !defined(ANDROID) #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
TEST(StartRecordingSpeakerStereo); TEST(StartRecordingSpeakerStereo);
ANL(); ANL();
TEST(StopRecordingSpeakerStereo); TEST(StopRecordingSpeakerStereo);
@ -4757,11 +4757,11 @@ int VoEExtendedTest::TestFile()
ANL(); ANL();
#else #else
TEST_LOG("Skipping stereo record tests -" TEST_LOG("Skipping stereo record tests -"
" MAC_IPHONE or ANDROID is defined \n"); " MAC_IPHONE or WEBRTC_ANDROID is defined \n");
#endif // #if !defined(MAC_IPHONE) && !defined(ANDROID) #endif // #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
// Conversion between different file formats // Conversion between different file formats
#if defined(MAC_IPHONE) || defined(ANDROID) #if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)
TEST_MUSTPASS(base->StopPlayout(0)); TEST_MUSTPASS(base->StopPlayout(0));
TEST_MUSTPASS(base->StopSend(0)); TEST_MUSTPASS(base->StopSend(0));
#endif #endif
@ -4818,7 +4818,7 @@ int VoEExtendedTest::TestFile()
GetFilename("singleUserDemoConv_dummy.pcm"))); MARK(); GetFilename("singleUserDemoConv_dummy.pcm"))); MARK();
AOK(); ANL(); AOK(); ANL();
#if defined(MAC_IPHONE) || defined(ANDROID) #if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID)
TEST_MUSTPASS(base->StartPlayout(0)); TEST_MUSTPASS(base->StartPlayout(0));
TEST_MUSTPASS(base->StartSend(0)); TEST_MUSTPASS(base->StartSend(0));
#endif #endif
@ -4966,7 +4966,7 @@ int VoEExtendedTest::TestHardware()
TEST_MUSTPASS(base->Terminate()); TEST_MUSTPASS(base->Terminate());
// end _WIN32 // end _WIN32
#elif defined(WEBRTC_LINUX) && !defined(ANDROID) #elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
wantedLayer = kAudioLinuxPulse; wantedLayer = kAudioLinuxPulse;
TEST_MUSTPASS(hardware->SetAudioDeviceLayer(wantedLayer)); TEST_MUSTPASS(hardware->SetAudioDeviceLayer(wantedLayer));
TEST_LOG("If you run on Linux with no/unsupported PA version, PulseAudio " TEST_LOG("If you run on Linux with no/unsupported PA version, PulseAudio "
@ -5006,7 +5006,7 @@ int VoEExtendedTest::TestHardware()
} }
TEST_MUSTPASS(base->Terminate()); TEST_MUSTPASS(base->Terminate());
#endif // defined(WEBRTC_LINUX) && !defined(ANDROID) #endif // defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
// Invalid arguments // Invalid arguments
wantedLayer = (AudioLayers) 17; wantedLayer = (AudioLayers) 17;
TEST_MUSTPASS(-1 != hardware->SetAudioDeviceLayer(wantedLayer)); TEST_MUSTPASS(-1 != hardware->SetAudioDeviceLayer(wantedLayer));
@ -5052,7 +5052,7 @@ int VoEExtendedTest::TestHardware()
} }
ANL(); ANL();
#if !defined(MAC_IPHONE) && !defined(ANDROID) #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
// GetRecording/PlayoutDeviceStatus // GetRecording/PlayoutDeviceStatus
TEST(Getrecording/PlayoutDeviceStatus); TEST(Getrecording/PlayoutDeviceStatus);
ANL(); ANL();
@ -5154,7 +5154,7 @@ int VoEExtendedTest::TestHardware()
MARK(); MARK();
#endif #endif
ANL(); ANL();
#endif // #if !defined(MAC_IPHONE) && !defined(ANDROID) #endif // #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
#if defined(MAC_IPHONE) #if defined(MAC_IPHONE)
TEST(ResetSoundDevice); ANL(); TEST(ResetSoundDevice); ANL();
@ -5232,7 +5232,7 @@ int VoEExtendedTest::TestNetwork()
{ {
PrepareTest("Network"); PrepareTest("Network");
#ifdef ANDROID #ifdef WEBRTC_ANDROID
int sleepTime = 200; int sleepTime = 200;
int sleepTime2 = 250; int sleepTime2 = 250;
#elif defined(MAC_IPHONE) // MAC_IPHONE needs more delay for getSourceInfo() #elif defined(MAC_IPHONE) // MAC_IPHONE needs more delay for getSourceInfo()
@ -5298,7 +5298,7 @@ int VoEExtendedTest::TestNetwork()
TEST_MUSTPASS(netw->GetLocalIP(localIP)); TEST_MUSTPASS(netw->GetLocalIP(localIP));
MARK(); MARK();
#if !defined(WEBRTC_MAC) && !defined(ANDROID) #if !defined(WEBRTC_MAC) && !defined(WEBRTC_ANDROID)
// default function calls (IPv6) // default function calls (IPv6)
TEST_MUSTPASS(netw->GetLocalIP(localIP, true)); TEST_MUSTPASS(netw->GetLocalIP(localIP, true));
MARK(); MARK();
@ -5590,7 +5590,7 @@ int VoEExtendedTest::TestNetwork()
MARK(); MARK();
// STATE: external transport is disabled // STATE: external transport is disabled
#if defined(ANDROID) || defined(MAC_IPHONE) #if defined(WEBRTC_ANDROID) || defined(MAC_IPHONE)
int testError = VE_FUNC_NOT_SUPPORTED; int testError = VE_FUNC_NOT_SUPPORTED;
#else #else
int testError = VE_EXTERNAL_TRANSPORT_ENABLED; int testError = VE_EXTERNAL_TRANSPORT_ENABLED;
@ -6425,7 +6425,7 @@ int VoEExtendedTest::TestNetwork()
// END #if defined(_WIN32) || defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) // END #if defined(_WIN32) || defined(WEBRTC_MAC) || defined(WEBRTC_LINUX)
#else #else
TEST_LOG( "Skipping ToS tests - _WIN32, LINUX, MAC is not defined or " TEST_LOG( "Skipping ToS tests - _WIN32, LINUX, MAC is not defined or "
"ANDROID is defined"); "WEBRTC_ANDROID is defined");
#endif #endif
// >> end of SetSendTOS // >> end of SetSendTOS
@ -6731,7 +6731,7 @@ int VoEExtendedTest::TestRTP_RTCP()
XRTPObserver rtpObserver; XRTPObserver rtpObserver;
#ifdef ANDROID #ifdef WEBRTC_ANDROID
int sleepTime = 200; int sleepTime = 200;
#else #else
int sleepTime = 100; int sleepTime = 100;
@ -7119,7 +7119,7 @@ int VoEExtendedTest::TestRTP_RTCP()
VoECodec* codec = _mgr.CodecPtr(); VoECodec* codec = _mgr.CodecPtr();
TEST_MUSTPASS(NULL == codec); TEST_MUSTPASS(NULL == codec);
CodecInst cinst; CodecInst cinst;
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
cinst.pltype = 104; cinst.pltype = 104;
strcpy(cinst.plname, "isac"); strcpy(cinst.plname, "isac");
cinst.plfreq = 32000; cinst.plfreq = 32000;
@ -7295,7 +7295,7 @@ TEST(RTCPStatistics #2);
cinst.channels = 1; cinst.channels = 1;
cinst.rate = 0; cinst.rate = 0;
TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst)); TEST_MUSTPASS(codec->SetRecPayloadType(0, cinst));
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
cinst.pltype = 104; cinst.pltype = 104;
strcpy(cinst.plname, "isac"); strcpy(cinst.plname, "isac");
cinst.plfreq = 32000; cinst.plfreq = 32000;
@ -7473,7 +7473,7 @@ int VoEExtendedTest::TestVolumeControl()
TEST_MUSTPASS(base->Init()); TEST_MUSTPASS(base->Init());
TEST_MUSTPASS(base->CreateChannel()); TEST_MUSTPASS(base->CreateChannel());
#if (defined _TEST_HARDWARE_ && (!defined(MAC_IPHONE) && !defined(ANDROID))) #if (defined _TEST_HARDWARE_ && (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)))
#if defined(_WIN32) #if defined(_WIN32)
TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); TEST_MUSTPASS(hardware->SetRecordingDevice(-1));
TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); TEST_MUSTPASS(hardware->SetPlayoutDevice(-1));
@ -7503,12 +7503,12 @@ int VoEExtendedTest::TestVolumeControl()
ANL(); ANL();
#endif // #if !defined(MAC_IPHONE) #endif // #if !defined(MAC_IPHONE)
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
TEST(SetMicVolume); ANL(); TEST(SetMicVolume); ANL();
TEST_MUSTPASS(-1 != volume->SetMicVolume(256)); MARK(); TEST_MUSTPASS(-1 != volume->SetMicVolume(256)); MARK();
TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError());
ANL(); ANL();
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
#if !defined(MAC_IPHONE) #if !defined(MAC_IPHONE)
TEST(SetChannelOutputVolumeScaling); TEST(SetChannelOutputVolumeScaling);
@ -7521,7 +7521,7 @@ int VoEExtendedTest::TestVolumeControl()
TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError());
ANL(); ANL();
#endif // #if !defined(MAC_IPHONE) #endif // #if !defined(MAC_IPHONE)
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
TEST(SetOutputVolumePan); TEST(SetOutputVolumePan);
ANL(); ANL();
TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(-1, (float)-0.1, TEST_MUSTPASS(-1 != volume->SetOutputVolumePan(-1, (float)-0.1,
@ -7561,7 +7561,7 @@ int VoEExtendedTest::TestVolumeControl()
MARK(); MARK();
TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError()); TEST_MUSTPASS(VE_INVALID_ARGUMENT != base->LastError());
ANL(); ANL();
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
#ifdef _TEST_FILE_ #ifdef _TEST_FILE_
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0));
#endif #endif
@ -7618,7 +7618,7 @@ int VoEExtendedTest::TestAPM()
AecmModes AECMmode(kAecmSpeakerphone); AecmModes AECMmode(kAecmSpeakerphone);
bool enabledCNG(false); bool enabledCNG(false);
#if (defined(MAC_IPHONE) || defined(ANDROID)) #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
const EcModes ECmodeDefault(kEcAecm); const EcModes ECmodeDefault(kEcAecm);
#else #else
const EcModes ECmodeDefault(kEcAec); const EcModes ECmodeDefault(kEcAec);
@ -7638,7 +7638,7 @@ int VoEExtendedTest::TestAPM()
TEST_MUSTPASS(ECmode != ECmodeDefault); TEST_MUSTPASS(ECmode != ECmodeDefault);
SLEEP(ECSleep); SLEEP(ECSleep);
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// set kEcAec mode // set kEcAec mode
TEST_MUSTPASS(apm->SetEcStatus(true, kEcAec)); TEST_MUSTPASS(apm->SetEcStatus(true, kEcAec));
TEST_MUSTPASS(apm->GetEcStatus(enabled, ECmode)); TEST_MUSTPASS(apm->GetEcStatus(enabled, ECmode));
@ -7654,7 +7654,7 @@ int VoEExtendedTest::TestAPM()
TEST_MUSTPASS(enabled != true); TEST_MUSTPASS(enabled != true);
TEST_MUSTPASS(ECmode != kEcAec); TEST_MUSTPASS(ECmode != kEcAec);
SLEEP(ECSleep); SLEEP(ECSleep);
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// get default AECM mode, should the kAecmSpeakerphone as default // get default AECM mode, should the kAecmSpeakerphone as default
TEST_MUSTPASS(apm->GetAecmMode(AECMmode, enabledCNG)); TEST_MUSTPASS(apm->GetAecmMode(AECMmode, enabledCNG));
TEST_MUSTPASS(AECMmode != kAecmSpeakerphone); TEST_MUSTPASS(AECMmode != kAecmSpeakerphone);
@ -7746,7 +7746,7 @@ int VoEExtendedTest::TestAPM()
AgcModes AGCmode(kAgcAdaptiveAnalog); AgcModes AGCmode(kAgcAdaptiveAnalog);
#if (defined(MAC_IPHONE) || defined(ANDROID)) #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
bool enabledDefault = false; bool enabledDefault = false;
AgcModes AGCmodeDefault(kAgcAdaptiveDigital); AgcModes AGCmodeDefault(kAgcAdaptiveDigital);
#else #else
@ -7775,14 +7775,14 @@ int VoEExtendedTest::TestAPM()
TEST_MUSTPASS(AGCmode != kAgcFixedDigital); TEST_MUSTPASS(AGCmode != kAgcFixedDigital);
SLEEP(AGCSleep); SLEEP(AGCSleep);
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// set kAgcAdaptiveAnalog mode // set kAgcAdaptiveAnalog mode
TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveAnalog)); TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveAnalog));
TEST_MUSTPASS(apm->GetAgcStatus(enabled, AGCmode)); TEST_MUSTPASS(apm->GetAgcStatus(enabled, AGCmode));
TEST_LOG("AGC: enabled=%d, AGCmode=%d\n", enabled, AGCmode); TEST_LOG("AGC: enabled=%d, AGCmode=%d\n", enabled, AGCmode);
TEST_MUSTPASS(AGCmode != kAgcAdaptiveAnalog); TEST_MUSTPASS(AGCmode != kAgcAdaptiveAnalog);
SLEEP(AGCSleep); SLEEP(AGCSleep);
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// set kAgcAdaptiveDigital mode // set kAgcAdaptiveDigital mode
TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveDigital)); TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveDigital));
TEST_MUSTPASS(apm->GetAgcStatus(enabled, AGCmode)); TEST_MUSTPASS(apm->GetAgcStatus(enabled, AGCmode));
@ -7972,7 +7972,7 @@ digitalCompressionGaindBDefault);
////////////////////////////////// //////////////////////////////////
// Speech, Noise and Echo Metrics // Speech, Noise and Echo Metrics
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// TODO(xians), enable the tests when APM is ready // TODO(xians), enable the tests when APM is ready
/* /*
TEST(GetMetricsStatus); TEST(GetMetricsStatus);
@ -8055,7 +8055,7 @@ digitalCompressionGaindBDefault);
AOK(); AOK();
ANL(); ANL();
*/ */
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// far-end AudioProcessing // far-end AudioProcessing
/////// ///////
// AGC // AGC

View File

@ -141,7 +141,7 @@ const char* GetResource(const char* resource)
char micFile[256] = {0}; // Filename copied to buffer in code char micFile[256] = {0}; // Filename copied to buffer in code
#elif defined(WEBRTC_MAC) && !defined(WEBRTC_MAC_INTEL) #elif defined(WEBRTC_MAC) && !defined(WEBRTC_MAC_INTEL)
const char* micFile = "audio_long16bigendian.pcm"; const char* micFile = "audio_long16bigendian.pcm";
#elif defined(ANDROID) #elif defined(WEBRTC_ANDROID)
const char* micFile = "/sdcard/audio_long16.pcm"; const char* micFile = "/sdcard/audio_long16.pcm";
#elif defined(_WIN32) #elif defined(_WIN32)
// File path is relative to the location of 'voice_engine.gyp'. // File path is relative to the location of 'voice_engine.gyp'.
@ -959,7 +959,7 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS( base->Init()); TEST_MUSTPASS( base->Init());
#endif #endif
#if defined(ANDROID) #if defined(WEBRTC_ANDROID)
TEST_LOG("Setting loudspeaker status to false \n"); TEST_LOG("Setting loudspeaker status to false \n");
TEST_MUSTPASS(hardware->SetLoudspeakerStatus(false)); TEST_MUSTPASS(hardware->SetLoudspeakerStatus(false));
#endif #endif
@ -1077,12 +1077,12 @@ int VoETestManager::DoStandardTest()
#else #else
TEST_MUSTPASS(!hardware->GetCPULoad(loadPercent)); TEST_MUSTPASS(!hardware->GetCPULoad(loadPercent));
#endif #endif
#if !defined(MAC_IPHONE) & !defined(ANDROID) #if !defined(MAC_IPHONE) & !defined(WEBRTC_ANDROID)
TEST_MUSTPASS(hardware->GetSystemCPULoad(loadPercent)); TEST_MUSTPASS(hardware->GetSystemCPULoad(loadPercent));
TEST_LOG("GetSystemCPULoad => %d%%\n", loadPercent); TEST_LOG("GetSystemCPULoad => %d%%\n", loadPercent);
#endif #endif
#if !defined(MAC_IPHONE) && !defined(ANDROID) #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
bool playAvail = false, recAvail = false; bool playAvail = false, recAvail = false;
TEST_LOG("Get device status \n"); TEST_LOG("Get device status \n");
TEST_MUSTPASS(hardware->GetPlayoutDeviceStatus(playAvail)); TEST_MUSTPASS(hardware->GetPlayoutDeviceStatus(playAvail));
@ -1091,7 +1091,7 @@ int VoETestManager::DoStandardTest()
#endif #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(ANDROID)) #if (defined(WEBRTC_MAC) && !defined(MAC_IPHONE)) || defined(_WIN32) || (defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID))
int idx, nRec = 0, nPlay = 0; int idx, nRec = 0, nPlay = 0;
char devName[128] = {0}; char devName[128] = {0};
char guidName[128] = {0}; char guidName[128] = {0};
@ -1157,7 +1157,7 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); TEST_MUSTPASS(hardware->SetRecordingDevice(-1));
TEST_MUSTPASS(hardware->SetPlayoutDevice(-1)); TEST_MUSTPASS(hardware->SetPlayoutDevice(-1));
#else #else
#if !defined(MAC_IPHONE) && !defined(ANDROID) #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
TEST_MUSTPASS(hardware->SetRecordingDevice(0)); TEST_MUSTPASS(hardware->SetRecordingDevice(0));
TEST_MUSTPASS(hardware->SetPlayoutDevice(0)); TEST_MUSTPASS(hardware->SetPlayoutDevice(0));
#endif #endif
@ -1955,7 +1955,7 @@ int VoETestManager::DoStandardTest()
TEST_LOG("\n\n+++ More hardware tests +++\n\n"); TEST_LOG("\n\n+++ More hardware tests +++\n\n");
#if !defined(MAC_IPHONE) && !defined(ANDROID) #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
#ifdef _WIN32 #ifdef _WIN32
// should works also while already recording // should works also while already recording
TEST_MUSTPASS(hardware->SetRecordingDevice(-1)); TEST_MUSTPASS(hardware->SetRecordingDevice(-1));
@ -1982,7 +1982,7 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(!hardware->GetCPULoad(load)); TEST_MUSTPASS(!hardware->GetCPULoad(load));
#endif #endif
#if !defined(WEBRTC_MAC) && !defined(ANDROID) #if !defined(WEBRTC_MAC) && !defined(WEBRTC_ANDROID)
// Not supported on Mac yet // Not supported on Mac yet
load = -1; load = -1;
TEST_MUSTPASS(hardware->GetSystemCPULoad(load)); TEST_MUSTPASS(hardware->GetSystemCPULoad(load));
@ -2223,7 +2223,7 @@ int VoETestManager::DoStandardTest()
SLEEP(1000); SLEEP(1000);
} }
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// Mic volume test // Mic volume test
#if defined(_TEST_AUDIO_PROCESSING_) && defined(WEBRTC_VOICE_ENGINE_AGC) #if defined(_TEST_AUDIO_PROCESSING_) && defined(WEBRTC_VOICE_ENGINE_AGC)
bool agcTemp(true); bool agcTemp(true);
@ -2248,7 +2248,7 @@ int VoETestManager::DoStandardTest()
TEST_LOG("Reset AGC to previous state\n"); TEST_LOG("Reset AGC to previous state\n");
TEST_MUSTPASS(apm->SetAgcStatus(agcTemp, agcModeTemp)); TEST_MUSTPASS(apm->SetAgcStatus(agcTemp, agcModeTemp));
#endif #endif
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// Input mute test // Input mute test
TEST_LOG("Enabling input muting\n"); TEST_LOG("Enabling input muting\n");
@ -2265,7 +2265,7 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(mute); TEST_MUSTPASS(mute);
SLEEP(1000); SLEEP(1000);
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// System output mute test // System output mute test
TEST_LOG("Enabling system output muting\n"); TEST_LOG("Enabling system output muting\n");
bool outputMute = true; bool outputMute = true;
@ -2299,9 +2299,9 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(volume->GetSystemInputMute(inputMute)); TEST_MUSTPASS(volume->GetSystemInputMute(inputMute));
TEST_MUSTPASS(inputMute); TEST_MUSTPASS(inputMute);
SLEEP(1000); SLEEP(1000);
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
#if(!defined(MAC_IPHONE) && !defined(ANDROID)) #if(!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
// Test Input & Output levels // Test Input & Output levels
TEST_LOG("Testing input & output levels for 10 seconds (dT=1 second)\n"); TEST_LOG("Testing input & output levels for 10 seconds (dT=1 second)\n");
TEST_LOG("Speak in microphone to vary the levels...\n"); TEST_LOG("Speak in microphone to vary the levels...\n");
@ -2324,7 +2324,7 @@ int VoETestManager::DoStandardTest()
TEST_LOG(" linear levels (0-32768): in=%5d, out=%5d\n", TEST_LOG(" linear levels (0-32768): in=%5d, out=%5d\n",
inputLevelFullRange, outputLevelFullRange); inputLevelFullRange, outputLevelFullRange);
} }
#endif // #if (!defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
if (file) if (file)
{ {
@ -2351,7 +2351,7 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(1.0 != scaling); TEST_MUSTPASS(1.0 != scaling);
#endif // #if !defined(MAC_IPHONE) #endif // #if !defined(MAC_IPHONE)
#if !defined(MAC_IPHONE) && !defined(ANDROID) #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
// Channel panning test // Channel panning test
TEST_LOG("Channel panning\n"); TEST_LOG("Channel panning\n");
float left = -1.0, right = -1.0; float left = -1.0, right = -1.0;
@ -2381,7 +2381,7 @@ int VoETestManager::DoStandardTest()
SLEEP(1000); SLEEP(1000);
#else #else
TEST_LOG("Skipping stereo tests\n"); TEST_LOG("Skipping stereo tests\n");
#endif // #if !defined(MAC_IPHONE) && !defined(ANDROID)) #endif // #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
#else #else
TEST_LOG("\n\n+++ Volume tests NOT ENABLED +++\n"); TEST_LOG("\n\n+++ Volume tests NOT ENABLED +++\n");
@ -2395,7 +2395,7 @@ int VoETestManager::DoStandardTest()
#ifdef WEBRTC_VOICE_ENGINE_AGC #ifdef WEBRTC_VOICE_ENGINE_AGC
bool test; bool test;
TEST_LOG("AGC calls\n"); TEST_LOG("AGC calls\n");
#if (defined(MAC_IPHONE) || defined(ANDROID)) #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
TEST_LOG("Must be OFF by default\n"); TEST_LOG("Must be OFF by default\n");
test = true; test = true;
AgcModes agcMode = kAgcAdaptiveAnalog; AgcModes agcMode = kAgcAdaptiveAnalog;
@ -2417,10 +2417,10 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode));
TEST_MUSTPASS(test); TEST_MUSTPASS(test);
TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode); TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode);
#endif // #if (defined(MAC_IPHONE) || defined(ANDROID)) #endif // #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
TEST_LOG("Turn ON AGC\n"); TEST_LOG("Turn ON AGC\n");
#if (defined(MAC_IPHONE) || defined(ANDROID)) #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveDigital)); TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveDigital));
#else #else
TEST_MUSTPASS(apm->SetAgcStatus(true)); TEST_MUSTPASS(apm->SetAgcStatus(true));
@ -2428,13 +2428,13 @@ int VoETestManager::DoStandardTest()
TEST_LOG("Should be ON now\n"); TEST_LOG("Should be ON now\n");
TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode));
TEST_MUSTPASS(!test); TEST_MUSTPASS(!test);
#if (defined(MAC_IPHONE) || defined(ANDROID)) #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode); TEST_MUSTPASS(kAgcAdaptiveDigital != agcMode);
#else #else
TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode); TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode);
#endif #endif
#if (defined(MAC_IPHONE) || defined(ANDROID)) #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
TEST_LOG("Testing Type settings\n"); TEST_LOG("Testing Type settings\n");
// Should fail // Should fail
TEST_MUSTPASS(!apm->SetAgcStatus(true, kAgcAdaptiveAnalog)); TEST_MUSTPASS(!apm->SetAgcStatus(true, kAgcAdaptiveAnalog));
@ -2460,7 +2460,7 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveAnalog)); TEST_MUSTPASS(apm->SetAgcStatus(true, kAgcAdaptiveAnalog));
TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode)); TEST_MUSTPASS(apm->GetAgcStatus(test, agcMode));
TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode); TEST_MUSTPASS(kAgcAdaptiveAnalog != agcMode);
#endif // #if (defined(MAC_IPHONE) || defined(ANDROID)) #endif // #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
TEST_LOG("rxAGC calls\n"); TEST_LOG("rxAGC calls\n");
// Note the following test is not tested in iphone, android and wince, // Note the following test is not tested in iphone, android and wince,
@ -2522,7 +2522,7 @@ int VoETestManager::DoStandardTest()
#ifdef WEBRTC_VOICE_ENGINE_ECHO #ifdef WEBRTC_VOICE_ENGINE_ECHO
TEST_LOG("EC calls\n"); TEST_LOG("EC calls\n");
TEST_LOG("Must be OFF by default\n"); TEST_LOG("Must be OFF by default\n");
#if (defined(MAC_IPHONE) || defined(ANDROID)) #if (defined(MAC_IPHONE) || defined(WEBRTC_ANDROID))
const EcModes ecModeDefault = kEcAecm; const EcModes ecModeDefault = kEcAecm;
#else #else
const EcModes ecModeDefault = kEcAec; const EcModes ecModeDefault = kEcAec;
@ -2551,7 +2551,7 @@ int VoETestManager::DoStandardTest()
TEST_MUSTPASS(!test); TEST_MUSTPASS(!test);
TEST_MUSTPASS(ecModeDefault != ecMode); TEST_MUSTPASS(ecModeDefault != ecMode);
#if (!defined(MAC_IPHONE) && !defined(ANDROID)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID))
TEST_MUSTPASS(apm->SetEcStatus(true, kEcAec)); TEST_MUSTPASS(apm->SetEcStatus(true, kEcAec));
TEST_MUSTPASS(apm->GetEcStatus(test, ecMode)); TEST_MUSTPASS(apm->GetEcStatus(test, ecMode));
TEST_MUSTPASS(kEcAec != ecMode); TEST_MUSTPASS(kEcAec != ecMode);
@ -2708,7 +2708,7 @@ int VoETestManager::DoStandardTest()
// TODO(xians), enable the metrics test when APM is ready // TODO(xians), enable the metrics test when APM is ready
/* /*
#if (!defined(MAC_IPHONE) && !defined(ANDROID) && defined(WEBRTC_VOICE_ENGINE_NR)) #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) && defined(WEBRTC_VOICE_ENGINE_NR))
TEST_LOG("Speech, Noise and Echo Metric calls\n"); TEST_LOG("Speech, Noise and Echo Metric calls\n");
TEST_MUSTPASS(apm->GetMetricsStatus(enabled)); // check default TEST_MUSTPASS(apm->GetMetricsStatus(enabled)); // check default
TEST_MUSTPASS(enabled != false); TEST_MUSTPASS(enabled != false);
@ -2741,7 +2741,7 @@ int VoETestManager::DoStandardTest()
} }
TEST_MUSTPASS(apm->SetMetricsStatus(false)); // disable metrics TEST_MUSTPASS(apm->SetMetricsStatus(false)); // disable metrics
#else #else
TEST_LOG("Skipping apm metrics tests - MAC_IPHONE/ANDROID defined \n"); TEST_LOG("Skipping apm metrics tests - MAC_IPHONE/WEBRTC_ANDROID defined \n");
#endif // #if (!defined(MAC_IPHONE) && !d... #endif // #if (!defined(MAC_IPHONE) && !d...
*/ */
// VAD/DTX indication // VAD/DTX indication
@ -2758,7 +2758,7 @@ int VoETestManager::DoStandardTest()
{ {
TEST_LOG ("RX VAD detections may vary depending on current signal" TEST_LOG ("RX VAD detections may vary depending on current signal"
" and mic input \n"); " and mic input \n");
#if !defined(ANDROID) && !defined(MAC_IPHONE) #if !defined(WEBRTC_ANDROID) && !defined(MAC_IPHONE)
RxCallback rxc; RxCallback rxc;
TEST_MUSTPASS(apm->RegisterRxVadObserver(0, rxc)); TEST_MUSTPASS(apm->RegisterRxVadObserver(0, rxc));
#endif #endif
@ -2770,7 +2770,7 @@ int VoETestManager::DoStandardTest()
} }
SLEEP(500); // After sleeping we should have detected silence SLEEP(500); // After sleeping we should have detected silence
TEST_MUSTPASS(0 != apm->VoiceActivityIndicator(0)); TEST_MUSTPASS(0 != apm->VoiceActivityIndicator(0));
#if !defined(ANDROID) && !defined(MAC_IPHONE) #if !defined(WEBRTC_ANDROID) && !defined(MAC_IPHONE)
TEST_MUSTPASS(0 != rxc._vadDecision); TEST_MUSTPASS(0 != rxc._vadDecision);
#endif #endif
if (file) if (file)
@ -2790,7 +2790,7 @@ int VoETestManager::DoStandardTest()
SLEEP(500); // Sleep time selected by looking in mic play file, after SLEEP(500); // Sleep time selected by looking in mic play file, after
// sleep we should have detected voice // sleep we should have detected voice
TEST_MUSTPASS(1 != apm->VoiceActivityIndicator(0)); TEST_MUSTPASS(1 != apm->VoiceActivityIndicator(0));
#if !defined(ANDROID) && !defined(MAC_IPHONE) #if !defined(WEBRTC_ANDROID) && !defined(MAC_IPHONE)
TEST_MUSTPASS(1 != rxc._vadDecision); TEST_MUSTPASS(1 != rxc._vadDecision);
TEST_LOG("Disabling RX VAD detection, make sure you see no " TEST_LOG("Disabling RX VAD detection, make sure you see no "
"detections\n"); "detections\n");
@ -3322,7 +3322,7 @@ int VoETestManager::DoStandardTest()
SLEEP(1000); SLEEP(1000);
} }
#if (defined (_WIN32) || (defined(WEBRTC_LINUX)) && !defined(ANDROID)) #if (defined (_WIN32) || (defined(WEBRTC_LINUX)) && !defined(WEBRTC_ANDROID))
valInt = -1; valInt = -1;
TEST_MUSTPASS(vsync->GetPlayoutBufferSize(valInt)); TEST_MUSTPASS(vsync->GetPlayoutBufferSize(valInt));
TEST_LOG("Soundcard buffer size = %d ms\n", valInt); TEST_LOG("Soundcard buffer size = %d ms\n", valInt);
@ -3802,11 +3802,11 @@ void createSummary(VoiceEngine* ve)
sprintf(str, "WebRTc VoiceEngine "); sprintf(str, "WebRTc VoiceEngine ");
#if defined(_WIN32) #if defined(_WIN32)
strcat(str, "Win"); strcat(str, "Win");
#elif defined(WEBRTC_LINUX) && defined(WEBRTC_TARGET_PC) && !defined(ANDROID) #elif defined(WEBRTC_LINUX) && defined(WEBRTC_TARGET_PC) && !defined(WEBRTC_ANDROID)
strcat(str, "Linux"); strcat(str, "Linux");
#elif defined(WEBRTC_MAC) && !defined(MAC_IPHONE) #elif defined(WEBRTC_MAC) && !defined(MAC_IPHONE)
strcat(str, "Mac"); strcat(str, "Mac");
#elif defined(ANDROID) #elif defined(WEBRTC_ANDROID)
strcat(str, "Android"); strcat(str, "Android");
#elif defined(MAC_IPHONE) #elif defined(MAC_IPHONE)
strcat(str, "iPhone"); strcat(str, "iPhone");

View File

@ -54,7 +54,7 @@ class VoENetEqStats;
} }
#endif #endif
#if defined(ANDROID) #if defined(WEBRTC_ANDROID)
extern char mobileLogMsg[640]; extern char mobileLogMsg[640];
#endif #endif

View File

@ -14,7 +14,7 @@
// Read WEBRTC_VOICE_ENGINE_XXX_API compiler flags // Read WEBRTC_VOICE_ENGINE_XXX_API compiler flags
#include "engine_configurations.h" #include "engine_configurations.h"
#ifdef ANDROID #ifdef WEBRTC_ANDROID
#include <android/log.h> #include <android/log.h>
#define ANDROID_LOG_TAG "VoiceEngine Auto Test" #define ANDROID_LOG_TAG "VoiceEngine Auto Test"
#define TEST_LOG(...) \ #define TEST_LOG(...) \