Bug 818843 - Part 2: gyp modifications and add some system call wrappers for B2G. r=ted, r=ethanhugg, r=jesup

This commit is contained in:
Steven Lee 2013-03-19 16:02:44 -04:00
Родитель 296f99c8d9
Коммит 5a1d8c2297
12 изменённых файлов: 91 добавлений и 12 удалений

Просмотреть файл

@ -41,6 +41,8 @@ else
MOZ_XULRUNNER=
fi
MOZ_MEDIA_NAVIGATOR=1
MOZ_APP_ID={3c2e2abc-06d4-11e1-ac3b-374f68613e61}
MOZ_EXTENSION_MANAGER=1

Просмотреть файл

@ -9079,7 +9079,7 @@ if test -n "$MOZ_WEBRTC"; then
AC_MSG_RESULT("generating WebRTC Makefiles...")
if test "${MOZ_WIDGET_TOOLKIT}" = "gonk"; then
EXTRA_GYP_DEFINES="${EXTRA_GYP_DEFINES} -D build_with_gonk=1"
EXTRA_GYP_DEFINES="${EXTRA_GYP_DEFINES} -D build_with_gonk=1 -D include_internal_audio_device=0"
fi
dnl Any --include files must also appear in -D FORCED_INCLUDE_FILE= entries

10
media/mtransport/third_party/nICEr/nicer.gyp поставляемый
Просмотреть файл

@ -206,8 +206,14 @@
'sources': [
],
}]
]
}],
['moz_widget_toolkit_gonk==1', {
'defines' : [
'WEBRTC_GONK',
'NO_REG_RPC',
],
}],
],
}]
}

Просмотреть файл

@ -13,6 +13,16 @@
'chromium_code': 1,
},
'target_defaults': {
'conditions': [
['moz_widget_toolkit_gonk==1', {
'defines' : [
'WEBRTC_GONK',
],
}],
],
},
'targets': [
#

Просмотреть файл

@ -117,8 +117,13 @@
#include "cpr_linux_timers.h"
#include "plat_api.h"
#include <errno.h>
#if defined(WEBRTC_GONK)
#include <linux/msg.h>
#include <linux/ipc.h>
#else
#include <sys/msg.h>
#include <sys/ipc.h>
#endif
#include "plat_debug.h"
/**

Просмотреть файл

@ -36,8 +36,15 @@
#include "cpr_stdlib.h"
#include <cpr_stdio.h>
#include <errno.h>
#if defined(WEBRTC_GONK)
#include <sys/syscall.h>
#include <unistd.h>
#include <linux/msg.h>
#include <linux/ipc.h>
#else
#include <sys/msg.h>
#include <sys/ipc.h>
#endif
#include "plat_api.h"
#include "CSFLog.h"
@ -45,6 +52,28 @@ static const char *logTag = "cpr_linux_ipc";
#define STATIC static
#if defined(WEBRTC_GONK)
int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg)
{
return syscall(__NR_msgsnd, msqid, msgp, msgsz, msgflg);
}
ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg)
{
return syscall(__NR_msgrcv, msqid, msgp, msgsz, msgtyp, msgflg);
}
int msgctl(int msqid, int cmd, struct msqid_ds *buf)
{
return syscall(__NR_msgctl, msqid, cmd, buf);
}
int msgget(key_t key, int msgflg)
{
return syscall(__NR_msgget, key, msgflg);
}
#endif
/* @def The Message Queue depth */
#define OS_MSGTQL 31

Просмотреть файл

@ -12,8 +12,13 @@
#include "cpr_errno.h"
#include "cpr_stdlib.h"
#include "cpr_string.h"
#if defined(WEBRTC_GONK)
#include <syslog.h>
#include <linux/fcntl.h>
#else
#include <sys/syslog.h>
#include <sys/fcntl.h>
#endif
#include <ctype.h>

Просмотреть файл

@ -150,6 +150,11 @@
#'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
],
'conditions': [
['moz_widget_toolkit_gonk==1', {
'defines' : [
'WEBRTC_GONK',
],
}],
['enable_tracing==1', {
'defines': ['WEBRTC_LOGGING',],
}],
@ -219,6 +224,13 @@
],
}],
['OS=="linux"', {
'conditions': [
['have_clock_monotonic==1', {
'defines': [
'WEBRTC_CLOCK_TYPE_REALTIME',
],
}],
],
'defines': [
'WEBRTC_LINUX',
'WEBRTC_THREAD_RR',

Просмотреть файл

@ -36,7 +36,7 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCores() {
WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1,
"Available number of cores:%d", number_of_cores_);
#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_GONK)
number_of_cores_ = get_nprocs();
WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1,
"Available number of cores:%d", number_of_cores_);

Просмотреть файл

@ -136,7 +136,7 @@
'trace_win.h',
],
}],
['OS=="android"', {
['OS=="android" or moz_widget_toolkit_gonk==1', {
'dependencies': [ 'cpu_features_android', ],
}],
['OS=="linux"', {
@ -188,7 +188,7 @@
},
], # targets
'conditions': [
['OS=="android"', {
['OS=="android" or moz_widget_toolkit_gonk==1', {
'targets': [
{
'variables': {

Просмотреть файл

@ -124,7 +124,7 @@ ThreadPosix::ThreadPosix(ThreadRunFunction func, ThreadObj obj,
event_(EventWrapper::Create()),
name_(),
set_thread_name_(false),
#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID))
#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK))
pid_(-1),
#endif
attr_(),
@ -137,7 +137,7 @@ ThreadPosix::ThreadPosix(ThreadRunFunction func, ThreadObj obj,
}
uint32_t ThreadWrapper::GetThreadId() {
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_LINUX)
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_LINUX) || defined(WEBRTC_GONK)
return static_cast<uint32_t>(syscall(__NR_gettid));
#elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
return pthread_mach_thread_np(pthread_self());
@ -148,7 +148,7 @@ uint32_t ThreadWrapper::GetThreadId() {
int ThreadPosix::Construct() {
int result = 0;
#if !defined(WEBRTC_ANDROID)
#if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_GONK)
// Enable immediate cancellation if requested, see Shutdown().
result = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
if (result != 0) {
@ -237,7 +237,7 @@ bool ThreadPosix::Start(unsigned int& thread_id)
// CPU_ZERO and CPU_SET are not available in NDK r7, so disable
// SetAffinity on Android for now.
#if (defined(WEBRTC_LINUX) && (!defined(WEBRTC_ANDROID)))
#if (defined(WEBRTC_LINUX) && (!defined(WEBRTC_ANDROID)) && (!defined(WEBRTC_GONK)))
bool ThreadPosix::SetAffinity(const int* processor_numbers,
const unsigned int amount_of_processors) {
if (!processor_numbers || (amount_of_processors == 0)) {
@ -251,7 +251,7 @@ bool ThreadPosix::SetAffinity(const int* processor_numbers,
++processor) {
CPU_SET(processor_numbers[processor], &mask);
}
#if defined(WEBRTC_ANDROID)
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK)
// Android.
const int result = syscall(__NR_sched_setaffinity,
pid_,
@ -316,7 +316,7 @@ void ThreadPosix::Run() {
alive_ = true;
dead_ = false;
}
#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID))
#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK))
pid_ = GetThreadId();
#endif
// The event the Start() is waiting for.

Просмотреть файл

@ -23,6 +23,16 @@
'build_libjpeg': 0,
'build_libvpx': 0,
#if "-D build_with_gonk=1", then set moz_widget_toolkit_gonk to 1
'moz_widget_toolkit_gonk': 0,
'variables': {
'build_with_gonk%': 0,
},
'conditions': [
['build_with_gonk==1', {
'moz_widget_toolkit_gonk': 1,
}],
],
# (for vp8) chromium sets to 0 also
'use_temporal_layers': 0,
# Creates AEC internal sample dump files in current directory