Replace ANDROID with WEBRTC_ANDROID

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@337 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@google.com 2011-08-09 17:27:33 +00:00
parent 5ce0ff05ae
commit 22b699d2e0
15 changed files with 54 additions and 57 deletions

View File

@ -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;

View File

@ -20,7 +20,7 @@
#import <AppKit/AppKit.h>
//#import "CocoaWindow.h"
#import "cocoa_renderer.h"
#elif defined (ANDROID)
#elif defined (WEBRTC_ANDROID)
#include <JNI.h>
#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;

View File

@ -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 <android/log.h>
#include <unistd.h>
#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 <unistd.h>
#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 <unistd.h>
#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_

View File

@ -452,7 +452,7 @@ int testPlatformDependent::DoTest()
testRotation(uniqueID);
}
#ifndef ANDROID
#ifndef WEBRTC_ANDROID
_logger.SetFileName("testPlatformDependent_multipleCameras.txt");
testMultipleCameras();
#endif

View File

@ -22,7 +22,7 @@
#include <unistd.h>
#endif
#ifdef ANDROID
#ifdef WEBRTC_ANDROID
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
@ -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_

View File

@ -20,7 +20,7 @@
#include <tchar.h> // 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,

View File

@ -33,7 +33,7 @@
#include "vie_errors.h"
#include "video_render_defines.h"
#ifndef ANDROID
#ifndef WEBRTC_ANDROID
#include <string>
#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,

View File

@ -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);

View File

@ -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);

View File

@ -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");

View File

@ -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",

View File

@ -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

View File

@ -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

View File

@ -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__);

View File

@ -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";