diff --git a/src/modules/video_capture/main/test/testAPI/Renderer.cpp b/src/modules/video_capture/main/test/testAPI/Renderer.cpp index a009357e7..3fd878fdb 100644 --- a/src/modules/video_capture/main/test/testAPI/Renderer.cpp +++ b/src/modules/video_capture/main/test/testAPI/Renderer.cpp @@ -202,7 +202,7 @@ void SetWindowPos(CocoaRenderer*& cocoaRenderer, int x, int y, int width, int he // [ownerWindow setLevel:NSNormalWindowLevel]; // } } -#elif defined(ANDROID) +#elif defined(WEBRTC_ANDROID) #define nil NULL #define NO false jobject Renderer::g_renderWindow=NULL; diff --git a/src/modules/video_capture/main/test/testAPI/Renderer.h b/src/modules/video_capture/main/test/testAPI/Renderer.h index 43f5699f3..3f86fb679 100644 --- a/src/modules/video_capture/main/test/testAPI/Renderer.h +++ b/src/modules/video_capture/main/test/testAPI/Renderer.h @@ -20,7 +20,7 @@ #import //#import "CocoaWindow.h" #import "cocoa_renderer.h" -#elif defined (ANDROID) +#elif defined (WEBRTC_ANDROID) #include #elif defined(WEBRTC_LINUX) typedef void* HWND; @@ -42,7 +42,7 @@ public: void PaintBlue(); void* GetWindow(); -#if defined (ANDROID) +#if defined (WEBRTC_ANDROID) static void SetRenderWindow(jobject renderWindow); #endif @@ -65,7 +65,7 @@ private: #elif defined(WEBRTC_MAC_INTEL) NSAutoreleasePool* _pool; CocoaRenderer* _renderWindow; -#elif defined (ANDROID) +#elif defined (WEBRTC_ANDROID) jobject _renderWindow; //this is a glsurface. public: static jobject g_renderWindow; diff --git a/src/modules/video_capture/main/test/testAPI/testDefines.h b/src/modules/video_capture/main/test/testAPI/testDefines.h index d032c6948..e24ac955d 100644 --- a/src/modules/video_capture/main/test/testAPI/testDefines.h +++ b/src/modules/video_capture/main/test/testAPI/testDefines.h @@ -17,42 +17,38 @@ #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_TEST_TESTAPI_TESTDEFINES_H_ #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_TEST_TESTAPI_TESTDEFINES_H_ - -#if defined (ANDROID) +#if defined (WEBRTC_ANDROID) #include #include #endif - - - #if defined(_WIN32) - #define SLEEP(x) Sleep(x) - #define SPRINTF(x, y, z, ...) sprintf_s(x, y, z, __VA_ARGS__) - #define LOG(...) { \ - char msg[512]; \ - sprintf_s(msg,512,__VA_ARGS__); \ - _logger.Print(msg); \ - } -#elif defined (ANDROID) - #define LOG(...) { \ - char msg[512]; \ - sprintf(msg,__VA_ARGS__); \ - __android_log_print(ANDROID_LOG_DEBUG, "VideoCaptureModule -testAPI", __VA_ARGS__);\ - _logger.Print(msg); \ - } - #define SLEEP(x) usleep(x*1000) - #define SPRINTF(x, y, z, ...) sprintf(x, z, __VA_ARGS__) +#define SLEEP(x) Sleep(x) +#define SPRINTF(x, y, z, ...) sprintf_s(x, y, z, __VA_ARGS__) +#define LOG(...) { \ + char msg[512]; \ + sprintf_s(msg,512,__VA_ARGS__); \ + _logger.Print(msg); \ + } +#elif defined (WEBRTC_ANDROID) +#define LOG(...) { \ + char msg[512]; \ + sprintf(msg,__VA_ARGS__); \ + __android_log_print(ANDROID_LOG_DEBUG, \ + "VideoCaptureModule -testAPI", __VA_ARGS__); \ + _logger.Print(msg); \ + } +#define SLEEP(x) usleep(x*1000) +#define SPRINTF(x, y, z, ...) sprintf(x, z, __VA_ARGS__) #else - #include - #define SLEEP(x) usleep(x * 1000) - #define SPRINTF(x, y, z, ...) sprintf(x, z, __VA_ARGS__) - #define LOG(...) { \ - char msg[512]; \ - sprintf(msg, __VA_ARGS__); \ - printf("%s\n", msg); \ - } - +#include +#define SLEEP(x) usleep(x * 1000) +#define SPRINTF(x, y, z, ...) sprintf(x, z, __VA_ARGS__) +#define LOG(...) { \ + char msg[512]; \ + sprintf(msg, __VA_ARGS__); \ + printf("%s\n", msg); \ + } #endif #endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_TEST_TESTAPI_TESTDEFINES_H_ diff --git a/src/modules/video_capture/main/test/testAPI/testPlatformDependent.cpp b/src/modules/video_capture/main/test/testAPI/testPlatformDependent.cpp index 49d9895d4..82e928d17 100644 --- a/src/modules/video_capture/main/test/testAPI/testPlatformDependent.cpp +++ b/src/modules/video_capture/main/test/testAPI/testPlatformDependent.cpp @@ -452,7 +452,7 @@ int testPlatformDependent::DoTest() testRotation(uniqueID); } -#ifndef ANDROID +#ifndef WEBRTC_ANDROID _logger.SetFileName("testPlatformDependent_multipleCameras.txt"); testMultipleCameras(); #endif diff --git a/src/video_engine/main/source/vie_defines.h b/src/video_engine/main/source/vie_defines.h index 1945afeb9..934a03be8 100644 --- a/src/video_engine/main/source/vie_defines.h +++ b/src/video_engine/main/source/vie_defines.h @@ -22,7 +22,7 @@ #include #endif -#ifdef ANDROID +#ifdef WEBRTC_ANDROID #include #include #include @@ -237,7 +237,7 @@ ODE TEXT("d") #define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE #endif // ifdef WEBRTC_LINUX -#endif // ifndef ANDROID +#endif // ifndef WEBRTC_ANDROID #ifdef WEBRTC_ANDROID @@ -260,7 +260,7 @@ ODE TEXT("d") // example: "Oct 10 2002 12:05:30 r" #define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE -#endif // #ifdef ANDROID +#endif // #ifdef WEBRTC_ANDROID } //namespace webrtc #endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_ diff --git a/src/video_engine/main/source/vie_impl.cc b/src/video_engine/main/source/vie_impl.cc index 2f7af5b71..4f9741b9a 100644 --- a/src/video_engine/main/source/vie_impl.cc +++ b/src/video_engine/main/source/vie_impl.cc @@ -20,7 +20,7 @@ #include // For _T #endif -#ifdef ANDROID +#ifdef WEBRTC_ANDROID #include "video_capture.h" #include "video_render.h" #endif @@ -280,7 +280,7 @@ int VideoEngine::SetAndroidObjects(void* javaVM, void* javaContext) WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, gViEActiveInstanceCounter, "SetAndroidObjects()"); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID if (VideoCaptureModule::SetAndroidObjects(javaVM,javaContext) != 0) { WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, gViEActiveInstanceCounter, diff --git a/src/video_engine/main/test/AutoTest/interface/vie_autotest.h b/src/video_engine/main/test/AutoTest/interface/vie_autotest.h index 96d2535a9..d17ee8b7f 100644 --- a/src/video_engine/main/test/AutoTest/interface/vie_autotest.h +++ b/src/video_engine/main/test/AutoTest/interface/vie_autotest.h @@ -33,7 +33,7 @@ #include "vie_errors.h" #include "video_render_defines.h" -#ifndef ANDROID +#ifndef WEBRTC_ANDROID #include #endif @@ -57,7 +57,7 @@ public: bool GetVideoDevice(ViEBase* ptrViEBase, ViECapture* ptrViECapture, char* captureDeviceName, char* captureDeviceUniqueId); bool GetIPAddress(char* IP); -#ifndef ANDROID +#ifndef WEBRTC_ANDROID bool ValidateIP(std::string iStr); #endif void PrintCallInformation(char* IP, char* videoCaptureDeviceName, diff --git a/src/video_engine/main/test/AutoTest/interface/vie_autotest_defines.h b/src/video_engine/main/test/AutoTest/interface/vie_autotest_defines.h index b7b101290..ee0f0146f 100644 --- a/src/video_engine/main/test/AutoTest/interface/vie_autotest_defines.h +++ b/src/video_engine/main/test/AutoTest/interface/vie_autotest_defines.h @@ -171,7 +171,7 @@ public: } #endif #ifdef VIE_LOG_TO_STDOUT -#if ANDROID +#if WEBRTC_ANDROID __android_log_write(ANDROID_LOG_DEBUG, "*WebRTCN*", _logStr); #else printf(_logStr); @@ -201,7 +201,7 @@ public: va_start(va, fmt); memset(_logStr, 0, KMaxLogSize); vsprintf(_logStr, fmt, va); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID __android_log_write(ANDROID_LOG_ERROR, "*WebRTCN*", _logStr); #endif Log(_logStr); diff --git a/src/video_engine/main/test/AutoTest/source/tb_interfaces.cc b/src/video_engine/main/test/AutoTest/source/tb_interfaces.cc index 3c3483da5..954d5d980 100644 --- a/src/video_engine/main/test/AutoTest/source/tb_interfaces.cc +++ b/src/video_engine/main/test/AutoTest/source/tb_interfaces.cc @@ -16,7 +16,7 @@ tbInterfaces::tbInterfaces(const char* testName, int& nrOfErrors) : char traceFile[256] = ""; char traceFileEnc[256] = ""; -#ifdef ANDROID +#ifdef WEBRTC_ANDROID strcat(traceFile,"/sdcard/"); #endif strcat(traceFile, testName); diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_base.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_base.cc index 81a8a4ea9..e84b2445e 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_base.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_base.cc @@ -38,7 +38,7 @@ int ViEAutoTest::ViEBaseStandardTest() numberOfErrors += ViETest::TestError(ptrViE != NULL, "ERROR: %s at line %d", __FUNCTION__, __LINE__); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID error = ptrViE->SetTraceFile("/sdcard/ViEBaseStandardTest.txt"); numberOfErrors += ViETest::TestError(error == 0, "ERROR: %s at line %d", __FUNCTION__, @@ -416,7 +416,7 @@ int ViEAutoTest::ViEBaseAPITest() ptrViE = VideoEngine::Create(); numberOfErrors += ViETest::TestError(ptrViE != NULL, "VideoEngine::Create"); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID error = ptrViE->SetTraceFile("/sdcard/WebRTC/ViESampleCodeTrace.txt"); numberOfErrors += ViETest::TestError(error == 0, "SetTraceFile error"); diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_capture.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_capture.cc index c5054ab24..0bcd391f6 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_capture.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_capture.cc @@ -278,7 +278,7 @@ int ViEAutoTest::ViECaptureStandardTest() error = ViE.ptrViEImageProcess->DeregisterCaptureEffectFilter( captureDeviceId[deviceIndex]); -#ifdef ANDROID // Can only allocate one camera at the time on Android +#ifdef WEBRTC_ANDROID // Can only allocate one camera at the time on Android error = ViE.ptrViECapture->StopCapture(captureDeviceId[deviceIndex]); numberOfErrors += ViETest::TestError(error==0, "ERROR: %s at line %d", __FUNCTION__, __LINE__); @@ -299,7 +299,7 @@ int ViEAutoTest::ViECaptureStandardTest() for (int deviceIndex = 0; deviceIndex < numberOfCaptureDevices; ++deviceIndex) { error = ViE.ptrViECapture->StopCapture(captureDeviceId[deviceIndex]); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID // Camera already stoped on Android since we can only allocate one // camera at the time. numberOfErrors += ViETest::TestError(error==-1, "ERROR: %s at line %d", @@ -311,7 +311,7 @@ int ViEAutoTest::ViECaptureStandardTest() error = ViE.ptrViECapture->ReleaseCaptureDevice( captureDeviceId[deviceIndex]); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID // Camera already stoped on Android since we can only allocate one // camera at the time numberOfErrors += ViETest::TestError(error==-1, "ERROR: %s at line %d", diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_codec.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_codec.cc index 9bbbfd2ea..bf58bb026 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_codec.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_codec.cc @@ -312,7 +312,7 @@ int ViEAutoTest::ViECodecStandardTest() else { -#ifdef ANDROID +#ifdef WEBRTC_ANDROID // To get the autotest to pass on some slow devices numberOfErrors += ViETest::TestError(frameCounter.numFrames > maxNumberOfRenderedFrames/6, // Safety margin due to bitrate diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_loopback.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_loopback.cc index 1a0e91768..736d952f7 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_loopback.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_loopback.cc @@ -64,7 +64,7 @@ int VideoEngineSampleCode(void* window1, void* window2) return -1; } -#ifdef ANDROID +#ifdef WEBRTC_ANDROID error = ptrViE->SetTraceFile("/sdcard/ViETrace.txt"); if (error == -1) { @@ -150,7 +150,7 @@ int VideoEngineSampleCode(void* window1, void* window2) printf("\t %d. %s\n", captureIdx + 1, deviceName); } printf("\nChoose capture device: "); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID captureIdx = 0; printf("0\n"); #else @@ -306,7 +306,7 @@ int VideoEngineSampleCode(void* window1, void* window2) } } printf("Choose codec: "); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID codecIdx = 0; printf("0\n"); #else diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_render.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_render.cc index 718775b32..8a8e9cb5e 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_render.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_render.cc @@ -138,7 +138,8 @@ int ViEAutoTest::ViERenderStandardTest() numberOfErrors += ViETest::TestError(error == 0, "ERROR: %s at line %d", __FUNCTION__, __LINE__); -#ifndef ANDROID // PIP and full screen rendering is not supported on Android + // PIP and full screen rendering is not supported on Android +#ifndef WEBRTC_ANDROID error = ViE.ptrViERender->DeRegisterVideoRenderModule(*_vrm1); numberOfErrors += ViETest::TestError(error == 0, "ERROR: %s at line %d", __FUNCTION__, __LINE__); diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_rtp_rtcp.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_rtp_rtcp.cc index 0a43238b6..d756e60d3 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_rtp_rtcp.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_rtp_rtcp.cc @@ -361,7 +361,7 @@ int ViEAutoTest::ViERtpRtcpStandardTest() ViETest::Log("Testing RTP dump...\n\n"); -#ifdef ANDROID +#ifdef WEBRTC_ANDROID const char* inDumpName = "/sdcard/IncomingRTPDump.rtp"; const char* outDumpName = "/sdcard/OutgoingRTPDump.rtp"; #else @@ -818,7 +818,7 @@ int ViEAutoTest::ViERtpRtcpAPITest() // RTP Dump // { -#ifdef ANDROID +#ifdef WEBRTC_ANDROID const char* dumpName = "/sdcard/DumpFileName.rtp"; #else const char* dumpName = "DumpFileName.rtp";