From 18cbda81f3896fcbf6ed78b284beee435560329b Mon Sep 17 00:00:00 2001 From: Steven Lee Date: Wed, 23 Jan 2013 18:08:16 -0500 Subject: [PATCH] Bug 818843 - Media changes. r=rjesup --- media/mtransport/test/Makefile.in | 2 ++ media/mtransport/third_party/nICEr/nicer.gyp | 10 +++++-- media/webrtc/Makefile.in | 9 ++++-- media/webrtc/signaling/signaling.gyp | 10 +++++++ .../src/sipcc/cpr/linux/cpr_linux_init.c | 5 ++++ .../src/sipcc/cpr/linux/cpr_linux_ipc.c | 29 +++++++++++++++++++ .../src/sipcc/cpr/linux/cpr_linux_socket.c | 5 ++++ media/webrtc/signaling/test/Makefile.in | 2 ++ media/webrtc/trunk/build/common.gypi | 7 +++++ media/webrtc/trunk/src/build/arm_neon.gypi | 2 +- media/webrtc/trunk/src/build/common.gypi | 13 +++++++++ .../source/linux/audio_device_alsa_linux.h | 7 ++++- .../linux/audio_mixer_manager_alsa_linux.h | 4 +++ .../system_wrappers/source/aligned_malloc.cc | 4 +++ .../src/system_wrappers/source/cpu_info.cc | 2 +- .../system_wrappers/source/thread_posix.cc | 4 +-- media/webrtc/trunk/supplement/supplement.gypi | 7 ++++- 17 files changed, 112 insertions(+), 10 deletions(-) diff --git a/media/mtransport/test/Makefile.in b/media/mtransport/test/Makefile.in index c1d5bf44944..5e2e0a4faee 100644 --- a/media/mtransport/test/Makefile.in +++ b/media/mtransport/test/Makefile.in @@ -99,6 +99,7 @@ DEFINES += \ endif ifneq ($(OS_TARGET),WINNT) +ifneq (gonk,$(MOZ_WIDGET_TOOLKIT)) CPP_UNIT_TESTS = \ ice_unittest.cpp \ nrappkit_unittest.cpp \ @@ -110,6 +111,7 @@ ifdef MOZ_SCTP CPP_UNIT_TESTS += sctp_unittest.cpp endif +endif endif include $(topsrcdir)/config/rules.mk diff --git a/media/mtransport/third_party/nICEr/nicer.gyp b/media/mtransport/third_party/nICEr/nicer.gyp index fed0bb8d35d..562fc2f870a 100644 --- a/media/mtransport/third_party/nICEr/nicer.gyp +++ b/media/mtransport/third_party/nICEr/nicer.gyp @@ -204,8 +204,14 @@ 'sources': [ ], - }] - ] + }], + ['moz_widget_toolkit_gonk==1', { + 'defines' : [ + 'WEBRTC_GONK', + 'NO_REG_RPC', + ], + }], + ], }] } diff --git a/media/webrtc/Makefile.in b/media/webrtc/Makefile.in index 0a1df604b2c..dccede319f6 100644 --- a/media/webrtc/Makefile.in +++ b/media/webrtc/Makefile.in @@ -11,11 +11,16 @@ include $(DEPTH)/config/autoconf.mk DIRS = \ trunk \ - trunk/testing \ signaling \ - signalingtest \ $(NULL) +ifneq (gonk,$(MOZ_WIDGET_TOOLKIT)) +DIRS += \ + signalingtest \ + trunk/testing \ + $(NULL) +endif + # These Makefiles don't have corresponding Makefile.ins NO_SUBMAKEFILES_RULE = 1 include $(topsrcdir)/config/rules.mk diff --git a/media/webrtc/signaling/signaling.gyp b/media/webrtc/signaling/signaling.gyp index 2a91e3d2b7f..8d099698fb5 100644 --- a/media/webrtc/signaling/signaling.gyp +++ b/media/webrtc/signaling/signaling.gyp @@ -13,6 +13,16 @@ 'chromium_code': 1, }, + 'target_defaults': { + 'conditions': [ + ['moz_widget_toolkit_gonk==1', { + 'defines' : [ + 'WEBRTC_GONK', + ], + }], + ], + }, + 'targets': [ # diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c index 8fd6b3b756f..23d3731332a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c @@ -117,8 +117,13 @@ #include "cpr_linux_timers.h" #include "plat_api.h" #include +#if defined(WEBRTC_GONK) +#include +#include +#else #include #include +#endif #include "plat_debug.h" /** diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c index e02207a9297..fe23569e401 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c @@ -36,8 +36,15 @@ #include "cpr_stdlib.h" #include #include +#if defined(WEBRTC_GONK) +#include +#include +#include +#include +#else #include #include +#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 diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c index 5c178e739a4..d28ab0e8c4a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c @@ -12,8 +12,13 @@ #include "cpr_errno.h" #include "cpr_stdlib.h" #include "cpr_string.h" +#if defined(WEBRTC_GONK) +#include +#include +#else #include #include +#endif #include diff --git a/media/webrtc/signaling/test/Makefile.in b/media/webrtc/signaling/test/Makefile.in index ccfd8a67b43..543df016188 100644 --- a/media/webrtc/signaling/test/Makefile.in +++ b/media/webrtc/signaling/test/Makefile.in @@ -137,6 +137,7 @@ LOCAL_INCLUDES += \ $(NULL) ifneq ($(OS_TARGET),WINNT) +ifneq (gonk,$(MOZ_WIDGET_TOOLKIT)) ifdef JS_SHARED_LIBRARY LIBS += $(MOZ_ZLIB_LIBS) endif @@ -147,6 +148,7 @@ CPP_UNIT_TESTS = \ mediaconduit_unittests.cpp \ $(NULL) endif +endif include $(topsrcdir)/config/config.mk include $(topsrcdir)/media/webrtc/webrtc-config.mk diff --git a/media/webrtc/trunk/build/common.gypi b/media/webrtc/trunk/build/common.gypi index b5b0083e24d..e1d79ff0c4d 100644 --- a/media/webrtc/trunk/build/common.gypi +++ b/media/webrtc/trunk/build/common.gypi @@ -874,6 +874,13 @@ 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files', 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files', + 'conditions': [ + ['moz_widget_toolkit_gonk==1', { + 'variables': { + 'disable_sse2': 1, + }, + }], + ], 'conditions': [ ['OS=="win" and " #include +#if defined (WEBRTC_GONK) +#include +#include +#else +#include #include +#endif namespace webrtc { diff --git a/media/webrtc/trunk/src/modules/audio_device/main/source/linux/audio_mixer_manager_alsa_linux.h b/media/webrtc/trunk/src/modules/audio_device/main/source/linux/audio_mixer_manager_alsa_linux.h index 94ea9820fd3..66a1c340ae9 100644 --- a/media/webrtc/trunk/src/modules/audio_device/main/source/linux/audio_mixer_manager_alsa_linux.h +++ b/media/webrtc/trunk/src/modules/audio_device/main/source/linux/audio_mixer_manager_alsa_linux.h @@ -16,7 +16,11 @@ #include "critical_section_wrapper.h" #include "alsasymboltable_linux.h" +#if defined (WEBRTC_GONK) +#include +#else #include +#endif namespace webrtc { diff --git a/media/webrtc/trunk/src/system_wrappers/source/aligned_malloc.cc b/media/webrtc/trunk/src/system_wrappers/source/aligned_malloc.cc index bb10c6bb426..6fb36805842 100644 --- a/media/webrtc/trunk/src/system_wrappers/source/aligned_malloc.cc +++ b/media/webrtc/trunk/src/system_wrappers/source/aligned_malloc.cc @@ -29,6 +29,10 @@ #include #endif +#ifdef WEBRTC_GONK +#include +#endif + #include "typedefs.h" // Ok reference on memory alignment: diff --git a/media/webrtc/trunk/src/system_wrappers/source/cpu_info.cc b/media/webrtc/trunk/src/system_wrappers/source/cpu_info.cc index e367abfbdf5..d257b186453 100644 --- a/media/webrtc/trunk/src/system_wrappers/source/cpu_info.cc +++ b/media/webrtc/trunk/src/system_wrappers/source/cpu_info.cc @@ -40,7 +40,7 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCores() WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Available number of cores:%d", _numberOfCores); -#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) +#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_GONK) _numberOfCores = get_nprocs(); WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Available number of cores:%d", _numberOfCores); diff --git a/media/webrtc/trunk/src/system_wrappers/source/thread_posix.cc b/media/webrtc/trunk/src/system_wrappers/source/thread_posix.cc index 6334490f780..ab9390704e8 100644 --- a/media/webrtc/trunk/src/system_wrappers/source/thread_posix.cc +++ b/media/webrtc/trunk/src/system_wrappers/source/thread_posix.cc @@ -129,7 +129,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) @@ -284,7 +284,7 @@ void ThreadPosix::SetNotAlive() bool ThreadPosix::Shutdown() { -#if !defined(WEBRTC_ANDROID) +#if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_GONK) if (_thread && (0 != pthread_cancel(_thread))) { return false; diff --git a/media/webrtc/trunk/supplement/supplement.gypi b/media/webrtc/trunk/supplement/supplement.gypi index 330624f0f55..3a7341eae63 100644 --- a/media/webrtc/trunk/supplement/supplement.gypi +++ b/media/webrtc/trunk/supplement/supplement.gypi @@ -8,5 +8,10 @@ 'include_internal_video_capture': 1, 'include_internal_video_render': 0, 'include_pulse_audio': 0, - } + 'conditions': [ + ['moz_widget_toolkit_gonk==1', { + 'include_internal_audio_device': 0, + }], + ], + }, }