add sleep() for android
Review URL: http://webrtc-codereview.appspot.com/34001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@52 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -47,7 +47,7 @@ enum { kViEMinKeyRequestIntervalMs = 300};
|
|||||||
|
|
||||||
// ViEBase
|
// ViEBase
|
||||||
enum { kViEMaxNumberOfChannels = 4};
|
enum { kViEMaxNumberOfChannels = 4};
|
||||||
enum { kViEVersionMaxMessageSize = 1024 };
|
enum { kViEVersionMaxMessageSize = 1024 };
|
||||||
enum { kViEMaxModuleVersionSize = 960 };
|
enum { kViEMaxModuleVersionSize = 960 };
|
||||||
|
|
||||||
// ViECapture
|
// ViECapture
|
||||||
@@ -107,7 +107,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Module id
|
// Module id
|
||||||
// Create a unique id based on the ViE instance id and the
|
// Create a unique id based on the ViE instance id and the
|
||||||
// channel id. ViE id > 0 and 0 <= channel id <= 255
|
// channel id. ViE id > 0 and 0 <= channel id <= 255
|
||||||
|
|
||||||
inline int ViEId(const int vieId, const int channelId = -1)
|
inline int ViEId(const int vieId, const int channelId = -1)
|
||||||
@@ -153,19 +153,22 @@ inline int ChannelId(const int moduleId)
|
|||||||
#else
|
#else
|
||||||
#define BUILDMODE TEXT("?")
|
#define BUILDMODE TEXT("?")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BUILDTIME TEXT(__TIME__)
|
#define BUILDTIME TEXT(__TIME__)
|
||||||
#define BUILDDATE TEXT(__DATE__)
|
#define BUILDDATE TEXT(__DATE__)
|
||||||
|
|
||||||
// example: "Oct 10 2002 12:05:30 r"
|
// example: "Oct 10 2002 12:05:30 r"
|
||||||
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
|
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
|
||||||
|
|
||||||
|
|
||||||
#define RENDER_MODULE_TYPE kRenderWindows
|
#define RENDER_MODULE_TYPE kRenderWindows
|
||||||
// Warning pragmas
|
// Warning pragmas
|
||||||
#pragma warning(disable: 4351) // new behavior: elements of array 'XXX' will be default initialized
|
// new behavior: elements of array 'XXX' will be default initialized
|
||||||
#pragma warning(disable: 4355) // 'this' : used in base member initializer list
|
#pragma warning(disable: 4351)
|
||||||
#pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code
|
// 'this' : used in base member initializer list
|
||||||
|
#pragma warning(disable: 4355)
|
||||||
|
// frame pointer register 'ebp' modified by inline assembly code
|
||||||
|
#pragma warning(disable: 4731)
|
||||||
|
|
||||||
// Include libraries
|
// Include libraries
|
||||||
#pragma comment( lib, "winmm.lib" )
|
#pragma comment( lib, "winmm.lib" )
|
||||||
@@ -204,7 +207,7 @@ ODE TEXT("d")
|
|||||||
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
|
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
|
||||||
|
|
||||||
#define RENDER_MODULE_TYPE kRenderWindows
|
#define RENDER_MODULE_TYPE kRenderWindows
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define webrtc::kFileFormatAviFile 3
|
//#define webrtc::kFileFormatAviFile 3
|
||||||
//#define __LINUX__ // needed for InterObjects
|
//#define __LINUX__ // needed for InterObjects
|
||||||
@@ -213,7 +216,7 @@ ODE TEXT("d")
|
|||||||
// Linux
|
// Linux
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef WEBRTC_ANDROID
|
||||||
#ifdef WEBRTC_LINUX
|
#ifdef WEBRTC_LINUX
|
||||||
|
|
||||||
// Build information macros
|
// Build information macros
|
||||||
@@ -226,23 +229,18 @@ ODE TEXT("d")
|
|||||||
#else
|
#else
|
||||||
#define BUILDMODE "?"
|
#define BUILDMODE "?"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BUILDTIME __TIME__
|
#define BUILDTIME __TIME__
|
||||||
#define BUILDDATE __DATE__
|
#define BUILDDATE __DATE__
|
||||||
|
|
||||||
// example: "Oct 10 2002 12:05:30 r"
|
// example: "Oct 10 2002 12:05:30 r"
|
||||||
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
|
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
|
||||||
|
|
||||||
#endif // ifdef WEBRTC_LINUX
|
#endif // ifdef WEBRTC_LINUX
|
||||||
#endif // ifndef ANDROID
|
#endif // ifndef ANDROID
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef WEBRTC_ANDROID
|
||||||
|
|
||||||
#define DWORD unsigned long int
|
|
||||||
#define FALSE 0
|
|
||||||
#define TRUE 1
|
|
||||||
#define LONG int
|
|
||||||
#define LONGLONG long long
|
|
||||||
#define FAR
|
#define FAR
|
||||||
#define __cdecl
|
#define __cdecl
|
||||||
|
|
||||||
@@ -262,33 +260,7 @@ ODE TEXT("d")
|
|||||||
// example: "Oct 10 2002 12:05:30 r"
|
// example: "Oct 10 2002 12:05:30 r"
|
||||||
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
|
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
void Sleep(unsigned long x)
|
|
||||||
{
|
|
||||||
timespec t;
|
|
||||||
t.tv_sec = x/1000;
|
|
||||||
t.tv_nsec = (x-(x/1000)*1000)*1000000;
|
|
||||||
nanosleep(&t,NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD timeGetTime()
|
|
||||||
{
|
|
||||||
struct timeval tv;
|
|
||||||
struct timezone tz;
|
|
||||||
unsigned long val;
|
|
||||||
|
|
||||||
gettimeofday(&tv, &tz);
|
|
||||||
val= tv.tv_sec*1000+ tv.tv_usec/1000;
|
|
||||||
return(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SLEEP(x) ::Sleep(x)
|
|
||||||
#define GET_TIME_IN_MS timeGetTime
|
|
||||||
|
|
||||||
#endif // #ifdef ANDROID
|
#endif // #ifdef ANDROID
|
||||||
|
|
||||||
} //namespace webrtc
|
} //namespace webrtc
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_
|
#endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_
|
||||||
|
|
||||||
|
@@ -24,9 +24,9 @@
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#elif defined (ANDROID)
|
#elif defined (WEBRTC_ANDROID)
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include <string.h>
|
#include <string>
|
||||||
#elif defined(WEBRTC_LINUX)
|
#elif defined(WEBRTC_LINUX)
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -222,20 +222,28 @@ public:
|
|||||||
#elif defined(WEBRTC_MAC_INTEL)
|
#elif defined(WEBRTC_MAC_INTEL)
|
||||||
#define AutoTestSleep(x) usleep(x * 1000)
|
#define AutoTestSleep(x) usleep(x * 1000)
|
||||||
#elif defined(WEBRTC_LINUX)
|
#elif defined(WEBRTC_LINUX)
|
||||||
namespace
|
namespace {
|
||||||
{
|
void Sleep(unsigned long x) {
|
||||||
void Sleep(unsigned long x)
|
timespec t;
|
||||||
{
|
t.tv_sec = x/1000;
|
||||||
timespec t;
|
t.tv_nsec = (x-(x/1000)*1000)*1000000;
|
||||||
t.tv_sec = x/1000;
|
nanosleep(&t,NULL);
|
||||||
t.tv_nsec = (x-(x/1000)*1000)*1000000;
|
}
|
||||||
nanosleep(&t,NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#define AutoTestSleep ::Sleep
|
#define AutoTestSleep ::Sleep
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef WEBRTC_ANDROID
|
||||||
|
namespace {
|
||||||
|
void Sleep(unsigned long x) {
|
||||||
|
timespec t;
|
||||||
|
t.tv_sec = x/1000;
|
||||||
|
t.tv_nsec = (x-(x/1000)*1000)*1000000;
|
||||||
|
nanosleep(&t,NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define AutoTestSleep ::Sleep
|
||||||
#define VIE_TEST_FILES_ROOT "/sdcard/vie_auto_test/"
|
#define VIE_TEST_FILES_ROOT "/sdcard/vie_auto_test/"
|
||||||
#else
|
#else
|
||||||
#define VIE_TEST_FILES_ROOT "/tmp/"
|
#define VIE_TEST_FILES_ROOT "/tmp/"
|
||||||
|
Reference in New Issue
Block a user