From f3b65dbfe8a8d88f623d962f8ced78ce764d518e Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Thu, 6 Sep 2012 18:17:00 +0000 Subject: [PATCH] Remove WEBRTC_MAC_INTEL. Review URL: https://webrtc-codereview.appspot.com/765008 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2715 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/build/common.gypi | 1 - .../audio_device/main/source/audio_device_impl.cc | 8 ++++---- src/modules/udp_transport/source/udp_socket_posix.cc | 4 ++-- .../video_capture/main/source/device_info_impl.cc | 6 +++--- .../video_render/main/source/video_render_impl.cc | 12 ++++++------ .../video_render/main/test/testAPI/testAPI.cc | 2 +- src/system_wrappers/source/condition_variable.cc | 4 ++-- src/system_wrappers/source/cpu.cc | 4 +--- src/system_wrappers/source/cpu_info.cc | 4 +--- src/system_wrappers/source/event.cc | 4 ++-- src/system_wrappers/source/thread_posix.cc | 5 ++--- .../test/auto_test/interface/vie_autotest_defines.h | 2 +- .../test/auto_test/source/vie_autotest_capture.cc | 8 ++++---- .../test/auto_test/source/vie_autotest_network.cc | 2 -- src/video_engine/vie_capture_impl.cc | 6 +++--- src/video_engine/vie_defines.h | 2 +- 16 files changed, 33 insertions(+), 41 deletions(-) diff --git a/src/build/common.gypi b/src/build/common.gypi index aa72ea5d57..e41cc26212 100644 --- a/src/build/common.gypi +++ b/src/build/common.gypi @@ -168,7 +168,6 @@ ['OS=="mac"', { 'defines': [ 'WEBRTC_MAC', - 'WEBRTC_MAC_INTEL', # TODO(andrew): remove this. 'WEBRTC_THREAD_RR', 'WEBRTC_CLOCK_TYPE_REALTIME', ], diff --git a/src/modules/audio_device/main/source/audio_device_impl.cc b/src/modules/audio_device/main/source/audio_device_impl.cc index 1d7b8247b4..7d756403e3 100644 --- a/src/modules/audio_device/main/source/audio_device_impl.cc +++ b/src/modules/audio_device/main/source/audio_device_impl.cc @@ -40,7 +40,7 @@ #elif defined(MAC_IPHONE) #include "audio_device_utility_iphone.h" #include "audio_device_iphone.h" -#elif (defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_MAC)) +#elif defined(WEBRTC_MAC) #include "audio_device_utility_mac.h" #include "audio_device_mac.h" #endif @@ -159,7 +159,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::CheckPlatform() #elif defined(WEBRTC_LINUX) platform = kPlatformLinux; WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX"); -#elif (defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_MAC)) +#elif defined(WEBRTC_MAC) platform = kPlatformMac; WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is MAC"); #endif @@ -354,7 +354,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::CreatePlatformSpecificObjects() // Create the *Mac* implementation of the Audio Device // -#elif defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_MAC) if (audioLayer == kPlatformDefaultAudio) { // Create *Mac Audio* implementation @@ -367,7 +367,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::CreatePlatformSpecificObjects() // Create the Mac implementation of the Device Utility. ptrAudioDeviceUtility = new AudioDeviceUtilityMac(Id()); } -#endif // #if defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_MAC) +#endif // WEBRTC_MAC // Create the *Dummy* implementation of the Audio Device // Available for all platforms diff --git a/src/modules/udp_transport/source/udp_socket_posix.cc b/src/modules/udp_transport/source/udp_socket_posix.cc index 69dc0996aa..79b1600aa4 100644 --- a/src/modules/udp_transport/source/udp_socket_posix.cc +++ b/src/modules/udp_transport/source/udp_socket_posix.cc @@ -183,7 +183,7 @@ void UdpSocketPosix::HasIncoming() WebRtc_Word8 buf[2048]; int retval; SocketAddress from; -#if defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_MAC) +#if defined(WEBRTC_MAC) sockaddr sockaddrfrom; memset(&from, 0, sizeof(from)); memset(&sockaddrfrom, 0, sizeof(sockaddrfrom)); @@ -193,7 +193,7 @@ void UdpSocketPosix::HasIncoming() socklen_t fromlen = sizeof(from); #endif -#if defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_MAC) +#if defined(WEBRTC_MAC) retval = recvfrom(_socket,buf, sizeof(buf), 0, reinterpret_cast(&sockaddrfrom), &fromlen); memcpy(&from, &sockaddrfrom, fromlen); diff --git a/src/modules/video_capture/main/source/device_info_impl.cc b/src/modules/video_capture/main/source/device_info_impl.cc index e3f7bb559b..e0d5e7ea34 100644 --- a/src/modules/video_capture/main/source/device_info_impl.cc +++ b/src/modules/video_capture/main/source/device_info_impl.cc @@ -54,7 +54,7 @@ WebRtc_Word32 DeviceInfoImpl::NumberOfCapabilities( if (_lastUsedDeviceNameLength == strlen((char*) deviceUniqueIdUTF8)) { // Is it the same device that is asked for again. -#if defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_LINUX) +#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) if(strncasecmp((char*)_lastUsedDeviceName, (char*) deviceUniqueIdUTF8, _lastUsedDeviceNameLength)==0) @@ -91,7 +91,7 @@ WebRtc_Word32 DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8, ReadLockScoped cs(_apiLock); if ((_lastUsedDeviceNameLength != strlen((char*) deviceUniqueIdUTF8)) -#if defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_LINUX) +#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) || (strncasecmp((char*)_lastUsedDeviceName, (char*) deviceUniqueIdUTF8, _lastUsedDeviceNameLength)!=0)) @@ -155,7 +155,7 @@ WebRtc_Word32 DeviceInfoImpl::GetBestMatchedCapability( ReadLockScoped cs(_apiLock); if ((_lastUsedDeviceNameLength != strlen((char*) deviceUniqueIdUTF8)) -#if defined(WEBRTC_MAC_INTEL) || defined(WEBRTC_LINUX) +#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) || (strncasecmp((char*)_lastUsedDeviceName, (char*) deviceUniqueIdUTF8, _lastUsedDeviceNameLength)!=0)) diff --git a/src/modules/video_render/main/source/video_render_impl.cc b/src/modules/video_render/main/source/video_render_impl.cc index 6291791ffb..1e0ccb742d 100644 --- a/src/modules/video_render/main/source/video_render_impl.cc +++ b/src/modules/video_render/main/source/video_render_impl.cc @@ -24,7 +24,7 @@ #include "windows/video_render_windows_impl.h" #define STANDARD_RENDERING kRenderWindows -// MAC_IPHONE should go before WEBRTC_MAC_INTEL because WEBRTC_MAC_INTEL +// MAC_IPHONE should go before WEBRTC_MAC because WEBRTC_MAC // gets defined if MAC_IPHONE is defined #elif defined(MAC_IPHONE) #if defined(IPHONE_GLES_RENDERING) @@ -32,7 +32,7 @@ #include "iPhone/video_render_iphone_impl.h" #endif -#elif defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) #if defined(COCOA_RENDERING) #define STANDARD_RENDERING kRenderCocoa #include "mac/video_render_mac_cocoa_impl.h" @@ -127,7 +127,7 @@ ModuleVideoRenderImpl::ModuleVideoRenderImpl( } break; -#elif defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) #if defined(COCOA_RENDERING) case kRenderCocoa: @@ -256,7 +256,7 @@ ModuleVideoRenderImpl::~ModuleVideoRenderImpl() delete ptrRenderer; } break; -#elif defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) #if defined(COCOA_RENDERING) case kRenderCocoa: @@ -350,7 +350,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) #ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER -#if defined(MAC_IPHONE) // MAC_IPHONE must go before WEBRTC_MAC or WEBRTC_MAC_INTEL +#if defined(MAC_IPHONE) // MAC_IPHONE must go before WEBRTC_MAC _ptrRenderer = NULL; delete _ptrRenderer; @@ -363,7 +363,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) _ptrRenderer = reinterpret_cast(ptrRenderer); return _ptrRenderer->ChangeWindow(window); -#elif defined(WEBRTC_MAC) | defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) _ptrRenderer = NULL; delete _ptrRenderer; diff --git a/src/modules/video_render/main/test/testAPI/testAPI.cc b/src/modules/video_render/main/test/testAPI/testAPI.cc index 96defb5f40..5d7a67d12d 100644 --- a/src/modules/video_render/main/test/testAPI/testAPI.cc +++ b/src/modules/video_render/main/test/testAPI/testAPI.cc @@ -77,7 +77,7 @@ unsigned long timeGetTime() return(val); } -#elif defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) #include diff --git a/src/system_wrappers/source/condition_variable.cc b/src/system_wrappers/source/condition_variable.cc index b37d03784f..d67608c61d 100644 --- a/src/system_wrappers/source/condition_variable.cc +++ b/src/system_wrappers/source/condition_variable.cc @@ -16,7 +16,7 @@ #include #include "condition_variable_wrapper.h" #include "condition_variable_posix.h" -#elif defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) #include #include "condition_variable_wrapper.h" #include "condition_variable_posix.h" @@ -28,7 +28,7 @@ ConditionVariableWrapper::CreateConditionVariable() { #if defined(_WIN32) return new ConditionVariableWindows; -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) return ConditionVariablePosix::Create(); #else return NULL; diff --git a/src/system_wrappers/source/cpu.cc b/src/system_wrappers/source/cpu.cc index 3df5d183e1..273d62771b 100644 --- a/src/system_wrappers/source/cpu.cc +++ b/src/system_wrappers/source/cpu.cc @@ -14,8 +14,6 @@ #include "cpu_win.h" #elif defined(WEBRTC_MAC) #include "cpu_mac.h" -#elif defined(WEBRTC_MAC_INTEL) - #include "cpu_mac.h" #elif defined(WEBRTC_ANDROID) // Not implemented yet, might be possible to use Linux implementation #else // defined(WEBRTC_LINUX) @@ -27,7 +25,7 @@ CpuWrapper* CpuWrapper::CreateCpu() { #if defined(_WIN32) return new CpuWindows(); -#elif (defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL)) +#elif defined(WEBRTC_MAC) return new CpuWrapperMac(); #elif defined(WEBRTC_ANDROID) return 0; diff --git a/src/system_wrappers/source/cpu_info.cc b/src/system_wrappers/source/cpu_info.cc index e367abfbdf..f059a8cd3e 100644 --- a/src/system_wrappers/source/cpu_info.cc +++ b/src/system_wrappers/source/cpu_info.cc @@ -15,8 +15,6 @@ #elif defined(WEBRTC_MAC) #include #include -#elif defined(WEBRTC_MAC_INTEL) -// Intentionally empty #elif defined(WEBRTC_ANDROID) // Not implemented yet, might be possible to use Linux implementation #else // defined(WEBRTC_LINUX) @@ -45,7 +43,7 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCores() WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Available number of cores:%d", _numberOfCores); -#elif (defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL)) +#elif defined(WEBRTC_MAC) int name[] = {CTL_HW, HW_AVAILCPU}; int ncpu; size_t size = sizeof(ncpu); diff --git a/src/system_wrappers/source/event.cc b/src/system_wrappers/source/event.cc index 608cd539c4..71a81932b5 100644 --- a/src/system_wrappers/source/event.cc +++ b/src/system_wrappers/source/event.cc @@ -13,7 +13,7 @@ #if defined(_WIN32) #include #include "event_win.h" -#elif defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) #include #include #include "event_posix.h" @@ -49,7 +49,7 @@ int EventWrapper::KeyPressed() { return 0; } -#elif defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) bool keyDown = false; // loop through all Mac virtual key constant values for(int keyIndex = 0; keyIndex <= 0x5C; keyIndex++) diff --git a/src/system_wrappers/source/thread_posix.cc b/src/system_wrappers/source/thread_posix.cc index 6334490f78..173cc1bc60 100644 --- a/src/system_wrappers/source/thread_posix.cc +++ b/src/system_wrappers/source/thread_posix.cc @@ -157,9 +157,8 @@ ThreadPosix::~ThreadPosix() delete _crit_state; } -#define HAS_THREAD_ID !defined(MAC_IPHONE) && !defined(MAC_IPHONE_SIM) && \ - !defined(WEBRTC_MAC) && !defined(WEBRTC_MAC_INTEL) && \ - !defined(MAC_DYLIB) && !defined(MAC_INTEL_DYLIB) +#define HAS_THREAD_ID !defined(MAC_IPHONE) && !defined(MAC_IPHONE_SIM) && \ + !defined(WEBRTC_MAC) #if HAS_THREAD_ID bool ThreadPosix::Start(unsigned int& threadID) #else diff --git a/src/video_engine/test/auto_test/interface/vie_autotest_defines.h b/src/video_engine/test/auto_test/interface/vie_autotest_defines.h index 536747130e..ca4347b2c8 100644 --- a/src/video_engine/test/auto_test/interface/vie_autotest_defines.h +++ b/src/video_engine/test/auto_test/interface/vie_autotest_defines.h @@ -192,7 +192,7 @@ private: // milliseconds #if defined(_WIN32) #define AutoTestSleep ::Sleep -#elif defined(WEBRTC_MAC_INTEL) +#elif defined(WEBRTC_MAC) #define AutoTestSleep(x) usleep(x * 1000) #elif defined(WEBRTC_LINUX) namespace { diff --git a/src/video_engine/test/auto_test/source/vie_autotest_capture.cc b/src/video_engine/test/auto_test/source/vie_autotest_capture.cc index 174d1dbe4c..8a7887cbf5 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_capture.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_capture.cc @@ -140,7 +140,7 @@ void ViEAutoTest::ViECaptureStandardTest() { ViETest::Log("Found capture device %s\nUnique name %s", device_name, device_unique_name); -#if !defined(WEBRTC_MAC_INTEL) // these functions will return -1 +#if !defined(WEBRTC_MAC) // these functions will return -1 int number_of_capabilities = dev_info->NumberOfCapabilities(device_unique_name); EXPECT_GT(number_of_capabilities, 0); @@ -163,8 +163,8 @@ void ViEAutoTest::ViECaptureStandardTest() { } #endif } - // Capture Capability Functions are not supported on WEBRTC_MAC_INTEL. -#if !defined(WEBRTC_MAC_INTEL) + // Capture Capability Functions are not supported on WEBRTC_MAC. +#if !defined(WEBRTC_MAC) // Check allocation. Try to allocate them all after each other. for (int device_index = 0; device_index < number_of_capture_devices; @@ -250,7 +250,7 @@ void ViEAutoTest::ViECaptureStandardTest() { #endif // !WEBRTC_ANDROID vcpms[device_index]->Release(); } -#endif // !WEBRTC_MAC_INTEL +#endif // !WEBRTC_MAC } void ViEAutoTest::ViECaptureExtendedTest() { diff --git a/src/video_engine/test/auto_test/source/vie_autotest_network.cc b/src/video_engine/test/auto_test/source/vie_autotest_network.cc index eba8a6ca43..d39279fe8c 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_network.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_network.cc @@ -23,8 +23,6 @@ #if defined(_WIN32) #include -#elif defined(WEBRTC_MAC_INTEL) - #endif class ViEAutoTestNetworkObserver: public webrtc::ViENetworkObserver diff --git a/src/video_engine/vie_capture_impl.cc b/src/video_engine/vie_capture_impl.cc index 410720da1d..53fe811f4a 100644 --- a/src/video_engine/vie_capture_impl.cc +++ b/src/video_engine/vie_capture_impl.cc @@ -419,7 +419,7 @@ int ViECaptureImpl::NumberOfCapabilities( WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), "%s(capture_device_name: %s)", __FUNCTION__, unique_idUTF8); -#if defined(WEBRTC_MAC_INTEL) +#if defined(WEBRTC_MAC) // TODO(mflodman) Move to capture module! // QTKit framework handles all capabilities and capture settings // automatically (mandatory). @@ -450,7 +450,7 @@ int ViECaptureImpl::GetCaptureCapability(const char* unique_idUTF8, WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), "%s(capture_device_name: %s)", __FUNCTION__, unique_idUTF8); -#if defined(WEBRTC_MAC_INTEL) +#if defined(WEBRTC_MAC) // TODO(mflodman) Move to capture module! // QTKit framework handles all capabilities and capture settings // automatically (mandatory). @@ -483,7 +483,7 @@ int ViECaptureImpl::ShowCaptureSettingsDialogBox( void* parent_window, const unsigned int x, const unsigned int y) { -#if defined(WEBRTC_MAC_INTEL) +#if defined(WEBRTC_MAC) // TODO(mflodman) Move to capture module // QTKit framework handles all capabilities and capture settings // automatically (mandatory). diff --git a/src/video_engine/vie_defines.h b/src/video_engine/vie_defines.h index 2cc18cc7e4..0d74114465 100644 --- a/src/video_engine/vie_defines.h +++ b/src/video_engine/vie_defines.h @@ -148,7 +148,7 @@ inline int ChannelId(const int moduleId) { #endif // Mac specific. -#ifdef WEBRTC_MAC_INTEL +#ifdef WEBRTC_MAC #define SLEEP(x) usleep(x * 1000) // Build information macros.