Change MAC_IPHONE to WEBRTC_IOS.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2746 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
sjlee@webrtc.org
2012-09-11 17:25:46 +00:00
parent 2578300eee
commit 414fa7f0c4
24 changed files with 85 additions and 86 deletions

View File

@@ -168,7 +168,7 @@
['OS=="ios"', { ['OS=="ios"', {
'defines': [ 'defines': [
'WEBRTC_MAC', 'WEBRTC_MAC',
'MAC_IPHONE', # TODO(sjlee): This should be changed to WEBRTC_IOS. 'WEBRTC_IOS',
'WEBRTC_THREAD_RR', 'WEBRTC_THREAD_RR',
'WEBRTC_CLOCK_TYPE_REALTIME', 'WEBRTC_CLOCK_TYPE_REALTIME',
], ],

View File

@@ -126,7 +126,7 @@
// VideoEngine MAC // VideoEngine MAC
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if defined(WEBRTC_MAC) && !defined(MAC_IPHONE) #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
// #define CARBON_RENDERING // #define CARBON_RENDERING
#define COCOA_RENDERING #define COCOA_RENDERING
#endif #endif
@@ -135,7 +135,7 @@
// VideoEngine Mobile iPhone // VideoEngine Mobile iPhone
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
#define EAGL_RENDERING #define EAGL_RENDERING
#endif #endif

View File

@@ -38,7 +38,7 @@
#if defined(LINUX_PULSE) #if defined(LINUX_PULSE)
#include "audio_device_pulse_linux.h" #include "audio_device_pulse_linux.h"
#endif #endif
#elif defined(MAC_IPHONE) #elif defined(WEBRTC_IOS)
#include "audio_device_utility_ios.h" #include "audio_device_utility_ios.h"
#include "audio_device_ios.h" #include "audio_device_ios.h"
#elif defined(WEBRTC_MAC) #elif defined(WEBRTC_MAC)
@@ -160,7 +160,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::CheckPlatform()
#elif defined(WEBRTC_LINUX) #elif defined(WEBRTC_LINUX)
platform = kPlatformLinux; platform = kPlatformLinux;
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX"); WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX");
#elif defined(MAC_IPHONE) #elif defined(WEBRTC_IOS)
platform = kPlatformIOS; platform = kPlatformIOS;
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is IOS"); WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is IOS");
#elif defined(WEBRTC_MAC) #elif defined(WEBRTC_MAC)
@@ -341,7 +341,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
// Create the *iPhone* implementation of the Audio Device // Create the *iPhone* implementation of the Audio Device
// //
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
if (audioLayer == kPlatformDefaultAudio) if (audioLayer == kPlatformDefaultAudio)
{ {
// Create *iPhone Audio* implementation // Create *iPhone Audio* implementation
@@ -354,7 +354,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
// Create the Mac implementation of the Device Utility. // Create the Mac implementation of the Device Utility.
ptrAudioDeviceUtility = new AudioDeviceUtilityIPhone(Id()); ptrAudioDeviceUtility = new AudioDeviceUtilityIPhone(Id());
} }
// END #if defined(MAC_IPHONE) // END #if defined(WEBRTC_IOS)
// Create the *Mac* implementation of the Audio Device // Create the *Mac* implementation of the Audio Device
// //

View File

@@ -36,7 +36,7 @@ const char* GetFilename(const char* filename)
sprintf(filenameStr[currentStr], "/sdcard/admtest/%s", filename); sprintf(filenameStr[currentStr], "/sdcard/admtest/%s", filename);
return filenameStr[currentStr]; return filenameStr[currentStr];
} }
#elif !defined(MAC_IPHONE) #elif !defined(WEBRTC_IOS)
const char* GetFilename(const char* filename) { const char* GetFilename(const char* filename) {
std::string full_path_filename = webrtc::test::OutputPath() + filename; std::string full_path_filename = webrtc::test::OutputPath() + filename;
return full_path_filename.c_str(); return full_path_filename.c_str();
@@ -1588,7 +1588,7 @@ TEST_F(AudioDeviceAPITest, PlayoutBufferTests) {
CheckInitialPlayoutStates(); CheckInitialPlayoutStates();
EXPECT_EQ(0, audio_device_->PlayoutBuffer(&bufferType, &sizeMS)); EXPECT_EQ(0, audio_device_->PlayoutBuffer(&bufferType, &sizeMS));
#if defined(_WIN32) || defined(ANDROID) || defined(MAC_IPHONE) #if defined(_WIN32) || defined(ANDROID) || defined(WEBRTC_IOS)
EXPECT_EQ(AudioDeviceModule::kAdaptiveBufferSize, bufferType); EXPECT_EQ(AudioDeviceModule::kAdaptiveBufferSize, bufferType);
#else #else
EXPECT_EQ(AudioDeviceModule::kFixedBufferSize, bufferType); EXPECT_EQ(AudioDeviceModule::kFixedBufferSize, bufferType);
@@ -1625,7 +1625,7 @@ TEST_F(AudioDeviceAPITest, PlayoutBufferTests) {
EXPECT_EQ(0, audio_device_->PlayoutBuffer(&bufferType, &sizeMS)); EXPECT_EQ(0, audio_device_->PlayoutBuffer(&bufferType, &sizeMS));
EXPECT_EQ(AudioDeviceModule::kAdaptiveBufferSize, bufferType); EXPECT_EQ(AudioDeviceModule::kAdaptiveBufferSize, bufferType);
#endif #endif
#if defined(ANDROID) || defined(MAC_IPHONE) #if defined(ANDROID) || defined(WEBRTC_IOS)
EXPECT_EQ(-1, EXPECT_EQ(-1,
audio_device_->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize, audio_device_->SetPlayoutBuffer(AudioDeviceModule::kFixedBufferSize,
kAdmMinPlayoutBufferSizeMs)); kAdmMinPlayoutBufferSizeMs));
@@ -1770,7 +1770,7 @@ TEST_F(AudioDeviceAPITest, RecordingSampleRate) {
#elif defined(ANDROID) #elif defined(ANDROID)
TEST_LOG("Recording sample rate is %u\n\n", sampleRate); TEST_LOG("Recording sample rate is %u\n\n", sampleRate);
EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000)); EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000));
#elif defined(MAC_IPHONE) #elif defined(WEBRTC_IOS)
TEST_LOG("Recording sample rate is %u\n\n", sampleRate); TEST_LOG("Recording sample rate is %u\n\n", sampleRate);
EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000) || EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000) ||
(sampleRate == 8000)); (sampleRate == 8000));
@@ -1789,7 +1789,7 @@ TEST_F(AudioDeviceAPITest, PlayoutSampleRate) {
#elif defined(ANDROID) #elif defined(ANDROID)
TEST_LOG("Playout sample rate is %u\n\n", sampleRate); TEST_LOG("Playout sample rate is %u\n\n", sampleRate);
EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000)); EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000));
#elif defined(MAC_IPHONE) #elif defined(WEBRTC_IOS)
TEST_LOG("Playout sample rate is %u\n\n", sampleRate); TEST_LOG("Playout sample rate is %u\n\n", sampleRate);
EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000) || EXPECT_TRUE((sampleRate == 44000) || (sampleRate == 16000) ||
(sampleRate == 8000)); (sampleRate == 8000));
@@ -1802,7 +1802,7 @@ TEST_F(AudioDeviceAPITest, ResetAudioDevice) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(MACRO_DEFAULT_DEVICE)); EXPECT_EQ(0, audio_device_->SetPlayoutDevice(MACRO_DEFAULT_DEVICE));
EXPECT_EQ(0, audio_device_->SetRecordingDevice(MACRO_DEFAULT_DEVICE)); EXPECT_EQ(0, audio_device_->SetRecordingDevice(MACRO_DEFAULT_DEVICE));
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
// Not playing or recording, should just return 0 // Not playing or recording, should just return 0
EXPECT_EQ(0, audio_device_->ResetAudioDevice()); EXPECT_EQ(0, audio_device_->ResetAudioDevice());
@@ -1838,7 +1838,7 @@ TEST_F(AudioDeviceAPITest, SetPlayoutSpeaker) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(MACRO_DEFAULT_DEVICE)); EXPECT_EQ(0, audio_device_->SetPlayoutDevice(MACRO_DEFAULT_DEVICE));
bool loudspeakerOn(false); bool loudspeakerOn(false);
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
// Not playing or recording, should just return a success // Not playing or recording, should just return a success
EXPECT_EQ(0, audio_device_->SetLoudspeakerStatus(true)); EXPECT_EQ(0, audio_device_->SetLoudspeakerStatus(true));
EXPECT_EQ(0, audio_device_->GetLoudspeakerStatus(loudspeakerOn)); EXPECT_EQ(0, audio_device_->GetLoudspeakerStatus(loudspeakerOn));

View File

@@ -25,7 +25,7 @@ int func_test(int);
// main() // main()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if !defined(MAC_IPHONE) #if !defined(WEBRTC_IOS)
int main(int /*argc*/, char* /*argv*/[]) int main(int /*argc*/, char* /*argv*/[])
{ {
func_test(0); func_test(0);

View File

@@ -47,7 +47,7 @@ struct AudioPacket
}; };
// Helper functions // Helper functions
#if !defined(MAC_IPHONE) #if !defined(WEBRTC_IOS)
char* GetFilename(char* filename) char* GetFilename(char* filename)
{ {
return filename; return filename;
@@ -2667,7 +2667,7 @@ WebRtc_Word32 FuncTestManager::TestAdvancedMBAPI()
EXPECT_TRUE(audioDevice->Recording()); EXPECT_TRUE(audioDevice->Recording());
EXPECT_TRUE(audioDevice->Playing()); EXPECT_TRUE(audioDevice->Playing());
#if defined(_WIN32_WCE) || defined(MAC_IPHONE) #if defined(_WIN32_WCE) || defined(WEBRTC_IOS)
TEST_LOG("\nResetAudioDevice\n \n"); TEST_LOG("\nResetAudioDevice\n \n");
if (audioDevice->Recording() && audioDevice->Playing()) if (audioDevice->Recording() && audioDevice->Playing())
{ {
@@ -2688,7 +2688,7 @@ WebRtc_Word32 FuncTestManager::TestAdvancedMBAPI()
} }
#endif #endif
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
bool loudspeakerOn(false); bool loudspeakerOn(false);
TEST_LOG("\nSet playout spaker\n \n"); TEST_LOG("\nSet playout spaker\n \n");
if (audioDevice->Recording() && audioDevice->Playing()) if (audioDevice->Recording() && audioDevice->Playing())

View File

@@ -22,7 +22,7 @@
#include "list_wrapper.h" #include "list_wrapper.h"
#include "resampler.h" #include "resampler.h"
#if defined(MAC_IPHONE) || defined(ANDROID) #if defined(WEBRTC_IOS) || defined(ANDROID)
#define USE_SLEEP_AS_PAUSE #define USE_SLEEP_AS_PAUSE
#else #else
//#define USE_SLEEP_AS_PAUSE //#define USE_SLEEP_AS_PAUSE

View File

@@ -30,7 +30,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#ifndef MAC_IPHONE #ifndef WEBRTC_IOS
#include <net/if_arp.h> #include <net/if_arp.h>
#endif #endif
#endif // defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) #endif // defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)

View File

@@ -24,9 +24,9 @@
#include "windows/video_render_windows_impl.h" #include "windows/video_render_windows_impl.h"
#define STANDARD_RENDERING kRenderWindows #define STANDARD_RENDERING kRenderWindows
// MAC_IPHONE should go before WEBRTC_MAC because WEBRTC_MAC // WEBRTC_IOS should go before WEBRTC_MAC because WEBRTC_MAC
// gets defined if MAC_IPHONE is defined // gets defined if WEBRTC_IOS is defined
#elif defined(MAC_IPHONE) #elif defined(WEBRTC_IOS)
#if defined(IPHONE_GLES_RENDERING) #if defined(IPHONE_GLES_RENDERING)
#define STANDARD_RENDERING kRenderiPhone #define STANDARD_RENDERING kRenderiPhone
#include "iPhone/video_render_iphone_impl.h" #include "iPhone/video_render_iphone_impl.h"
@@ -116,7 +116,7 @@ ModuleVideoRenderImpl::ModuleVideoRenderImpl(
} }
break; break;
#elif defined(MAC_IPHONE) #elif defined(WEBRTC_IOS)
case kRenderiPhone: case kRenderiPhone:
{ {
VideoRenderIPhoneImpl* ptrRenderer = new VideoRenderIPhoneImpl(_id, videoRenderType, window, _fullScreen); VideoRenderIPhoneImpl* ptrRenderer = new VideoRenderIPhoneImpl(_id, videoRenderType, window, _fullScreen);
@@ -276,7 +276,7 @@ ModuleVideoRenderImpl::~ModuleVideoRenderImpl()
break; break;
#endif #endif
#elif defined(MAC_IPHONE) #elif defined(WEBRTC_IOS)
case kRenderiPhone: case kRenderiPhone:
break; break;
@@ -350,7 +350,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window)
#ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER #ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER
#if defined(MAC_IPHONE) // MAC_IPHONE must go before WEBRTC_MAC #if defined(WEBRTC_IOS) // WEBRTC_IOS must go before WEBRTC_MAC
_ptrRenderer = NULL; _ptrRenderer = NULL;
delete _ptrRenderer; delete _ptrRenderer;

View File

@@ -184,11 +184,11 @@ inline TickTime TickTime::Now()
if (retval != KERN_SUCCESS) { if (retval != KERN_SUCCESS) {
// TODO(wu): Implement CHECK similar to chrome for all the platforms. // TODO(wu): Implement CHECK similar to chrome for all the platforms.
// Then replace this with a CHECK(retval == KERN_SUCCESS); // Then replace this with a CHECK(retval == KERN_SUCCESS);
#ifndef MAC_IPHONE #ifndef WEBRTC_IOS
asm("int3"); asm("int3");
#else #else
__builtin_trap(); __builtin_trap();
#endif // MAC_IPHONE #endif // WEBRTC_IOS
} }
} }
// Use timebase to convert absolute time tick units into nanoseconds. // Use timebase to convert absolute time tick units into nanoseconds.

View File

@@ -13,7 +13,7 @@
#if defined(_WIN32) #if defined(_WIN32)
#include <windows.h> #include <windows.h>
#include "event_win.h" #include "event_win.h"
#elif defined(WEBRTC_MAC) && !defined(MAC_IPHONE) #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#include <pthread.h> #include <pthread.h>
#include "event_posix.h" #include "event_posix.h"
@@ -49,7 +49,7 @@ int EventWrapper::KeyPressed()
{ {
return 0; return 0;
} }
#elif defined(WEBRTC_MAC) && !defined(MAC_IPHONE) #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
bool keyDown = false; bool keyDown = false;
// loop through all Mac virtual key constant values // loop through all Mac virtual key constant values
for(int keyIndex = 0; keyIndex <= 0x5C; keyIndex++) for(int keyIndex = 0; keyIndex <= 0x5C; keyIndex++)

View File

@@ -157,8 +157,7 @@ ThreadPosix::~ThreadPosix()
delete _crit_state; delete _crit_state;
} }
#define HAS_THREAD_ID !defined(MAC_IPHONE) && !defined(MAC_IPHONE_SIM) && \ #define HAS_THREAD_ID !defined(WEBRTC_IOS) && !defined(WEBRTC_MAC)
!defined(WEBRTC_MAC)
#if HAS_THREAD_ID #if HAS_THREAD_ID
bool ThreadPosix::Start(unsigned int& threadID) bool ThreadPosix::Start(unsigned int& threadID)
#else #else

View File

@@ -24,7 +24,7 @@ namespace webrtc {
// TODO (hellner) the buffer should be close to how much the system can write to // TODO (hellner) the buffer should be close to how much the system can write to
// file. Increasing the buffer will not solve anything. Sooner or // file. Increasing the buffer will not solve anything. Sooner or
// later the buffer is going to fill up anyways. // later the buffer is going to fill up anyways.
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
#define WEBRTC_TRACE_MAX_QUEUE 2000 #define WEBRTC_TRACE_MAX_QUEUE 2000
#else #else
#define WEBRTC_TRACE_MAX_QUEUE 8000 #define WEBRTC_TRACE_MAX_QUEUE 8000

View File

@@ -138,7 +138,7 @@ class AudioProcessingTest : public AfterStreamingFixture {
} }
}; };
#if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID)
TEST_F(AudioProcessingTest, AgcIsOnByDefault) { TEST_F(AudioProcessingTest, AgcIsOnByDefault) {
bool agc_enabled = false; bool agc_enabled = false;
@@ -219,7 +219,7 @@ TEST_F(AudioProcessingTest, DISABLED_TestVoiceActivityDetectionWithObserver) {
EXPECT_EQ(0, voe_apm_->DeRegisterRxVadObserver(channel_)); EXPECT_EQ(0, voe_apm_->DeRegisterRxVadObserver(channel_));
} }
#endif // !MAC_IPHONE && !WEBRTC_ANDROID #endif // !WEBRTC_IOS && !WEBRTC_ANDROID
TEST_F(AudioProcessingTest, EnablingEcAecmShouldEnableEcAecm) { TEST_F(AudioProcessingTest, EnablingEcAecmShouldEnableEcAecm) {
// This one apparently applies to Android and iPhone as well. // This one apparently applies to Android and iPhone as well.
@@ -377,7 +377,7 @@ TEST_F(AudioProcessingTest, CanStartAndStopDebugRecording) {
EXPECT_EQ(0, voe_apm_->StopDebugRecording()); EXPECT_EQ(0, voe_apm_->StopDebugRecording());
} }
#if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID) #if defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID)
TEST_F(AudioProcessingTest, AgcIsOffByDefaultAndDigital) { TEST_F(AudioProcessingTest, AgcIsOffByDefaultAndDigital) {
bool agc_enabled = true; bool agc_enabled = true;
@@ -412,4 +412,4 @@ TEST_F(AudioProcessingTest, TestVoiceActivityDetection) {
TryDetectingSpeechAfterSilence(); TryDetectingSpeechAfterSilence();
} }
#endif // MAC_IPHONE || WEBRTC_ANDROID #endif // WEBRTC_IOS || WEBRTC_ANDROID

View File

@@ -52,7 +52,7 @@ TEST_F(DtmfTest, TestTwoNonDtmfEvents) {
EXPECT_EQ(0, voe_dtmf_->SendTelephoneEvent(channel_, 110, true)); EXPECT_EQ(0, voe_dtmf_->SendTelephoneEvent(channel_, 110, true));
} }
#ifndef MAC_IPHONE #ifndef WEBRTC_IOS
TEST_F(DtmfTest, ManualCanDisableDtmfPlayoutExceptOnIphone) { TEST_F(DtmfTest, ManualCanDisableDtmfPlayoutExceptOnIphone) {
TEST_LOG("Disabling DTMF playout (no tone should be heard) \n"); TEST_LOG("Disabling DTMF playout (no tone should be heard) \n");
EXPECT_EQ(0, voe_dtmf_->SetDtmfPlayoutStatus(channel_, false)); EXPECT_EQ(0, voe_dtmf_->SetDtmfPlayoutStatus(channel_, false));

View File

@@ -42,14 +42,14 @@ TEST_F(HardwareBeforeStreamingTest,
// Tests that only apply to mobile: // Tests that only apply to mobile:
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
TEST_F(HardwareBeforeStreamingTest, ResetsAudioDeviceOnIphone) { TEST_F(HardwareBeforeStreamingTest, ResetsAudioDeviceOnIphone) {
EXPECT_EQ(0, voe_hardware_->ResetAudioDevice()); EXPECT_EQ(0, voe_hardware_->ResetAudioDevice());
} }
#endif #endif
// Tests that only apply to desktop: // Tests that only apply to desktop:
#if !defined(MAC_IPHONE) & !defined(WEBRTC_ANDROID) #if !defined(WEBRTC_IOS) & !defined(WEBRTC_ANDROID)
TEST_F(HardwareBeforeStreamingTest, GetSystemCpuLoadSucceeds) { TEST_F(HardwareBeforeStreamingTest, GetSystemCpuLoadSucceeds) {
#ifdef _WIN32 #ifdef _WIN32
@@ -163,4 +163,4 @@ TEST_F(HardwareBeforeStreamingTest,
#endif #endif
} }
#endif // !defined(MAC_IPHONE) & !defined(WEBRTC_ANDROID) #endif // !defined(WEBRTC_IOS) & !defined(WEBRTC_ANDROID)

View File

@@ -15,7 +15,7 @@
class HardwareTest : public AfterStreamingFixture { class HardwareTest : public AfterStreamingFixture {
}; };
#if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID)
TEST_F(HardwareTest, AbleToQueryForDevices) { TEST_F(HardwareTest, AbleToQueryForDevices) {
int num_recording_devices = 0; int num_recording_devices = 0;
int num_playout_devices = 0; int num_playout_devices = 0;
@@ -84,7 +84,7 @@ TEST_F(HardwareTest, GetSystemCpuLoadWorksExceptOnMacAndAndroid) {
#endif #endif
TEST_F(HardwareTest, BuiltInWasapiAECWorksForAudioWindowsCoreAudioLayer) { TEST_F(HardwareTest, BuiltInWasapiAECWorksForAudioWindowsCoreAudioLayer) {
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
// Ensure the sound device is reset on iPhone. // Ensure the sound device is reset on iPhone.
EXPECT_EQ(0, voe_hardware_->ResetAudioDevice()); EXPECT_EQ(0, voe_hardware_->ResetAudioDevice());
Sleep(2000); Sleep(2000);

View File

@@ -14,11 +14,11 @@
#include "voice_engine/test/auto_test/fixtures/after_streaming_fixture.h" #include "voice_engine/test/auto_test/fixtures/after_streaming_fixture.h"
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
const int kMinimumReasonableDelayEstimateMs = 30; const int kMinimumReasonableDelayEstimateMs = 30;
#else #else
const int kMinimumReasonableDelayEstimateMs = 45; const int kMinimumReasonableDelayEstimateMs = 45;
#endif // !MAC_IPHONE #endif // !WEBRTC_IOS
class VideoSyncTest : public AfterStreamingFixture { class VideoSyncTest : public AfterStreamingFixture {
protected: protected:

View File

@@ -87,7 +87,7 @@ TEST_F(VolumeTest, ManualSetVolumeWorks) {
Sleep(1000); Sleep(1000);
} }
#if !defined(MAC_IPHONE) #if !defined(WEBRTC_IOS)
TEST_F(VolumeTest, DISABLED_ON_LINUX(DefaultMicrophoneVolumeIsAtMost255)) { TEST_F(VolumeTest, DISABLED_ON_LINUX(DefaultMicrophoneVolumeIsAtMost255)) {
unsigned int volume = 1000; unsigned int volume = 1000;
@@ -136,9 +136,9 @@ TEST_F(VolumeTest, ManualCanSetChannelScaling) {
Sleep(2000); Sleep(2000);
} }
#endif // !MAC_IPHONE #endif // !WEBRTC_IOS
#if !defined(WEBRTC_ANDROID) && !defined(MAC_IPHONE) #if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS)
TEST_F(VolumeTest, InputMutingIsNotEnabledByDefault) { TEST_F(VolumeTest, InputMutingIsNotEnabledByDefault) {
bool is_muted = true; bool is_muted = true;
@@ -277,4 +277,4 @@ TEST_F(VolumeTest, ManualTestChannelPanning) {
EXPECT_FLOAT_EQ(0.8f, right); EXPECT_FLOAT_EQ(0.8f, right);
} }
#endif // !WEBRTC_ANDROID && !MAC_IPHONE #endif // !WEBRTC_ANDROID && !WEBRTC_IOS

View File

@@ -41,7 +41,7 @@ const int RemotePort = 12345; // transmit to this UDP port
const char* RemoteIP = "192.168.200.1"; // transmit to this IP address const char* RemoteIP = "192.168.200.1"; // transmit to this IP address
#endif #endif
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
#define SLEEP_IF_IPHONE(x) SLEEP(x) #define SLEEP_IF_IPHONE(x) SLEEP(x)
#else #else
#define SLEEP_IF_IPHONE(x) #define SLEEP_IF_IPHONE(x)
@@ -418,7 +418,7 @@ int VoEExtendedTest::TestBase() {
TEST_MUSTPASS(voe_base_->Init()); TEST_MUSTPASS(voe_base_->Init());
MARK(); MARK();
TEST_MUSTPASS(voe_base_->Terminate()); TEST_MUSTPASS(voe_base_->Terminate());
#if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #if (!defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID))
// verify AEC recording // verify AEC recording
TEST_MUSTPASS(voe_base_->Init()); TEST_MUSTPASS(voe_base_->Init());
MARK(); // verify output dat-files MARK(); // verify output dat-files
@@ -577,7 +577,7 @@ int VoEExtendedTest::TestBase() {
ch = voe_base_->CreateChannel(); ch = voe_base_->CreateChannel();
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
printf("\nNOTE: Local IP must be set in source code (line %d) \n", printf("\nNOTE: Local IP must be set in source code (line %d) \n",
__LINE__ + 1); __LINE__ + 1);
char* localIp = "127.0.0.1"; char* localIp = "127.0.0.1";
@@ -1432,7 +1432,7 @@ int VoEExtendedTest::TestBase() {
voe_base_->DeleteChannel(ch); voe_base_->DeleteChannel(ch);
ch = voe_base_->CreateChannel(); ch = voe_base_->CreateChannel();
#ifndef MAC_IPHONE #ifndef WEBRTC_IOS
// bind to local IP and try again // bind to local IP and try again
strcpy(localIp, "127.0.0.1"); strcpy(localIp, "127.0.0.1");
#else #else
@@ -3326,7 +3326,7 @@ int VoEExtendedTest::TestDtmf() {
SLEEP(1000); SLEEP(1000);
// Switch codec // Switch codec
CodecInst ci; CodecInst ci;
#if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #if (!defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID))
ci.channels = 1; ci.channels = 1;
ci.pacsize = 480; ci.pacsize = 480;
ci.plfreq = 16000; ci.plfreq = 16000;
@@ -4596,7 +4596,7 @@ int VoEExtendedTest::TestFile() {
// Record mixed (speaker + microphone) signal to file // Record mixed (speaker + microphone) signal to file
#if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID)
TEST(StartRecordingSpeakerStereo); TEST(StartRecordingSpeakerStereo);
ANL(); ANL();
TEST(StopRecordingSpeakerStereo); TEST(StopRecordingSpeakerStereo);
@@ -4633,11 +4633,11 @@ int VoEExtendedTest::TestFile() {
ANL(); ANL();
#else #else
TEST_LOG("Skipping stereo record tests -" TEST_LOG("Skipping stereo record tests -"
" MAC_IPHONE or WEBRTC_ANDROID is defined \n"); " WEBRTC_IOS or WEBRTC_ANDROID is defined \n");
#endif // #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) #endif // #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID)
// Conversion between different file formats // Conversion between different file formats
#if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID) #if defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID)
TEST_MUSTPASS(voe_base_->StopPlayout(0)); TEST_MUSTPASS(voe_base_->StopPlayout(0));
TEST_MUSTPASS(voe_base_->StopSend(0)); TEST_MUSTPASS(voe_base_->StopSend(0));
#endif #endif
@@ -4698,7 +4698,7 @@ int VoEExtendedTest::TestFile() {
(output_path + "singleUserDemoConv_dummy.pcm").c_str()));MARK(); (output_path + "singleUserDemoConv_dummy.pcm").c_str()));MARK();
AOK();ANL(); AOK();ANL();
#if defined(MAC_IPHONE) || defined(WEBRTC_ANDROID) #if defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID)
TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(voe_base_->StartPlayout(0));
TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(voe_base_->StartSend(0));
#endif #endif
@@ -4932,7 +4932,7 @@ int VoEExtendedTest::TestHardware() {
} }
ANL(); ANL();
#if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID)
// GetRecording/PlayoutDeviceStatus // GetRecording/PlayoutDeviceStatus
TEST(Getrecording/PlayoutDeviceStatus); TEST(Getrecording/PlayoutDeviceStatus);
ANL(); ANL();
@@ -5032,8 +5032,8 @@ int VoEExtendedTest::TestHardware() {
MARK(); MARK();
#endif #endif
ANL(); ANL();
#endif // #if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID) #endif // #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID)
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
TEST(ResetSoundDevice); ANL(); TEST(ResetSoundDevice); ANL();
for (int p=0; p<=60; p+=20) for (int p=0; p<=60; p+=20)
@@ -5072,8 +5072,8 @@ int VoEExtendedTest::TestHardware() {
TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(voe_base_->StartSend(0));
TEST_MUSTPASS(voe_base_->StartPlayout(0)); TEST_MUSTPASS(voe_base_->StartPlayout(0));
TEST_MUSTPASS(voe_base_->StartReceive(0)); TEST_MUSTPASS(voe_base_->StartReceive(0));
#endif // defined(MAC_IPHONE)) #endif // defined(WEBRTC_IOS))
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
TEST_LOG("\nNOTE: Always run hardware tests also without extended tests " TEST_LOG("\nNOTE: Always run hardware tests also without extended tests "
"enabled,\nsince the extended tests are pre-streaming tests only.\n"); "enabled,\nsince the extended tests are pre-streaming tests only.\n");
#endif #endif
@@ -5111,7 +5111,7 @@ int VoEExtendedTest::TestNetwork() {
#ifdef WEBRTC_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(WEBRTC_IOS) // WEBRTC_IOS needs more delay for getSourceInfo()
int sleepTime = 150; int sleepTime = 150;
int sleepTime2 = 200; int sleepTime2 = 200;
#else #else
@@ -5145,7 +5145,7 @@ int VoEExtendedTest::TestNetwork() {
TEST(GetLocalIP); TEST(GetLocalIP);
ANL(); ANL();
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
// Should fail // Should fail
TEST_MUSTPASS(!netw->GetLocalIP(NULL, 0)); MARK(); TEST_MUSTPASS(!netw->GetLocalIP(NULL, 0)); MARK();
TEST_ERROR(VE_FUNC_NOT_SUPPORTED); TEST_ERROR(VE_FUNC_NOT_SUPPORTED);
@@ -5325,7 +5325,7 @@ int VoEExtendedTest::TestNetwork() {
TEST_MUSTPASS(voe_base_->SetSendDestination(0, 9005, "127.0.0.1", 9020)); TEST_MUSTPASS(voe_base_->SetSendDestination(0, 9005, "127.0.0.1", 9020));
TEST_MUSTPASS(voe_base_->StartSend(0)); TEST_MUSTPASS(voe_base_->StartSend(0));
SLEEP(sleepTime); SLEEP(sleepTime);
#ifdef MAC_IPHONE #ifdef WEBRTC_IOS
SLEEP(500); // Need extra pause for some reason SLEEP(500); // Need extra pause for some reason
#endif #endif
@@ -5461,7 +5461,7 @@ int VoEExtendedTest::TestNetwork() {
MARK(); MARK();
// STATE: external transport is disabled // STATE: external transport is disabled
#if defined(WEBRTC_ANDROID) || defined(MAC_IPHONE) #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
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;
@@ -7064,7 +7064,7 @@ int VoEExtendedTest::TestRTP_RTCP() {
TEST_LOG("Turn FEC and VAD on and wait for 4 seconds and ensure that " TEST_LOG("Turn FEC and VAD on and wait for 4 seconds and ensure that "
"the jitter is still small..."); "the jitter is still small...");
CodecInst cinst; CodecInst cinst;
#if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #if (!defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID))
cinst.pltype = 104; cinst.pltype = 104;
strcpy(cinst.plname, "isac"); strcpy(cinst.plname, "isac");
cinst.plfreq = 32000; cinst.plfreq = 32000;
@@ -7238,7 +7238,7 @@ int VoEExtendedTest::TestRTP_RTCP() {
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(WEBRTC_ANDROID)) #if (!defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID))
cinst.pltype = 104; cinst.pltype = 104;
strcpy(cinst.plname, "isac"); strcpy(cinst.plname, "isac");
cinst.plfreq = 32000; cinst.plfreq = 32000;
@@ -7417,7 +7417,7 @@ int VoEExtendedTest::TestVolumeControl()
TEST_MUSTPASS(voe_base_->Init()); TEST_MUSTPASS(voe_base_->Init());
TEST_MUSTPASS(voe_base_->CreateChannel()); TEST_MUSTPASS(voe_base_->CreateChannel());
#if (defined _TEST_HARDWARE_ && (!defined(MAC_IPHONE))) #if (defined _TEST_HARDWARE_ && (!defined(WEBRTC_IOS)))
#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));
@@ -7439,23 +7439,23 @@ int VoEExtendedTest::TestVolumeControl()
//////////////////////////// ////////////////////////////
// Actual test starts here // Actual test starts here
#if !defined(MAC_IPHONE) #if !defined(WEBRTC_IOS)
TEST(SetSpeakerVolume); TEST(SetSpeakerVolume);
ANL(); ANL();
TEST_MUSTPASS(-1 != volume->SetSpeakerVolume(256)); TEST_MUSTPASS(-1 != volume->SetSpeakerVolume(256));
MARK(); MARK();
TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError());
ANL(); ANL();
#endif // #if !defined(MAC_IPHONE) #endif // #if !defined(WEBRTC_IOS)
#if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #if (!defined(WEBRTC_IOS) && !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 != voe_base_->LastError()); TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError());
ANL(); ANL();
#endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #endif // #if (!defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID))
#if !defined(MAC_IPHONE) #if !defined(WEBRTC_IOS)
TEST(SetChannelOutputVolumeScaling); TEST(SetChannelOutputVolumeScaling);
ANL(); ANL();
TEST_MUSTPASS(-1 != volume->SetChannelOutputVolumeScaling(0, (float)-0.1)); TEST_MUSTPASS(-1 != volume->SetChannelOutputVolumeScaling(0, (float)-0.1));
@@ -7465,8 +7465,8 @@ int VoEExtendedTest::TestVolumeControl()
MARK(); MARK();
TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError());
ANL(); ANL();
#endif // #if !defined(MAC_IPHONE) #endif // #if !defined(WEBRTC_IOS)
#if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #if (!defined(WEBRTC_IOS) && !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,
@@ -7506,7 +7506,7 @@ int VoEExtendedTest::TestVolumeControl()
MARK(); MARK();
TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError());
ANL(); ANL();
#endif // #if (!defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)) #endif // #if (!defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID))
#ifdef _TEST_FILE_ #ifdef _TEST_FILE_
TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0)); TEST_MUSTPASS(file->StopPlayingFileAsMicrophone(0));
#endif #endif

View File

@@ -598,7 +598,7 @@ int RunInManualMode(int argc, char** argv) {
// main // main
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if !defined(MAC_IPHONE) #if !defined(WEBRTC_IOS)
int main(int argc, char** argv) { int main(int argc, char** argv) {
if (argc > 1 && std::string(argv[1]) == "--automated") { if (argc > 1 && std::string(argv[1]) == "--automated") {
// This function is defined in automated_mode.cc to avoid macro clashes // This function is defined in automated_mode.cc to avoid macro clashes
@@ -608,4 +608,4 @@ int main(int argc, char** argv) {
return RunInManualMode(argc, argv); return RunInManualMode(argc, argv);
} }
#endif //#if !defined(MAC_IPHONE) #endif //#if !defined(WEBRTC_IOS)

View File

@@ -44,7 +44,7 @@
namespace webrtc { namespace webrtc {
#if defined(WEBRTC_ANDROID) || defined(MAC_IPHONE) || defined(MAC_IPHONE_SIM) #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
static const EcModes kDefaultEcMode = kEcAecm; static const EcModes kDefaultEcMode = kEcAecm;
#else #else
static const EcModes kDefaultEcMode = kEcAec; static const EcModes kDefaultEcMode = kEcAec;
@@ -183,7 +183,7 @@ int VoEAudioProcessingImpl::SetAgcStatus(bool enable, AgcModes mode) {
return -1; return -1;
} }
#if defined(MAC_IPHONE) || defined(ATA) || defined(WEBRTC_ANDROID) #if defined(WEBRTC_IOS) || defined(ATA) || defined(WEBRTC_ANDROID)
if (mode == kAgcAdaptiveAnalog) { if (mode == kAgcAdaptiveAnalog) {
_shared->SetLastError(VE_INVALID_ARGUMENT, kTraceError, _shared->SetLastError(VE_INVALID_ARGUMENT, kTraceError,
"SetAgcStatus() invalid Agc mode for mobile device"); "SetAgcStatus() invalid Agc mode for mobile device");

View File

@@ -634,7 +634,7 @@ int VoEHardwareImpl::ResetAudioDevice()
return -1; return -1;
} }
#if defined(MAC_IPHONE) #if defined(WEBRTC_IOS)
if (_shared->audio_device()->ResetAudioDevice() < 0) if (_shared->audio_device()->ResetAudioDevice() < 0)
{ {
_shared->SetLastError(VE_SOUNDCARD_ERROR, kTraceError, _shared->SetLastError(VE_SOUNDCARD_ERROR, kTraceError,

View File

@@ -457,7 +457,7 @@ namespace webrtc
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#include <AudioUnit/AudioUnit.h> #include <AudioUnit/AudioUnit.h>
#if !defined(MAC_IPHONE) && !defined(MAC_IPHONE_SIM) #if !defined(WEBRTC_IOS)
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#include <CoreAudio/CoreAudio.h> #include <CoreAudio/CoreAudio.h>
#include <AudioToolbox/DefaultAudioOutput.h> #include <AudioToolbox/DefaultAudioOutput.h>
@@ -517,7 +517,7 @@ namespace
#define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE 0 #define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE 0
// iPhone specific // iPhone specific
#if defined(MAC_IPHONE) || defined(MAC_IPHONE_SIM) #if defined(WEBRTC_IOS)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Enumerators // Enumerators