diff options
author | kjellander <kjellander@webrtc.org> | 2016-01-14 11:01:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-14 19:01:25 +0000 |
commit | fcfc804e436502d49b2176fec1f40dce3585527f (patch) | |
tree | 24cc77d16648f1b7199d86a69f59e83716078672 | |
parent | 3542013f587f0858fb24fa8e554ec3c01a323da8 (diff) | |
download | webrtc-fcfc804e436502d49b2176fec1f40dce3585527f.tar.gz |
Eliminate defines in talk/
Replace LINUX, OSX and IOS defines with WEBRTC_ prefixed versions.
Remove no longer used defines from talk/build/common.gypi due to
previously migrated sources (into webrtc/p2p and webrtc/libjingle).
When this is rolled into Chromium, we can also clean up the platform
defines in
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/libjingle/libjingle.gyp
NOTRY=True
BUG=webrtc:5420
TESTED=Ran all compile trybots with --clobber flag.
TBR=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1588453005
Cr-Commit-Position: refs/heads/master@{#11254}
-rw-r--r-- | talk/build/common.gypi | 11 | ||||
-rw-r--r-- | talk/media/base/executablehelpers.h | 14 | ||||
-rw-r--r-- | talk/media/base/mediaengine.h | 2 | ||||
-rw-r--r-- | talk/media/base/videocapturer.cc | 4 | ||||
-rw-r--r-- | talk/media/devices/devicemanager.cc | 2 | ||||
-rw-r--r-- | talk/media/devices/devicemanager_unittest.cc | 8 | ||||
-rw-r--r-- | talk/media/devices/fakedevicemanager.h | 2 | ||||
-rw-r--r-- | talk/media/devices/v4llookup.h | 4 | ||||
-rw-r--r-- | talk/media/devices/videorendererfactory.h | 9 | ||||
-rw-r--r-- | talk/media/webrtc/webrtcvoiceengine.cc | 10 | ||||
-rw-r--r-- | webrtc/base/unixfilesystem.cc | 2 | ||||
-rw-r--r-- | webrtc/modules/video_render/test/testAPI/testAPI.cc | 2 |
12 files changed, 30 insertions, 40 deletions
diff --git a/talk/build/common.gypi b/talk/build/common.gypi index 48059e2937..061b06ba70 100644 --- a/talk/build/common.gypi +++ b/talk/build/common.gypi @@ -60,17 +60,9 @@ '../../webrtc', ], 'defines': [ - 'EXPAT_RELATIVE_PATH', - 'FEATURE_ENABLE_VOICEMAIL', - 'GTEST_RELATIVE_PATH', - 'JSONCPP_RELATIVE_PATH', - 'LOGGING=1', 'SRTP_RELATIVE_PATH', # Feature selection - 'FEATURE_ENABLE_SSL', - 'FEATURE_ENABLE_VOICEMAIL', - 'FEATURE_ENABLE_PSTN', 'HAVE_SCTP', 'HAVE_SRTP', 'HAVE_WEBRTC_VIDEO', @@ -79,7 +71,6 @@ 'conditions': [ ['OS=="linux"', { 'defines': [ - 'LINUX', 'WEBRTC_LINUX', ], # Remove Chromium's disabling of the -Wformat warning. @@ -111,7 +102,6 @@ }], ['OS=="mac"', { 'defines': [ - 'OSX', 'WEBRTC_MAC', ], }], @@ -128,7 +118,6 @@ }], ['OS=="ios"', { 'defines': [ - 'IOS', 'WEBRTC_MAC', 'WEBRTC_IOS', ], diff --git a/talk/media/base/executablehelpers.h b/talk/media/base/executablehelpers.h index 401890f4e8..dd165c25da 100644 --- a/talk/media/base/executablehelpers.h +++ b/talk/media/base/executablehelpers.h @@ -28,7 +28,7 @@ #ifndef TALK_MEDIA_BASE_EXECUTABLEHELPERS_H_ #define TALK_MEDIA_BASE_EXECUTABLEHELPERS_H_ -#ifdef OSX +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) #include <mach-o/dyld.h> #endif @@ -62,15 +62,15 @@ inline Pathname GetExecutablePath() { #else // UNICODE rtc::Pathname path(exe_path_buffer); #endif // UNICODE -#elif defined(OSX) || defined(LINUX) +#elif (defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)) || defined(WEBRTC_LINUX) char exe_path_buffer[kMaxExePathSize]; -#ifdef OSX +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) uint32_t copied_length = kMaxExePathSize - 1; if (_NSGetExecutablePath(exe_path_buffer, &copied_length) == -1) { LOG(LS_ERROR) << "Buffer too small"; return rtc::Pathname(); } -#elif defined LINUX +#elif defined WEBRTC_LINUX int32_t copied_length = kMaxExePathSize - 1; const char* kProcExeFmt = "/proc/%d/exe"; char proc_exe_link[40]; @@ -86,11 +86,11 @@ inline Pathname GetExecutablePath() { return rtc::Pathname(); } exe_path_buffer[copied_length] = '\0'; -#endif // LINUX +#endif // WEBRTC_LINUX rtc::Pathname path(exe_path_buffer); -#else // Android || IOS +#else // Android || iOS rtc::Pathname path; -#endif // OSX || LINUX +#endif // Mac || Linux return path; } diff --git a/talk/media/base/mediaengine.h b/talk/media/base/mediaengine.h index 43b4de5a52..467614bb3e 100644 --- a/talk/media/base/mediaengine.h +++ b/talk/media/base/mediaengine.h @@ -28,7 +28,7 @@ #ifndef TALK_MEDIA_BASE_MEDIAENGINE_H_ #define TALK_MEDIA_BASE_MEDIAENGINE_H_ -#ifdef OSX +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) #include <CoreAudio/CoreAudio.h> #endif diff --git a/talk/media/base/videocapturer.cc b/talk/media/base/videocapturer.cc index f40f41f956..d525a4188e 100644 --- a/talk/media/base/videocapturer.cc +++ b/talk/media/base/videocapturer.cc @@ -59,7 +59,7 @@ enum { }; static const int64_t kMaxDistance = ~(static_cast<int64_t>(1) << 63); -#ifdef LINUX +#ifdef WEBRTC_LINUX static const int kYU12Penalty = 16; // Needs to be higher than MJPG index. #endif static const int kDefaultScreencastFps = 5; @@ -594,7 +594,7 @@ int64_t VideoCapturer::GetFormatDistance(const VideoFormat& desired, for (size_t i = 0; i < preferred_fourccs.size(); ++i) { if (supported_fourcc == CanonicalFourCC(preferred_fourccs[i])) { delta_fourcc = i; -#ifdef LINUX +#ifdef WEBRTC_LINUX // For HD avoid YU12 which is a software conversion and has 2 bugs // b/7326348 b/6960899. Reenable when fixed. if (supported.height >= 720 && (supported_fourcc == FOURCC_YU12 || diff --git a/talk/media/devices/devicemanager.cc b/talk/media/devices/devicemanager.cc index 1d7ac5baf1..eca14a5def 100644 --- a/talk/media/devices/devicemanager.cc +++ b/talk/media/devices/devicemanager.cc @@ -123,7 +123,7 @@ bool DeviceManager::GetAudioOutputDevice(const std::string& name, Device* out) { bool DeviceManager::GetVideoCaptureDevices(std::vector<Device>* devices) { devices->clear(); -#if defined(ANDROID) || defined(IOS) +#if defined(ANDROID) || defined(WEBRTC_IOS) // On Android and iOS, we treat the camera(s) as a single device. Even if // there are multiple cameras, that's abstracted away at a higher level. Device dev("camera", "1"); // name and ID diff --git a/talk/media/devices/devicemanager_unittest.cc b/talk/media/devices/devicemanager_unittest.cc index ead01842e0..606a05e7c3 100644 --- a/talk/media/devices/devicemanager_unittest.cc +++ b/talk/media/devices/devicemanager_unittest.cc @@ -48,10 +48,10 @@ #include "webrtc/base/stream.h" #include "webrtc/base/windowpickerfactory.h" -#ifdef LINUX +#ifdef WEBRTC_LINUX // TODO(juberti): Figure out why this doesn't compile on Windows. #include "webrtc/base/fileutils_mock.h" -#endif // LINUX +#endif // WEBRTC_LINUX using rtc::Pathname; using rtc::FileTimeType; @@ -285,7 +285,7 @@ TEST(DeviceManagerTest, VerifyFilterDevices) { arraysize(kDevicesName))); } -#ifdef LINUX +#ifdef WEBRTC_LINUX class FakeV4LLookup : public cricket::V4LLookup { public: explicit FakeV4LLookup(std::vector<std::string> device_paths) @@ -377,7 +377,7 @@ TEST(DeviceManagerTest, GetVideoCaptureDevices_KUnknown) { EXPECT_EQ("/dev/video0", video_ins.at(0).name); EXPECT_EQ("/dev/video5", video_ins.at(1).name); } -#endif // LINUX +#endif // WEBRTC_LINUX // TODO(noahric): These are flaky on windows on headless machines. #ifndef WIN32 diff --git a/talk/media/devices/fakedevicemanager.h b/talk/media/devices/fakedevicemanager.h index a4b2b86e44..77a83424b2 100644 --- a/talk/media/devices/fakedevicemanager.h +++ b/talk/media/devices/fakedevicemanager.h @@ -156,7 +156,7 @@ class FakeDeviceManager : public DeviceManagerInterface { return true; } -#ifdef OSX +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) bool QtKitToSgDevice(const std::string& qtkit_name, Device* out) { out->name = qtkit_name; out->id = "sg:" + qtkit_name; diff --git a/talk/media/devices/v4llookup.h b/talk/media/devices/v4llookup.h index 1bed90b650..5c53ede99f 100644 --- a/talk/media/devices/v4llookup.h +++ b/talk/media/devices/v4llookup.h @@ -37,7 +37,7 @@ #include <string> -#ifdef LINUX +#ifdef WEBRTC_LINUX namespace cricket { class V4LLookup { public: @@ -66,5 +66,5 @@ class V4LLookup { } // namespace cricket -#endif // LINUX +#endif // WEBRTC_LINUX #endif // TALK_MEDIA_DEVICES_V4LLOOKUP_H_ diff --git a/talk/media/devices/videorendererfactory.h b/talk/media/devices/videorendererfactory.h index 416f05b297..b7128f625d 100644 --- a/talk/media/devices/videorendererfactory.h +++ b/talk/media/devices/videorendererfactory.h @@ -32,9 +32,9 @@ #define TALK_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_ #include "talk/media/base/videorenderer.h" -#if defined(LINUX) && defined(HAVE_GTK) +#if defined(WEBRTC_LINUX) && defined(HAVE_GTK) #include "talk/media/devices/gtkvideorenderer.h" -#elif defined(OSX) && !defined(CARBON_DEPRECATED) +#elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) && !defined(CARBON_DEPRECATED) #include "talk/media/devices/carbonvideorenderer.h" #elif defined(WIN32) #include "talk/media/devices/gdivideorenderer.h" @@ -45,9 +45,10 @@ namespace cricket { class VideoRendererFactory { public: static VideoRenderer* CreateGuiVideoRenderer(int x, int y) { - #if defined(LINUX) && defined(HAVE_GTK) + #if defined(WEBRTC_LINUX) && defined(HAVE_GTK) return new GtkVideoRenderer(x, y); - #elif defined(OSX) && !defined(CARBON_DEPRECATED) + #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) && \ + !defined(CARBON_DEPRECATED) CarbonVideoRenderer* renderer = new CarbonVideoRenderer(x, y); // Needs to be initialized on the main thread. if (renderer->Initialize()) { diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc index 9742564985..9192b72539 100644 --- a/talk/media/webrtc/webrtcvoiceengine.cc +++ b/talk/media/webrtc/webrtcvoiceengine.cc @@ -601,7 +601,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { << " (default is false)."; } -#if defined(IOS) +#if defined(WEBRTC_IOS) // On iOS, VPIO provides built-in EC and AGC. options.echo_cancellation = rtc::Optional<bool>(false); options.auto_gain_control = rtc::Optional<bool>(false); @@ -610,7 +610,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { ec_mode = webrtc::kEcAecm; #endif -#if defined(IOS) || defined(ANDROID) +#if defined(WEBRTC_IOS) || defined(ANDROID) // Set the AGC mode for iOS as well despite disabling it above, to avoid // unsupported configuration errors from webrtc. agc_mode = webrtc::kAgcFixedDigital; @@ -623,7 +623,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { // Delay Agnostic AEC automatically turns on EC if not set except on iOS // where the feature is not supported. bool use_delay_agnostic_aec = false; -#if !defined(IOS) +#if !defined(WEBRTC_IOS) if (options.delay_agnostic_aec) { use_delay_agnostic_aec = *options.delay_agnostic_aec; if (use_delay_agnostic_aec) { @@ -861,7 +861,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { void WebRtcVoiceEngine::SetDefaultDevices() { RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); -#if !defined(IOS) +#if !defined(WEBRTC_IOS) int in_id = kDefaultAudioDeviceId; int out_id = kDefaultAudioDeviceId; LOG(LS_INFO) << "Setting microphone to (id=" << in_id @@ -886,7 +886,7 @@ void WebRtcVoiceEngine::SetDefaultDevices() { LOG(LS_INFO) << "Set microphone to (id=" << in_id << ") and speaker to (id=" << out_id << ")"; } -#endif // !IOS +#endif // !WEBRTC_IOS } bool WebRtcVoiceEngine::GetOutputVolume(int* level) { diff --git a/webrtc/base/unixfilesystem.cc b/webrtc/base/unixfilesystem.cc index 734e880d9e..b474324192 100644 --- a/webrtc/base/unixfilesystem.cc +++ b/webrtc/base/unixfilesystem.cc @@ -373,7 +373,7 @@ bool UnixFilesystem::GetAppPathname(Pathname* path) { return success; #elif defined(__native_client__) return false; -#elif IOS +#elif WEBRTC_IOS IOSAppName(path); return true; #else // WEBRTC_MAC && !defined(WEBRTC_IOS) diff --git a/webrtc/modules/video_render/test/testAPI/testAPI.cc b/webrtc/modules/video_render/test/testAPI/testAPI.cc index 06ea00b5ad..cea2f6b56f 100644 --- a/webrtc/modules/video_render/test/testAPI/testAPI.cc +++ b/webrtc/modules/video_render/test/testAPI/testAPI.cc @@ -244,7 +244,7 @@ int WebRtcCreateWindow(Window *outWindow, Display **outDisplay, int winNum, int return 0; } -#endif // LINUX +#endif // WEBRTC_LINUX // Note: Mac code is in testApi_mac.mm. |