Backed out changeset d02fb013d5b7 (bug 1101651)

This commit is contained in:
Wes Kocher 2015-04-02 13:42:29 -07:00
parent 8fb9e9e391
commit 44651f2a21
40 changed files with 429 additions and 686 deletions

View File

@ -25,7 +25,7 @@ EXPORTS.mtransport += [
'../transportlayerprsock.h',
]
include('../common.build')
include('../objs.mozbuild')
# These files cannot be built in unified mode because of the redefinition of
# getLogModule, UNIMPLEMENTED, nr_socket_long_term_violation_time,
@ -34,7 +34,67 @@ SOURCES += mtransport_cppsrcs
FAIL_ON_WARNINGS = True
LOCAL_INCLUDES += [
'/media/mtransport/',
'/media/mtransport/third_party/',
'/media/mtransport/third_party/nICEr/src/crypto',
'/media/mtransport/third_party/nICEr/src/ice',
'/media/mtransport/third_party/nICEr/src/net',
'/media/mtransport/third_party/nICEr/src/stun',
'/media/mtransport/third_party/nICEr/src/util',
'/media/mtransport/third_party/nrappkit/src/event',
'/media/mtransport/third_party/nrappkit/src/log',
'/media/mtransport/third_party/nrappkit/src/plugin',
'/media/mtransport/third_party/nrappkit/src/port/generic/include',
'/media/mtransport/third_party/nrappkit/src/registry',
'/media/mtransport/third_party/nrappkit/src/share',
'/media/mtransport/third_party/nrappkit/src/stats',
'/media/mtransport/third_party/nrappkit/src/util/libekr',
]
if CONFIG['OS_TARGET'] in ['Darwin', 'DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD']:
if CONFIG['OS_TARGET'] == 'Darwin':
DEFINES['DARWIN'] = True
else:
DEFINES['BSD'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/darwin/include',
]
elif CONFIG['OS_TARGET'] == 'Linux':
DEFINES['LINUX'] = True
DEFINES['USE_INTERFACE_PRIORITIZER'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/linux/include',
]
elif CONFIG['OS_TARGET'] == 'Android':
DEFINES['LINUX'] = True
DEFINES['ANDROID'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/android/include',
]
elif CONFIG['OS_TARGET'] == 'WINNT':
DEFINES['WIN'] = True
# for stun.h
DEFINES['WIN32'] = True
DEFINES['NOMINMAX'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/win32/include',
]
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
DEFINES['USE_INTERFACE_PRIORITIZER'] = True
for var in ('HAVE_STRDUP', 'NR_SOCKET_IS_VOID_PTR'):
DEFINES[var] = True
DEFINES['R_DEFINED_INT2'] = 'int16_t'
DEFINES['R_DEFINED_UINT2'] = 'uint16_t'
DEFINES['R_DEFINED_INT4'] = 'int32_t'
DEFINES['R_DEFINED_UINT4'] = 'uint32_t'
DEFINES['R_DEFINED_INT8'] = 'int64_t'
DEFINES['R_DEFINED_UINT8'] = 'uint64_t'

View File

@ -1,95 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
mtransport_lcppsrcs = [
'dtlsidentity.cpp',
'nr_socket_prsock.cpp',
'nr_timer.cpp',
'nricectx.cpp',
'nricemediastream.cpp',
'nriceresolver.cpp',
'nriceresolverfake.cpp',
'nrinterfaceprioritizer.cpp',
'rlogringbuffer.cpp',
'simpletokenbucket.cpp',
'stun_udp_socket_filter.cpp',
'transportflow.cpp',
'transportlayer.cpp',
'transportlayerdtls.cpp',
'transportlayerice.cpp',
'transportlayerlog.cpp',
'transportlayerloopback.cpp',
'transportlayerprsock.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
mtransport_lcppsrcs += [
'gonk_addrs.cpp',
]
mtransport_cppsrcs = [
'%s/media/mtransport/%s' % (TOPSRCDIR, s) for s in sorted(mtransport_lcppsrcs)
]
LOCAL_INCLUDES += [
'/media/mtransport/',
'/media/mtransport/third_party/',
'/media/mtransport/third_party/nICEr/src/crypto',
'/media/mtransport/third_party/nICEr/src/ice',
'/media/mtransport/third_party/nICEr/src/net',
'/media/mtransport/third_party/nICEr/src/stun',
'/media/mtransport/third_party/nICEr/src/util',
'/media/mtransport/third_party/nrappkit/src/event',
'/media/mtransport/third_party/nrappkit/src/log',
'/media/mtransport/third_party/nrappkit/src/plugin',
'/media/mtransport/third_party/nrappkit/src/port/generic/include',
'/media/mtransport/third_party/nrappkit/src/registry',
'/media/mtransport/third_party/nrappkit/src/share',
'/media/mtransport/third_party/nrappkit/src/stats',
'/media/mtransport/third_party/nrappkit/src/util/libekr',
]
if CONFIG['OS_TARGET'] in ['Darwin', 'DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD']:
if CONFIG['OS_TARGET'] == 'Darwin':
DEFINES['DARWIN'] = True
else:
DEFINES['BSD'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/darwin/include',
]
elif CONFIG['OS_TARGET'] == 'Linux':
DEFINES['LINUX'] = True
DEFINES['USE_INTERFACE_PRIORITIZER'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/linux/include',
]
elif CONFIG['OS_TARGET'] == 'Android':
DEFINES['LINUX'] = True
DEFINES['ANDROID'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/android/include',
]
elif CONFIG['OS_TARGET'] == 'WINNT':
DEFINES['WIN'] = True
# for stun.h
DEFINES['WIN32'] = True
DEFINES['NOMINMAX'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/win32/include',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
DEFINES['USE_INTERFACE_PRIORITIZER'] = True
for var in ('HAVE_STRDUP', 'NR_SOCKET_IS_VOID_PTR'):
DEFINES[var] = True
DEFINES['R_DEFINED_INT2'] = 'int16_t'
DEFINES['R_DEFINED_UINT2'] = 'uint16_t'
DEFINES['R_DEFINED_INT4'] = 'int32_t'
DEFINES['R_DEFINED_UINT4'] = 'uint32_t'
DEFINES['R_DEFINED_INT8'] = 'int64_t'
DEFINES['R_DEFINED_UINT8'] = 'uint64_t'

View File

@ -1,11 +0,0 @@
DIRS += [
'/media/mtransport/third_party',
'/media/mtransport/build',
'/media/mtransport/testlib',
]
if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
DIRS += [
'/media/mtransport/standalone',
]

View File

@ -0,0 +1,35 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
mtransport_lcppsrcs = [
'dtlsidentity.cpp',
'nr_socket_prsock.cpp',
'nr_timer.cpp',
'nricectx.cpp',
'nricemediastream.cpp',
'nriceresolver.cpp',
'nriceresolverfake.cpp',
'nrinterfaceprioritizer.cpp',
'rlogringbuffer.cpp',
'simpletokenbucket.cpp',
'stun_udp_socket_filter.cpp',
'transportflow.cpp',
'transportlayer.cpp',
'transportlayerdtls.cpp',
'transportlayerice.cpp',
'transportlayerlog.cpp',
'transportlayerloopback.cpp',
'transportlayerprsock.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
mtransport_lcppsrcs += [
'gonk_addrs.cpp',
]
mtransport_cppsrcs = [
'%s/media/mtransport/%s' % (TOPSRCDIR, s) for s in sorted(mtransport_lcppsrcs)
]

View File

@ -4,17 +4,73 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Library('mtransport_standalone')
include('../common.build')
include('../objs.mozbuild')
# These files cannot be built in unified mode because of the redefinition of
# getLogModule, UNIMPLEMENTED, nr_socket_long_term_violation_time,
# nr_socket_short_term_violation_time.
SOURCES += mtransport_cppsrcs
Library('mtransport_s')
LOCAL_INCLUDES += [
'/media/mtransport/',
'/media/mtransport/third_party/',
'/media/mtransport/third_party/nICEr/src/crypto',
'/media/mtransport/third_party/nICEr/src/ice',
'/media/mtransport/third_party/nICEr/src/net',
'/media/mtransport/third_party/nICEr/src/stun',
'/media/mtransport/third_party/nICEr/src/util',
'/media/mtransport/third_party/nrappkit/src/event',
'/media/mtransport/third_party/nrappkit/src/log',
'/media/mtransport/third_party/nrappkit/src/plugin',
'/media/mtransport/third_party/nrappkit/src/port/generic/include',
'/media/mtransport/third_party/nrappkit/src/registry',
'/media/mtransport/third_party/nrappkit/src/share',
'/media/mtransport/third_party/nrappkit/src/stats',
'/media/mtransport/third_party/nrappkit/src/util/libekr',
]
if CONFIG['OS_TARGET'] in ['Darwin', 'DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD']:
if CONFIG['OS_TARGET'] == 'Darwin':
DEFINES['DARWIN'] = True
else:
DEFINES['BSD'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/darwin/include',
]
elif CONFIG['OS_TARGET'] == 'Linux':
DEFINES['LINUX'] = True
DEFINES['USE_INTERFACE_PRIORITIZER'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/linux/include',
]
elif CONFIG['OS_TARGET'] == 'Android':
DEFINES['LINUX'] = True
DEFINES['ANDROID'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/android/include',
]
elif CONFIG['OS_TARGET'] == 'WINNT':
DEFINES['WIN'] = True
# for stun.h
DEFINES['WIN32'] = True
DEFINES['NOMINMAX'] = True
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/win32/include',
]
FORCE_STATIC_LIB = True
for var in ('MOZILLA_INTERNAL_API', 'MOZILLA_XPCOMRT_API', 'MOZILLA_EXTERNAL_LINKAGE'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
DEFINES['USE_INTERFACE_PRIORITIZER'] = True
for var in ('HAVE_STRDUP', 'NR_SOCKET_IS_VOID_PTR'):
DEFINES[var] = True
DEFINES['R_DEFINED_INT2'] = 'int16_t'
DEFINES['R_DEFINED_UINT2'] = 'uint16_t'
DEFINES['R_DEFINED_INT4'] = 'int32_t'
DEFINES['R_DEFINED_UINT4'] = 'uint32_t'
DEFINES['R_DEFINED_INT8'] = 'int64_t'
DEFINES['R_DEFINED_UINT8'] = 'uint64_t'

View File

@ -14,10 +14,6 @@ extern "C" {
#include "mozilla/net/DNS.h"
#include "stun_udp_socket_filter.h"
#include "nr_socket_prsock.h"
#if defined(MOZILLA_XPCOMRT_API)
#include "mozilla/Module.h"
#include "mozilla/ModuleUtils.h"
#endif
namespace {
@ -210,26 +206,3 @@ NS_IMETHODIMP nsStunUDPSocketFilterHandler::NewFilter(nsIUDPSocketFilter **resul
NS_ADDREF(*result = ret);
return NS_OK;
}
#if defined(MOZILLA_XPCOMRT_API)
NS_DEFINE_NAMED_CID(NS_STUN_UDP_SOCKET_FILTER_HANDLER_CID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStunUDPSocketFilterHandler)
static const mozilla::Module::CIDEntry kCIDs[] = {
{ &kNS_STUN_UDP_SOCKET_FILTER_HANDLER_CID, false, nullptr, nsStunUDPSocketFilterHandlerConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kContracts[] = {
{ NS_STUN_UDP_SOCKET_FILTER_HANDLER_CONTRACTID, &kNS_STUN_UDP_SOCKET_FILTER_HANDLER_CID },
{ nullptr }
};
extern const mozilla::Module kStunUDPSocketFilterHandlerModule;
const mozilla::Module kStunUDPSocketFilterHandlerModule = {
mozilla::Module::kVersion,
kCIDs,
kContracts
};
#endif

View File

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
CppUnitTests([
GeckoCppUnitTests([
'buffered_stun_socket_unittest',
'ice_unittest',
'nrappkit_unittest',
@ -20,13 +20,13 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
])
if CONFIG['MOZ_SCTP']:
CppUnitTests([
GeckoCppUnitTests([
'sctp_unittest',
])
FAIL_ON_WARNINGS = True
for var in ('MOZILLA_INTERNAL_API', 'MOZILLA_XPCOMRT_API', 'MOZILLA_EXTERNAL_LINKAGE', 'HAVE_STRDUP', 'NR_SOCKET_IS_VOID_PTR', 'SCTP_DEBUG', 'INET'):
for var in ('HAVE_STRDUP', 'NR_SOCKET_IS_VOID_PTR', 'SCTP_DEBUG', 'INET'):
DEFINES[var] = True
if CONFIG['OS_TARGET'] == 'Android':
@ -40,12 +40,6 @@ if CONFIG['OS_TARGET'] == 'Linux':
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/linux/include',
]
USE_LIBS += [
'static:/nsprpub/lib/libc/src/plc4',
]
OS_LIBS += [
'-lrt',
]
if CONFIG['OS_TARGET'] == 'Darwin':
LOCAL_INCLUDES += [
@ -86,22 +80,14 @@ LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/util/libekr',
'/media/webrtc/trunk/testing/gtest/include/',
'/netwerk/sctp/src/',
'/xpcom/libxpcomrt',
]
USE_LIBS += [
'/media/webrtc/trunk/testing/gtest_gtest/gtest',
'fallible',
'mfbt',
'mozglue',
'mtransport_standalone',
'necko_standalone',
'mtransport_s',
'nicer',
'nrappkit',
'nspr',
'nss',
'unicharutil_standalone',
'xpcomrt',
]
if not CONFIG['MOZ_NATIVE_NSS'] and not CONFIG['MOZ_FOLD_LIBS']:
@ -114,5 +100,3 @@ if CONFIG['MOZ_SCTP']:
USE_LIBS += [
'nksctp_s',
]
USE_LIBS += ['mozglue']

View File

@ -19,7 +19,7 @@
#include "nsIComponentManager.h"
#include "nsIComponentRegistrar.h"
#include "nsIEventTarget.h"
#include "nsNetUtil.h"
#include "nsIIOService.h"
#include "nsIServiceManager.h"
#include "nsISocketTransportService.h"
@ -30,22 +30,7 @@
#endif
#include "nsPISocketTransportService.h"
#include "nsServiceManagerUtils.h"
#if !defined(MOZILLA_XPCOMRT_API)
#include "TestHarness.h"
#else
#include "XPCOMRTInit.h"
class ScopedXPCOM {
public:
ScopedXPCOM(const char*)
{
NS_InitXPCOMRT();
}
~ScopedXPCOM()
{
NS_ShutdownXPCOMRT();
}
};
#endif
class MtransportTestUtils {
public:
@ -61,6 +46,8 @@ class MtransportTestUtils {
void InitServices() {
nsresult rv;
ioservice_ = do_GetIOService(&rv);
MOZ_ASSERT(NS_SUCCEEDED(rv));
sts_target_ = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
MOZ_ASSERT(NS_SUCCEEDED(rv));
sts_ = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
@ -93,6 +80,7 @@ class MtransportTestUtils {
private:
ScopedXPCOM xpcom_;
nsCOMPtr<nsIIOService> ioservice_;
nsCOMPtr<nsIEventTarget> sts_target_;
nsCOMPtr<nsPISocketTransportService> sts_;
#ifdef MOZ_CRASHREPORTER

View File

@ -1,16 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include('../common.build')
# These files cannot be built in unified mode because of the redefinition of
# getLogModule, UNIMPLEMENTED, nr_socket_long_term_violation_time,
# nr_socket_short_term_violation_time.
SOURCES += mtransport_cppsrcs
Library('mtransport_s')
FORCE_STATIC_LIB = True

View File

@ -50,9 +50,6 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
GYP_DIRS['signaling'].variables.update(
build_for_test=0
)
GYP_DIRS['signaling'].variables.update(
build_for_standalone=0
)
GYP_DIRS['signaling'].sandbox_vars['FINAL_LIBRARY'] = 'xul'
# Excluded for various symbol conflicts
signaling_non_unified_sources = [
@ -95,16 +92,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
GYP_DIRS['signalingtest'].input = 'signaling/signaling.gyp'
GYP_DIRS['signalingtest'].variables = gyp_vars.copy()
GYP_DIRS['signalingtest'].variables.update(
build_for_test=1,
build_for_standalone=0
build_for_test=1
)
GYP_DIRS['signalingtest'].non_unified_sources += signaling_non_unified_sources
GYP_DIRS += ['signalingstandalone']
GYP_DIRS['signalingstandalone'].input = 'signaling/signaling.gyp'
GYP_DIRS['signalingstandalone'].variables = gyp_vars.copy()
GYP_DIRS['signalingstandalone'].variables.update(
build_for_test=0,
build_for_standalone=1
)
GYP_DIRS['signalingstandalone'].non_unified_sources += signaling_non_unified_sources

View File

@ -77,6 +77,8 @@
'./src/media-conduit/CodecStatistics.h',
'./src/media-conduit/CodecStatistics.cpp',
'./src/media-conduit/RunningStat.h',
'./src/media-conduit/GmpVideoCodec.cpp',
'./src/media-conduit/WebrtcGmpVideoCodec.cpp',
# Common
'./src/common/CommonTypes.h',
'./src/common/csf_common.h',
@ -96,6 +98,8 @@
# PeerConnection
'./src/peerconnection/MediaPipelineFactory.cpp',
'./src/peerconnection/MediaPipelineFactory.h',
'./src/peerconnection/MediaStreamList.cpp',
'./src/peerconnection/MediaStreamList.h',
'./src/peerconnection/PeerConnectionCtx.cpp',
'./src/peerconnection/PeerConnectionCtx.h',
'./src/peerconnection/PeerConnectionImpl.cpp',
@ -216,13 +220,11 @@
'MOZ_WEBRTC_OMX'
],
}],
['(build_for_test==0) and (build_for_standalone==0)', {
['build_for_test==0', {
'defines' : [
'MOZILLA_INTERNAL_API',
'MOZILLA_INTERNAL_API'
],
'sources': [
'./src/peerconnection/MediaStreamList.cpp',
'./src/peerconnection/MediaStreamList.h',
'./src/peerconnection/WebrtcGlobalInformation.cpp',
'./src/peerconnection/WebrtcGlobalInformation.h',
],
@ -234,27 +236,7 @@
'defines' : [
'NO_CHROMIUM_LOGGING',
'USE_FAKE_MEDIA_STREAMS',
'USE_FAKE_PCOBSERVER',
'MOZILLA_EXTERNAL_LINKAGE',
],
}],
['build_for_standalone==0', {
'sources': [
'./src/media-conduit/GmpVideoCodec.cpp',
'./src/media-conduit/WebrtcGmpVideoCodec.cpp',
],
}],
['build_for_standalone!=0', {
'include_dirs': [
'./test'
],
'defines' : [
'MOZILLA_INTERNAL_API',
'MOZILLA_XPCOMRT_API',
'MOZILLA_EXTERNAL_LINKAGE',
'NO_CHROMIUM_LOGGING',
'USE_FAKE_MEDIA_STREAMS',
'USE_FAKE_PCOBSERVER',
'USE_FAKE_PCOBSERVER'
],
}],
['(OS=="linux") or (OS=="android")', {

View File

@ -11,9 +11,7 @@
#include "nscore.h"
#ifdef MOZILLA_INTERNAL_API
#include "nsString.h"
#if !defined(MOZILLA_XPCOMRT_API)
#include "mozilla/Preferences.h"
#endif // !defined(MOZILLA_XPCOMRT_API)
#else
#include "nsStringAPI.h"
#endif
@ -59,13 +57,11 @@ static WebRtcTraceCallback gWebRtcCallback;
#ifdef MOZILLA_INTERNAL_API
void GetWebRtcLogPrefs(uint32_t *aTraceMask, nsACString* aLogFile, nsACString *aAECLogDir, bool *aMultiLog)
{
#if !defined(MOZILLA_XPCOMRT_API)
*aMultiLog = mozilla::Preferences::GetBool("media.webrtc.debug.multi_log");
*aTraceMask = mozilla::Preferences::GetUint("media.webrtc.debug.trace_mask");
mozilla::Preferences::GetCString("media.webrtc.debug.log_file", aLogFile);
mozilla::Preferences::GetCString("media.webrtc.debug.aec_log_dir", aAECLogDir);
webrtc::Trace::set_aec_debug_size(mozilla::Preferences::GetUint("media.webrtc.debug.aec_dump_max_size"));
#endif // !defined(MOZILLA_XPCOMRT_API)
}
#endif
@ -145,7 +141,7 @@ void ConfigWebRtcLog(uint32_t trace_mask, nsCString &aLogFile, nsCString &aAECLo
webrtc::Trace::SetTraceFile(aLogFile.get(), multi_log);
}
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Capture the final choices for the trace settings.
mozilla::Preferences::SetCString("media.webrtc.debug.log_file", aLogFile);
mozilla::Preferences::SetUint("media.webrtc.debug.trace_mask", trace_mask);

View File

@ -18,7 +18,7 @@
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsThreadUtils.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "Latency.h"
#include "mozilla/Telemetry.h"
#endif
@ -369,7 +369,7 @@ WebrtcAudioConduit::ConfigureSendMediaCodec(const AudioCodecConfig* codecConfig)
return kMediaConduitUnknownError;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// TEMPORARY - see bug 694814 comment 2
nsresult rv;
nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
@ -530,7 +530,7 @@ WebrtcAudioConduit::SendAudioFrame(const int16_t audio_data[],
return kMediaConduitSessionNotInited;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
struct Processing insert = { TimeStamp::Now(), 0 };
mProcessing.AppendElement(insert);
@ -624,7 +624,7 @@ WebrtcAudioConduit::GetAudioFrame(int16_t speechData[],
if (GetAVStats(&jitter_buffer_delay_ms,
&playout_buffer_delay_ms,
&avsync_offset_ms)) {
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (avsync_offset_ms < 0) {
Telemetry::Accumulate(Telemetry::WEBRTC_AVSYNC_WHEN_VIDEO_LAGS_AUDIO_MS,
-avsync_offset_ms);
@ -642,7 +642,7 @@ WebrtcAudioConduit::GetAudioFrame(int16_t speechData[],
mLastSyncLog = mSamples;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
if (mProcessing.Length() > 0) {
unsigned int now;
@ -679,7 +679,7 @@ WebrtcAudioConduit::ReceivedRTPPacket(const void *data, int len)
if(mEngineReceiving)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
// timestamp is at 32 bits in ([1])
struct Processing insert = { TimeStamp::Now(),
@ -817,7 +817,7 @@ int WebrtcAudioConduit::SendPacket(int channel, const void* data, int len)
{
CSFLogDebug(logTag, "%s : channel %d", __FUNCTION__, channel);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) {
if (mProcessing.Length() > 0) {
TimeStamp started = mProcessing[0].mTimeStamp;

View File

@ -171,7 +171,7 @@ public:
mChannel(-1),
mCurSendCodecConfig(nullptr),
mCaptureDelay(150),
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
mLastTimestamp(0),
#endif // MOZILLA_INTERNAL_API
mSamples(0),
@ -282,7 +282,7 @@ private:
// Current "capture" delay (really output plus input delay)
int32_t mCaptureDelay;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
uint32_t mLastTimestamp;
#endif // MOZILLA_INTERNAL_API

View File

@ -5,9 +5,7 @@
#include "CodecStatistics.h"
#include "CSFLog.h"
#if !defined(MOZILLA_XPCOMRT_API)
#include "mozilla/Telemetry.h"
#endif // !defined(MOZILLA_XPCOMRT_API)
using namespace mozilla;
using namespace webrtc;
@ -119,10 +117,8 @@ void VideoCodecStatistics::ReceiveStateChange(const int aChannel,
TimeDuration timeDelta = TimeStamp::Now() - mReceiveFailureTime;
CSFLogError(logTag, "Video error duration: %u ms",
static_cast<uint32_t>(timeDelta.ToMilliseconds()));
#if !defined(MOZILLA_XPCOMRT_API)
Telemetry::Accumulate(Telemetry::WEBRTC_VIDEO_ERROR_RECOVERY_MS,
static_cast<uint32_t>(timeDelta.ToMilliseconds()));
#endif //
mRecoveredLosses++; // to calculate losses per minute
mTotalLossTime += timeDelta; // To calculate % time in recovery
@ -144,22 +140,16 @@ void VideoCodecStatistics::EndOfCallStats()
if (callDelta.ToSeconds() != 0) {
uint32_t recovered_per_min = mRecoveredBeforeLoss/(callDelta.ToSeconds()/60);
CSFLogError(logTag, "Video recovery before error per min %u", recovered_per_min);
#if !defined(MOZILLA_XPCOMRT_API)
Telemetry::Accumulate(Telemetry::WEBRTC_VIDEO_RECOVERY_BEFORE_ERROR_PER_MIN,
recovered_per_min);
#endif // !defined(MOZILLA_XPCOMRT_API)
uint32_t err_per_min = mRecoveredLosses/(callDelta.ToSeconds()/60);
CSFLogError(logTag, "Video recovery after error per min %u", err_per_min);
#if !defined(MOZILLA_XPCOMRT_API)
Telemetry::Accumulate(Telemetry::WEBRTC_VIDEO_RECOVERY_AFTER_ERROR_PER_MIN,
err_per_min);
#endif // !defined(MOZILLA_XPCOMRT_API)
float percent = (mTotalLossTime.ToSeconds()*100)/callDelta.ToSeconds();
CSFLogError(logTag, "Video error time percentage %f%%", percent);
#if !defined(MOZILLA_XPCOMRT_API)
Telemetry::Accumulate(Telemetry::WEBRTC_VIDEO_DECODE_ERROR_TIME_PERMILLE,
static_cast<uint32_t>(percent*10));
#endif // !defined(MOZILLA_XPCOMRT_API)
}
}
#endif

View File

@ -278,7 +278,7 @@ WebrtcVideoConduit::Init()
{
CSFLogDebug(logTag, "%s this=%p", __FUNCTION__, this);
#if defined(MOZILLA_INTERNAL_API) && !defined(MOZILLA_INTERNAL_API)
#ifdef MOZILLA_INTERNAL_API
// already know we must be on MainThread barring unit test weirdness
MOZ_ASSERT(NS_IsMainThread());

View File

@ -16,7 +16,7 @@
#include "nspr.h"
#include "srtp.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "VideoSegment.h"
#include "Layers.h"
#include "ImageTypes.h"
@ -38,7 +38,7 @@
#include "transportlayerice.h"
#include "runnable_utils.h"
#include "libyuv/convert.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "mozilla/PeerIdentity.h"
#endif
#include "mozilla/gfx/Point.h"
@ -643,7 +643,7 @@ void MediaPipelineTransmit::AttachToTrack(const std::string& track_id) {
#endif
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
void MediaPipelineTransmit::UpdateSinkIdentity_m(nsIPrincipal* principal,
const PeerIdentity* sinkIdentity) {
ASSERT_ON_THREAD(main_thread_);
@ -931,7 +931,7 @@ NewData(MediaStreamGraph* graph, TrackID tid,
iter.Next();
}
} else if (media.GetType() == MediaSegment::VIDEO) {
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
VideoSegment* video = const_cast<VideoSegment *>(
static_cast<const VideoSegment *>(&media));
@ -1044,7 +1044,7 @@ void MediaPipelineTransmit::PipelineListener::ProcessAudioChunk(
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
void MediaPipelineTransmit::PipelineListener::ProcessVideoChunk(
VideoSessionConduit* conduit,
VideoChunk& chunk) {
@ -1234,7 +1234,7 @@ static void AddTrackAndListener(MediaStream* source,
const RefPtr<TrackAddedCallback>& completed,
bool queue_track) {
// This both adds the listener and the track
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
class Message : public ControlMessage {
public:
Message(MediaStream* stream, TrackID track, TrackRate rate,
@ -1396,7 +1396,7 @@ nsresult MediaPipelineReceiveVideo::Init() {
description_ += track_id_;
description_ += "]";
#if defined(MOZILLA_INTERNAL_API)
#ifdef MOZILLA_INTERNAL_API
listener_->AddSelf(new VideoSegment());
#endif
@ -1412,14 +1412,12 @@ MediaPipelineReceiveVideo::PipelineListener::PipelineListener(
: GenericReceiveListener(source, track_id, source->GraphRate(), queue_track),
width_(640),
height_(480),
#if defined(MOZILLA_XPCOMRT_API)
image_(new mozilla::SimpleImageBuffer),
#elif defined(MOZILLA_INTERNAL_API)
#ifdef MOZILLA_INTERNAL_API
image_container_(),
image_(),
#endif
monitor_("Video PipelineListener") {
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
image_container_ = layers::LayerManager::CreateImageContainer();
#endif
}
@ -1430,13 +1428,9 @@ void MediaPipelineReceiveVideo::PipelineListener::RenderVideoFrame(
uint32_t time_stamp,
int64_t render_time,
const RefPtr<layers::Image>& video_image) {
#ifdef MOZILLA_INTERNAL_API
ReentrantMonitorAutoEnter enter(monitor_);
#if defined(MOZILLA_XPCOMRT_API)
if (buffer) {
image_->SetImage(buffer, buffer_size, width_, height_);
}
#elif defined(MOZILLA_INTERNAL_API)
if (buffer) {
// Create a video frame using |buffer|.
#ifdef MOZ_WIDGET_GONK
@ -1479,15 +1473,10 @@ void MediaPipelineReceiveVideo::PipelineListener::
NotifyPull(MediaStreamGraph* graph, StreamTime desired_time) {
ReentrantMonitorAutoEnter enter(monitor_);
#if defined(MOZILLA_XPCOMRT_API)
nsRefPtr<SimpleImageBuffer> image = image_;
#elif defined(MOZILLA_INTERNAL_API)
#ifdef MOZILLA_INTERNAL_API
nsRefPtr<layers::Image> image = image_;
// our constructor sets track_rate_ to the graph rate
MOZ_ASSERT(track_rate_ == source_->GraphRate());
#endif
#if defined(MOZILLA_INTERNAL_API)
StreamTime delta = desired_time - played_ticks_;
// Don't append if we've already provided a frame that supposedly
@ -1505,12 +1494,6 @@ NotifyPull(MediaStreamGraph* graph, StreamTime desired_time) {
}
}
#endif
#if defined(MOZILLA_XPCOMRT_API)
// Clear the image without deleting the memory.
// This prevents image_ from being used if it
// does not have new content during the next NotifyPull.
image_->SetImage(nullptr, 0, 0, 0);
#endif
}

View File

@ -27,7 +27,7 @@
#include "runnable_utils.h"
#include "transportflow.h"
#if defined(MOZILLA_INTERNAL_API)
#ifdef MOZILLA_INTERNAL_API
#include "VideoSegment.h"
#endif
@ -406,7 +406,7 @@ public:
// written and used from MainThread
virtual bool IsVideo() const override { return is_video_; }
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// when the principal of the PeerConnection changes, it calls through to here
// so that we can determine whether to enable stream transmission
virtual void UpdateSinkIdentity_m(nsIPrincipal* principal,
@ -449,7 +449,7 @@ public:
samples_10ms_buffer_(nullptr),
buffer_current_(0),
samplenum_10ms_(0)
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
, last_img_(-1)
#endif // MOZILLA_INTERNAL_API
{
@ -494,7 +494,7 @@ public:
virtual void ProcessAudioChunk(AudioSessionConduit *conduit,
TrackRate rate, AudioChunk& chunk);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
virtual void ProcessVideoChunk(VideoSessionConduit *conduit,
VideoChunk& chunk);
#endif
@ -525,7 +525,7 @@ public:
// The number of samples in a 10ms audio chunk.
int64_t samplenum_10ms_;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
int32_t last_img_; // serial number of last Image
#endif // MOZILLA_INTERNAL_API
};
@ -746,9 +746,7 @@ class MediaPipelineReceiveVideo : public MediaPipelineReceive {
private:
int width_;
int height_;
#if defined(MOZILLA_XPCOMRT_API)
nsRefPtr<mozilla::SimpleImageBuffer> image_;
#elif defined(MOZILLA_INTERNAL_API)
#ifdef MOZILLA_INTERNAL_API
nsRefPtr<layers::ImageContainer> image_container_;
nsRefPtr<layers::Image> image_;
#endif

View File

@ -16,7 +16,7 @@
#include "signaling/src/jsep/JsepTransport.h"
#include "signaling/src/common/PtrVector.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "MediaStreamTrack.h"
#include "nsIPrincipal.h"
#include "nsIDocument.h"
@ -503,7 +503,7 @@ MediaPipelineFactory::CreateMediaPipelineSending(
aRtcpFlow,
aFilter);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// implement checking for peerIdentity (where failure == black/silence)
nsIDocument* doc = mPC->GetWindow()->GetExtantDoc();
if (doc) {
@ -771,7 +771,7 @@ nsresult
MediaPipelineFactory::ConfigureVideoCodecMode(const JsepTrack& aTrack,
VideoSessionConduit& aConduit)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsRefPtr<LocalSourceStreamInfo> stream =
mPCMedia->GetLocalStreamById(aTrack.GetStreamId());
@ -842,7 +842,7 @@ MediaPipelineFactory::EnsureExternalCodec(VideoSessionConduit& aConduit,
#ifdef MOZ_WEBRTC_OMX
encoder =
OMXVideoCodec::CreateEncoder(OMXVideoCodec::CodecType::CODEC_H264);
#elif !defined(MOZILLA_XPCOMRT_API)
#else
encoder = GmpVideoCodec::CreateEncoder();
#endif
if (encoder) {
@ -851,11 +851,11 @@ MediaPipelineFactory::EnsureExternalCodec(VideoSessionConduit& aConduit,
return kMediaConduitInvalidSendCodec;
}
} else {
VideoDecoder* decoder = nullptr;
VideoDecoder* decoder;
#ifdef MOZ_WEBRTC_OMX
decoder =
OMXVideoCodec::CreateDecoder(OMXVideoCodec::CodecType::CODEC_H264);
#elif !defined(MOZILLA_XPCOMRT_API)
#else
decoder = GmpVideoCodec::CreateDecoder();
#endif
if (decoder) {

View File

@ -12,7 +12,7 @@
#include "mozilla/Telemetry.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "mozilla/dom/RTCPeerConnectionBinding.h"
#include "mozilla/Preferences.h"
#include <mozilla/Types.h>
@ -151,7 +151,7 @@ void PeerConnectionCtx::Destroy() {
}
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
typedef Vector<nsAutoPtr<RTCStatsQuery>> RTCStatsQueries;
// Telemetry reporting every second after start of first call.
@ -309,7 +309,7 @@ PeerConnectionCtx::EverySecondTelemetryCallback_m(nsITimer* timer, void *closure
nsresult PeerConnectionCtx::Initialize() {
initGMP();
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
mConnectionCounter = 0;
Telemetry::GetHistogramById(Telemetry::WEBRTC_CALL_COUNT)->Add(0);
@ -372,7 +372,7 @@ nsresult PeerConnectionCtx::Cleanup() {
PeerConnectionCtx::~PeerConnectionCtx() {
// ensure mTelemetryTimer ends on main thread
MOZ_ASSERT(NS_IsMainThread());
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (mTelemetryTimer) {
mTelemetryTimer->Cancel();
}

View File

@ -49,7 +49,7 @@ class PeerConnectionCtx {
friend class PeerConnectionWrapper;
friend class mozilla::dom::WebrtcGlobalInformation;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// WebrtcGlobalInformation uses this; we put it here so we don't need to
// create another shutdown observer class.
mozilla::dom::Sequence<mozilla::dom::RTCStatsReportInternal>
@ -74,7 +74,7 @@ class PeerConnectionCtx {
static void
EverySecondTelemetryCallback_m(nsITimer* timer, void *);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Telemetry Peer conection counter
int mConnectionCounter;

View File

@ -46,7 +46,7 @@
#include "signaling/src/jsep/JsepSession.h"
#include "signaling/src/jsep/JsepSessionImpl.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#ifdef XP_WIN
// We need to undef the MS macro for nsIDocument::CreateEvent
#ifdef CreateEvent
@ -54,7 +54,9 @@
#endif
#endif // XP_WIN
#ifdef MOZILLA_INTERNAL_API
#include "nsIDocument.h"
#endif
#include "nsPerformance.h"
#include "nsGlobalWindow.h"
#include "nsDOMDataChannel.h"
@ -134,7 +136,7 @@ class JSErrorResult : public ErrorResult
public:
~JSErrorResult()
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
WouldReportJSException();
if (IsJSException()) {
MOZ_ASSERT(NS_IsMainThread());
@ -172,7 +174,7 @@ private:
};
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback
{
public:
@ -262,7 +264,7 @@ private:
};
#endif
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
static nsresult InitNSSInContent()
{
NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_NOT_SAME_THREAD);
@ -318,7 +320,7 @@ const nsIID nsISupportsWeakReference::COMTypeInfo<nsSupportsWeakReference, void>
namespace mozilla {
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
RTCStatsQuery::RTCStatsQuery(bool internal) :
failed(false),
internalStats(internal) {
@ -332,7 +334,7 @@ RTCStatsQuery::~RTCStatsQuery() {
NS_IMPL_ISUPPORTS0(PeerConnectionImpl)
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
bool
PeerConnectionImpl::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto,
@ -389,7 +391,7 @@ PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal)
, mTrickle(true) // TODO(ekr@rtfm.com): Use pref
, mShouldSuppressNegotiationNeeded(true)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
MOZ_ASSERT(NS_IsMainThread());
if (aGlobal) {
mWindow = do_QueryInterface(aGlobal->GetAsSupports());
@ -398,7 +400,7 @@ PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal)
CSFLogInfo(logTag, "%s: PeerConnectionImpl constructor for %s",
__FUNCTION__, mHandle.c_str());
STAMP_TIMECARD(mTimeCard, "Constructor Completed");
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
mAllowIceLoopback = Preferences::GetBool(
"media.peerconnection.ice.loopback", false);
#endif
@ -425,7 +427,7 @@ PeerConnectionImpl::~PeerConnectionImpl()
Close();
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
{
// Deregister as an NSS Shutdown Object
nsNSSShutDownPreventionLock locker;
@ -451,7 +453,7 @@ PeerConnectionImpl::MakeMediaStream()
nsRefPtr<DOMMediaStream> stream =
DOMMediaStream::CreateSourceStream(GetWindow());
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Make the stream data (audio/video samples) accessible to the receiving page.
// We're only certain that privacy hasn't been requested if we're connected.
if (mDtlsConnected && !PrivacyRequested()) {
@ -507,7 +509,7 @@ nsresult
PeerConnectionImpl::ConvertRTCConfiguration(const RTCConfiguration& aSrc,
IceConfiguration *aDst)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (aSrc.mIceServers.WasPassed()) {
for (size_t i = 0; i < aSrc.mIceServers.Value().Length(); i++) {
nsresult rv = AddIceServer(aSrc.mIceServers.Value()[i], aDst);
@ -522,7 +524,7 @@ nsresult
PeerConnectionImpl::AddIceServer(const RTCIceServer &aServer,
IceConfiguration *aDst)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
NS_ENSURE_STATE(aServer.mUrls.WasPassed());
NS_ENSURE_STATE(aServer.mUrls.Value().IsStringSequence());
auto &urls = aServer.mUrls.Value().GetAsStringSequence();
@ -642,7 +644,7 @@ PeerConnectionImpl::Initialize(PeerConnectionObserver& aObserver,
mSTSThread = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &res);
MOZ_ASSERT(mSTSThread);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Initialize NSS if we are in content process. For chrome process, NSS should already
// been initialized.
@ -670,7 +672,7 @@ PeerConnectionImpl::Initialize(PeerConnectionObserver& aObserver,
// Ok if we truncate this.
char temp[128];
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsAutoCString locationCStr;
nsIDOMLocation* location;
res = mWindow->GetLocation(&location);
@ -837,7 +839,6 @@ class CompareCodecPriority {
nsresult
PeerConnectionImpl::ConfigureJsepSessionCodecs() {
#if !defined(MOZILLA_XPCOMRT_API)
nsresult res;
nsCOMPtr<nsIPrefService> prefs =
do_GetService("@mozilla.org/preferences-service;1", &res);
@ -888,7 +889,7 @@ PeerConnectionImpl::ConfigureJsepSessionCodecs() {
#endif // MOZ_WEBRTC_OMX
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
bool softwareH264Enabled = PeerConnectionCtx::GetInstance()->gmpHasH264();
#else
// For unit-tests
@ -989,7 +990,7 @@ PeerConnectionImpl::ConfigureJsepSessionCodecs() {
}
std::stable_sort(codecs.begin(), codecs.end(), comparator);
#endif // !defined(MOZILLA_XPCOMRT_API)
return NS_OK;
}
@ -1008,7 +1009,7 @@ PeerConnectionImpl::EnsureDataConnection(uint16_t aNumstreams)
{
PC_AUTO_ENTER_API_CALL_NO_CHECK();
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (mDataConnection) {
CSFLogDebug(logTag,"%s DataConnection already connected",__FUNCTION__);
// Ignore the request to connect when already connected. This entire
@ -1118,7 +1119,7 @@ PeerConnectionImpl::InitializeDataChannel()
return NS_OK;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
uint32_t channels = codec->mChannels;
if (channels > MAX_NUM_STREAMS) {
channels = MAX_NUM_STREAMS;
@ -1164,7 +1165,7 @@ PeerConnectionImpl::CreateDataChannel(const nsAString& aLabel,
uint16_t aStream,
ErrorResult &rv)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsRefPtr<nsDOMDataChannel> result;
rv = CreateDataChannel(aLabel, aProtocol, aType, outOfOrderAllowed,
aMaxTime, aMaxNum, aExternalNegotiated,
@ -1189,7 +1190,7 @@ PeerConnectionImpl::CreateDataChannel(const nsAString& aLabel,
PC_AUTO_ENTER_API_CALL_NO_CHECK();
MOZ_ASSERT(aRetval);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsRefPtr<DataChannel> dataChannel;
DataChannelConnection::Type theType =
static_cast<DataChannelConnection::Type>(aType);
@ -1273,7 +1274,7 @@ do_QueryObjectReferent(nsIWeakReference* aRawPtr) {
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Not a member function so that we don't need to keep the PC live.
static void NotifyDataChannel_m(nsRefPtr<nsIDOMDataChannel> aChannel,
nsRefPtr<PeerConnectionObserver> aObserver)
@ -1301,7 +1302,7 @@ PeerConnectionImpl::NotifyDataChannel(already_AddRefed<DataChannel> aChannel)
CSFLogDebug(logTag, "%s: channel: %p", __FUNCTION__, channel);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsCOMPtr<nsIDOMDataChannel> domchannel;
nsresult rv = NS_NewDOMDataChannel(already_AddRefed<DataChannel>(channel),
mWindow, getter_AddRefs(domchannel));
@ -1326,7 +1327,7 @@ NS_IMETHODIMP
PeerConnectionImpl::CreateOffer(const RTCOfferOptions& aOptions)
{
JsepOfferOptions options;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (aOptions.mOfferToReceiveAudio.WasPassed()) {
options.mOfferToReceiveAudio =
mozilla::Some(size_t(aOptions.mOfferToReceiveAudio.Value()));
@ -1473,7 +1474,7 @@ PeerConnectionImpl::SetLocalDescription(int32_t aAction, const char* aSDP)
STAMP_TIMECARD(mTimeCard, "Set Local Description");
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
bool isolated = mMedia->AnyLocalStreamHasPeerIdentity();
mPrivacyRequested = mPrivacyRequested || isolated;
#endif
@ -1654,7 +1655,7 @@ PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP)
}
CSFLogDebug(logTag, "Added remote stream %s", info->GetId().c_str());
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
info->GetMediaStream()->AssignId(NS_ConvertUTF8toUTF16(streamId.c_str()));
#else
info->GetMediaStream()->AssignId((streamId));
@ -1685,7 +1686,7 @@ PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP)
}
// Now that the streams are all set up, notify about track availability.
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
TracksAvailableCallback* tracksAvailableCallback =
new TracksAvailableCallback(numNewAudioTracks,
numNewVideoTracks,
@ -1720,7 +1721,7 @@ PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP)
}
pco->OnSetRemoteDescriptionSuccess(jrv);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
startCallTelem();
#endif
}
@ -1731,7 +1732,7 @@ PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP)
// WebRTC uses highres time relative to the UNIX epoch (Jan 1, 1970, UTC).
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsresult
PeerConnectionImpl::GetTimeSinceEpoch(DOMHighResTimeStamp *result) {
MOZ_ASSERT(NS_IsMainThread());
@ -1763,7 +1764,7 @@ NS_IMETHODIMP
PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector) {
PC_AUTO_ENTER_API_CALL(true);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (!mMedia) {
// Since we zero this out before the d'tor, we should check.
return NS_ERROR_UNEXPECTED;
@ -1798,7 +1799,7 @@ PeerConnectionImpl::AddIceCandidate(const char* aCandidate, const char* aMid, un
CSFLogDebug(logTag, "AddIceCandidate: %s", aCandidate);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// When remote candidates are added before our ICE ctx is up and running
// (the transition to New is async through STS, so this is not impossible),
// we won't record them as trickle candidates. Is this what we want?
@ -1861,7 +1862,7 @@ PeerConnectionImpl::CloseStreams() {
return NS_OK;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsresult
PeerConnectionImpl::SetPeerIdentity(const nsAString& aPeerIdentity)
{
@ -1895,7 +1896,7 @@ PeerConnectionImpl::SetDtlsConnected(bool aPrivacyRequested)
// fixate on that peer. Dealing with multiple peers or connections is more
// than this run-down wreck of an object can handle.
// Besides, this is only used to say if we have been connected ever.
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (!mPrivacyRequested && !aPrivacyRequested && !mDtlsConnected) {
// now we know that privacy isn't needed for sure
nsIDocument* doc = GetWindow()->GetExtantDoc();
@ -1911,7 +1912,7 @@ PeerConnectionImpl::SetDtlsConnected(bool aPrivacyRequested)
return NS_OK;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
void
PeerConnectionImpl::PrincipalChanged(DOMMediaStream* aMediaStream) {
nsIDocument* doc = GetWindow()->GetExtantDoc();
@ -1923,7 +1924,7 @@ PeerConnectionImpl::PrincipalChanged(DOMMediaStream* aMediaStream) {
}
#endif
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsresult
PeerConnectionImpl::GetRemoteTrackId(const std::string streamId,
TrackID numericTrackId,
@ -1940,7 +1941,7 @@ PeerConnectionImpl::GetRemoteTrackId(const std::string streamId,
std::string
PeerConnectionImpl::GetTrackId(const MediaStreamTrack& aTrack)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsString wideTrackId;
aTrack.GetId(wideTrackId);
return NS_ConvertUTF16toUTF8(wideTrackId).get();
@ -1952,7 +1953,7 @@ PeerConnectionImpl::GetTrackId(const MediaStreamTrack& aTrack)
std::string
PeerConnectionImpl::GetStreamId(const DOMMediaStream& aStream)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsString wideStreamId;
aStream.GetId(wideStreamId);
return NS_ConvertUTF16toUTF8(wideStreamId).get();
@ -2014,7 +2015,7 @@ PeerConnectionImpl::AddTrack(MediaStreamTrack& aTrack,
}
if (aTrack.AsVideoStreamTrack()) {
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (!Preferences::GetBool("media.peerconnection.video.enabled", true)) {
// Before this code was moved, this would silently ignore just like it
// does now. Is this actually what we want to do?
@ -2089,7 +2090,7 @@ PeerConnectionImpl::ReplaceTrack(MediaStreamTrack& aThisTrack,
}
JSErrorResult jrv;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (&aThisTrack == &aWithTrack) {
pco->OnReplaceTrackSuccess(jrv);
if (jrv.Failed()) {
@ -2306,7 +2307,7 @@ PeerConnectionImpl::PluginCrash(uint64_t aPluginID,
CSFLogError(logTag, "%s: Our plugin %llu crashed", __FUNCTION__, static_cast<unsigned long long>(aPluginID));
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsCOMPtr<nsIDocument> doc = mWindow->GetExtantDoc();
if (!doc) {
NS_WARNING("Couldn't get document for PluginCrashed event!");
@ -2348,7 +2349,7 @@ PeerConnectionImpl::CloseInt()
if (mJsepSession) {
mJsepSession->Close();
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (mDataConnection) {
CSFLogInfo(logTag, "%s: Destroying DataChannelConnection %p for %s",
__FUNCTION__, (void *) mDataConnection.get(), mHandle.c_str());
@ -2371,7 +2372,7 @@ PeerConnectionImpl::ShutdownMedia()
if (!mMedia)
return;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// before we destroy references to local streams, detach from them
for(uint32_t i = 0; i < media()->LocalStreamsLength(); ++i) {
LocalSourceStreamInfo *info = media()->GetLocalStreamByIndex(i);
@ -2390,7 +2391,7 @@ PeerConnectionImpl::ShutdownMedia()
mMedia.forget().take()->SelfDestruct();
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// If NSS is shutting down, then we need to get rid of the DTLS
// identity right now; otherwise, we'll cause wreckage when we do
// finally deallocate it in our destructor.
@ -2646,7 +2647,7 @@ PeerConnectionImpl::SendLocalIceCandidateToContent(
NS_DISPATCH_NORMAL);
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
static bool isDone(PCImplIceConnectionState state) {
return state != PCImplIceConnectionState::Checking &&
state != PCImplIceConnectionState::New;
@ -2672,7 +2673,7 @@ void PeerConnectionImpl::IceConnectionStateChange(
auto domState = toDomIceConnectionState(state);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (!isDone(mIceConnectionState) && isDone(domState)) {
// mIceStartTime can be null if going directly from New to Closed, in which
// case we don't count it as a success or a failure.
@ -2708,7 +2709,7 @@ void PeerConnectionImpl::IceConnectionStateChange(
STAMP_TIMECARD(mTimeCard, "Ice state: new");
break;
case PCImplIceConnectionState::Checking:
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// For telemetry
mIceStartTime = TimeStamp::Now();
#endif
@ -2798,7 +2799,7 @@ PeerConnectionImpl::EndOfLocalCandidates(const std::string& defaultAddr,
mJsepSession->EndOfLocalCandidates(defaultAddr, defaultPort, level);
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsresult
PeerConnectionImpl::BuildStatsQuery_m(
mozilla::dom::MediaStreamTrack *aSelector,
@ -3257,7 +3258,7 @@ void PeerConnectionImpl::DeliverStatsReportToPCObserver_m(
void
PeerConnectionImpl::RecordLongtermICEStatistics() {
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
WebrtcGlobalInformation::StoreLongTermICEStatistics(*this);
#endif
}
@ -3289,7 +3290,7 @@ PeerConnectionImpl::IceStreamReady(NrIceMediaStream *aStream)
CSFLogDebug(logTag, "%s: %s", __FUNCTION__, aStream->name().c_str());
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
//Telemetry for when calls start
void
PeerConnectionImpl::startCallTelem() {
@ -3308,7 +3309,7 @@ NS_IMETHODIMP
PeerConnectionImpl::GetLocalStreams(nsTArray<nsRefPtr<DOMMediaStream > >& result)
{
PC_AUTO_ENTER_API_CALL_NO_CHECK();
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
for(uint32_t i=0; i < media()->LocalStreamsLength(); i++) {
LocalSourceStreamInfo *info = media()->GetLocalStreamByIndex(i);
NS_ENSURE_TRUE(info, NS_ERROR_UNEXPECTED);
@ -3324,7 +3325,7 @@ NS_IMETHODIMP
PeerConnectionImpl::GetRemoteStreams(nsTArray<nsRefPtr<DOMMediaStream > >& result)
{
PC_AUTO_ENTER_API_CALL_NO_CHECK();
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
for(uint32_t i=0; i < media()->RemoteStreamsLength(); i++) {
RemoteSourceStreamInfo *info = media()->GetRemoteStreamByIndex(i);
NS_ENSURE_TRUE(info, NS_ERROR_UNEXPECTED);

View File

@ -33,7 +33,7 @@
#include "mozilla/dom/PeerConnectionImplEnumsBinding.h"
#include "StreamBuffer.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "mozilla/TimeStamp.h"
#include "mozilla/net/DataChannel.h"
#include "VideoUtils.h"
@ -129,7 +129,7 @@ using mozilla::DtlsIdentity;
using mozilla::ErrorResult;
using mozilla::NrIceStunServer;
using mozilla::NrIceTurnServer;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
using mozilla::PeerIdentity;
#endif
@ -186,7 +186,7 @@ private:
std::vector<NrIceTurnServer> mTurnServers;
};
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Not an inner class so we can forward declare.
class RTCStatsQuery {
public:
@ -228,7 +228,7 @@ class RTCStatsQuery {
#define PC_AUTO_ENTER_API_CALL_NO_CHECK() CheckThread()
class PeerConnectionImpl final : public nsISupports,
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
public mozilla::DataChannelConnection::DataConnectionListener,
public nsNSSShutDownObject,
public DOMMediaStream::PrincipalChangeObserver,
@ -253,7 +253,7 @@ public:
NS_DECL_THREADSAFE_ISUPPORTS
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
#endif
@ -271,7 +271,7 @@ public:
// DataConnection observers
void NotifyDataChannel(already_AddRefed<mozilla::DataChannel> aChannel)
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// PeerConnectionImpl only inherits from mozilla::DataChannelConnection
// inside libxul.
override
@ -425,7 +425,7 @@ public:
nsresult GetPeerIdentity(nsAString& peerIdentity)
{
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
if (mPeerIdentity) {
peerIdentity = mPeerIdentity->ToString();
return NS_OK;
@ -436,7 +436,7 @@ public:
return NS_OK;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
const PeerIdentity* GetPeerIdentity() const { return mPeerIdentity; }
nsresult SetPeerIdentity(const nsAString& peerIdentity);
@ -583,7 +583,7 @@ public:
bool HasMedia() const;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// initialize telemetry for when calls start
void startCallTelem();
@ -626,11 +626,9 @@ private:
MOZ_ASSERT(CheckThreadInt(), "Wrong thread");
}
bool CheckThreadInt() const {
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Thread assertions are disabled in the C++ unit tests because those
// make API calls off the main thread.
// This affects the standalone version of WebRTC since it is also used
// for an alternate build of the unit tests.
// TODO(ekr@rtfm.com): Fix the unit tests so they don't do that.
bool on;
NS_ENSURE_SUCCESS(mThread->IsOnCurrentThread(&on), false);
@ -639,7 +637,7 @@ private:
return true;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
void virtualDestroyNSSReference() final;
void destructorSafeDestroyNSSReference();
nsresult GetTimeSinceEpoch(DOMHighResTimeStamp *result);
@ -657,7 +655,7 @@ private:
const mozilla::JsepApplicationCodecDescription** codec,
uint16_t* level) const;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
static void GetStatsForPCObserver_s(
const std::string& pcHandle,
nsAutoPtr<RTCStatsQuery> query);
@ -709,7 +707,7 @@ private:
// identity-related fields
mozilla::RefPtr<DtlsIdentity> mIdentity;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// The entity on the other end of the peer-to-peer connection;
// void if they are not yet identified, and no identity setting has been set
nsAutoPtr<PeerIdentity> mPeerIdentity;
@ -731,7 +729,7 @@ private:
// The target to run stuff on
nsCOMPtr<nsIEventTarget> mSTSThread;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// DataConnection that's used to get all the DataChannels
nsRefPtr<mozilla::DataChannelConnection> mDataConnection;
#endif
@ -743,7 +741,7 @@ private:
mozilla::UniquePtr<PCUuidGenerator> mUuidGen;
mozilla::UniquePtr<mozilla::JsepSession> mJsepSession;
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// Start time of ICE, used for telemetry
mozilla::TimeStamp mIceStartTime;
// Start time of call used for Telemetry

View File

@ -23,7 +23,6 @@
#include "signaling/src/jsep/JsepSession.h"
#include "signaling/src/jsep/JsepTransport.h"
#if !defined(MOZILLA_XPCOMRT_API)
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsICancelable.h"
@ -32,11 +31,9 @@
#include "nsIContentPolicy.h"
#include "nsIProxyInfo.h"
#include "nsIProtocolProxyService.h"
#endif // !defined(MOZILLA_XPCOMRT_API)
#include "nsProxyRelease.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "MediaStreamList.h"
#include "nsIScriptGlobalObject.h"
#include "mozilla/Preferences.h"
@ -156,7 +153,6 @@ PeerConnectionImpl* PeerConnectionImpl::CreatePeerConnection()
return pc;
}
#if !defined(MOZILLA_XPCOMRT_API)
NS_IMETHODIMP PeerConnectionMedia::ProtocolProxyQueryHandler::
OnProxyAvailable(nsICancelable *request,
nsIChannel *aChannel,
@ -203,7 +199,6 @@ OnProxyAvailable(nsICancelable *request,
}
NS_IMPL_ISUPPORTS(PeerConnectionMedia::ProtocolProxyQueryHandler, nsIProtocolProxyCallback)
#endif // !defined(MOZILLA_XPCOMRT_API)
PeerConnectionMedia::PeerConnectionMedia(PeerConnectionImpl *parent)
: mParent(parent),
@ -222,10 +217,6 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
const std::vector<NrIceTurnServer>& turn_servers)
{
nsresult rv;
#if defined(MOZILLA_XPCOMRT_API)
// TODO(Bug 1126039) Standalone XPCOMRT does not currently support nsIProtocolProxyService or nsIIOService
mProxyResolveCompleted = true;
#else
nsCOMPtr<nsIProtocolProxyService> pps =
do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID, &rv);
@ -246,7 +237,7 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
nsCOMPtr<nsIChannel> channel;
#if defined(MOZILLA_INTERNAL_API)
#ifdef MOZILLA_INTERNAL_API
nsCOMPtr<nsIDocument> principal = mParent->GetWindow()->GetExtantDoc();
#else
// For unit-tests
@ -265,6 +256,7 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
CSFLogError(logTag, "%s: Failed to get systemPrincipal: %d", __FUNCTION__, (int)rv);
return NS_ERROR_FAILURE;
}
#endif
rv = NS_NewChannel(getter_AddRefs(channel),
fakeHttpsLocation,
@ -287,8 +279,6 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
CSFLogError(logTag, "%s: Failed to resolve protocol proxy: %d", __FUNCTION__, (int)rv);
return NS_ERROR_FAILURE;
}
#endif // defined(MOZILLA_INTERNAL_API)
#endif // defined(MOZILLA_XPCOMRT_API)
// TODO(ekr@rtfm.com): need some way to set not offerer later
// Looks like a bug in the NrIceCtx API.
@ -306,7 +296,7 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
return rv;
}
// Give us a way to globally turn off TURN support
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
bool disabled = Preferences::GetBool("media.peerconnection.turn.disable", false);
#else
bool disabled = false;
@ -1055,7 +1045,7 @@ LocalSourceStreamInfo::TakePipelineFrom(RefPtr<LocalSourceStreamInfo>& info,
return NS_OK;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
/**
* Tells you if any local streams is isolated to a specific peer identity.
* Obviously, we want all the streams to be isolated equally so that they can
@ -1149,7 +1139,7 @@ SourceStreamInfo::AnyCodecHasPluginID(uint64_t aPluginID)
return false;
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsRefPtr<mozilla::dom::VideoStreamTrack>
SourceStreamInfo::GetVideoTrackByTrackId(const std::string& trackId)
{

View File

@ -15,9 +15,7 @@
#include "mozilla/RefPtr.h"
#include "mozilla/UniquePtr.h"
#include "nsComponentManagerUtils.h"
#if !defined(MOZILLA_XPCOMRT_API)
#include "nsIProtocolProxyCallback.h"
#endif
#ifdef USE_FAKE_MEDIA_STREAMS
#include "FakeMediaStreams.h"
@ -29,7 +27,7 @@
#include "signaling/src/jsep/JsepSession.h"
#include "AudioSegment.h"
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
#include "Layers.h"
#include "VideoUtils.h"
#include "ImageLayers.h"
@ -107,7 +105,7 @@ public:
void DetachTransport_s();
void DetachMedia_m();
bool AnyCodecHasPluginID(uint64_t aPluginID);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
nsRefPtr<mozilla::dom::VideoStreamTrack> GetVideoTrackByTrackId(const std::string& trackId);
#endif
protected:
@ -136,7 +134,7 @@ public:
const std::string& oldTrackId,
const std::string& newTrackId);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
void UpdateSinkIdentity_m(nsIPrincipal* aPrincipal,
const PeerIdentity* aSinkIdentity);
#endif
@ -161,7 +159,7 @@ class RemoteSourceStreamInfo : public SourceStreamInfo {
void SyncPipeline(RefPtr<MediaPipelineReceive> aPipeline);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
void UpdatePrincipal_m(nsIPrincipal* aPrincipal);
#endif
@ -298,7 +296,7 @@ class PeerConnectionMedia : public sigslot::has_slots<> {
const std::string& newStreamId,
const std::string& aNewTrack);
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
#ifdef MOZILLA_INTERNAL_API
// In cases where the peer isn't yet identified, we disable the pipeline (not
// the stream, that would potentially affect others), so that it sends
// black/silence. Once the peer is identified, re-enable those streams.
@ -393,7 +391,6 @@ class PeerConnectionMedia : public sigslot::has_slots<> {
SignalEndOfLocalCandidates;
private:
#if !defined(MOZILLA_XPCOMRT_API)
class ProtocolProxyQueryHandler : public nsIProtocolProxyCallback {
public:
explicit ProtocolProxyQueryHandler(PeerConnectionMedia *pcm) :
@ -409,7 +406,6 @@ class PeerConnectionMedia : public sigslot::has_slots<> {
RefPtr<PeerConnectionMedia> pcm_;
virtual ~ProtocolProxyQueryHandler() {}
};
#endif // !defined(MOZILLA_XPCOMRT_API)
// Shutdown media transport. Must be called on STS thread.
void ShutdownMediaTransport_s();

View File

@ -33,15 +33,6 @@ namespace mozilla {
class MediaSegment;
};
class Fake_VideoSink {
public:
Fake_VideoSink() {}
virtual void SegmentReady(mozilla::MediaSegment* aSegment) = 0;
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Fake_VideoSink)
protected:
virtual ~Fake_VideoSink() {}
};
class Fake_SourceMediaStream;
class Fake_MediaStreamListener
@ -91,16 +82,6 @@ class Fake_MediaStream {
mListeners.erase(aListener);
}
void NotifyPull(mozilla::MediaStreamGraph* graph,
mozilla::StreamTime aDesiredTime) {
mozilla::MutexAutoLock lock(mMutex);
std::set<Fake_MediaStreamListener *>::iterator it;
for (it = mListeners.begin(); it != mListeners.end(); ++it) {
(*it)->NotifyPull(graph, aDesiredTime);
}
}
virtual Fake_SourceMediaStream *AsSourceStream() { return nullptr; }
virtual nsresult Start() { return NS_OK; }
@ -153,11 +134,6 @@ class Fake_SourceMediaStream : public Fake_MediaStream {
enum {
ADDTRACK_QUEUED = 0x01 // Queue track add until FinishAddTracks()
};
void AddVideoSink(const nsRefPtr<Fake_VideoSink>& aSink) {
mSink = aSink;
}
void AddTrack(mozilla::TrackID aID, mozilla::StreamTime aStart,
mozilla::MediaSegment* aSegment, uint32_t aFlags = 0) {
delete aSegment;
@ -206,9 +182,6 @@ class Fake_SourceMediaStream : public Fake_MediaStream {
} else {
//in the case of video segment appended, we just increase the
//segment count.
if (mSink.get()) {
mSink->SegmentReady(aSegment);
}
++mSegmentsAdded;
}
return true;
@ -244,7 +217,6 @@ class Fake_SourceMediaStream : public Fake_MediaStream {
bool mPullEnabled;
bool mStop;
nsRefPtr<Fake_MediaPeriodic> mPeriodic;
nsRefPtr<Fake_VideoSink> mSink;
nsCOMPtr<nsITimer> mTimer;
};
@ -277,14 +249,6 @@ public:
{
return mIsVideo? nullptr : this;
}
const uint32_t typeSize () const
{
return sizeof(Fake_MediaStreamTrack);
}
const char* typeName () const
{
return "Fake_MediaStreamTrack";
}
private:
~Fake_MediaStreamTrack() {}

View File

@ -55,13 +55,6 @@ public:
pc(peerConnection) {
}
AFakePCObserver() :
state(stateNoResponse), addIceSuccessCount(0),
onAddStreamCalled(false),
name(""),
pc(nullptr) {
}
virtual ~AFakePCObserver() {}
std::vector<mozilla::DOMMediaStream *> GetStreams() { return streams; }

View File

@ -1,143 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['OS_TARGET'] in ('Darwin', 'Android'):
DEFINES['GTEST_USE_OWN_TR1_TUPLE'] = 1
for var in ('MOZILLA_EXTERNAL_LINKAGE', 'USE_FAKE_MEDIA_STREAMS', 'USE_FAKE_PCOBSERVER',
'NR_SOCKET_IS_VOID_PTR', 'HAVE_STRDUP'):
DEFINES[var] = True
GENERATED_INCLUDES += [
'/dom/bindings',
]
LOCAL_INCLUDES += [
'/dom/media/',
'/ipc/chromium/src',
'/media/mtransport',
'/media/mtransport/test',
'/media/mtransport/third_party/nICEr/src/ice',
'/media/mtransport/third_party/nICEr/src/net',
'/media/mtransport/third_party/nICEr/src/stun',
'/media/mtransport/third_party/nrappkit/src/event',
'/media/mtransport/third_party/nrappkit/src/log',
'/media/mtransport/third_party/nrappkit/src/plugin',
'/media/mtransport/third_party/nrappkit/src/registry',
'/media/mtransport/third_party/nrappkit/src/share',
'/media/mtransport/third_party/nrappkit/src/stats',
'/media/mtransport/third_party/nrappkit/src/util/libekr',
'/media/webrtc',
'/media/webrtc/signaling/src/common/browser_logging',
'/media/webrtc/signaling/src/common/time_profiling',
'/media/webrtc/signaling/src/media',
'/media/webrtc/signaling/src/media-conduit',
'/media/webrtc/signaling/src/mediapipeline',
'/media/webrtc/signaling/src/peerconnection',
'/media/webrtc/signaling/src/sdp/sipcc',
'/media/webrtc/trunk',
'/media/webrtc/trunk/testing/gtest/include',
'/xpcom/base',
]
if CONFIG['OS_TARGET'] == 'Android':
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/android/include',
]
if CONFIG['OS_TARGET'] == 'Linux':
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/linux/include',
]
if CONFIG['OS_TARGET'] == 'Darwin':
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/darwin/include',
]
OS_LIBS += [
'-framework AudioToolbox',
'-framework AudioUnit',
'-framework Carbon',
'-framework CoreAudio',
'-framework OpenGL',
'-framework QTKit',
'-framework QuartzCore',
'-framework Security',
'-framework SystemConfiguration',
'-framework IOKit',
'-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
'-framework CoreUI',
]
if CONFIG['OS_TARGET'] in ('DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD'):
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/darwin/include',
'/media/mtransport/third_party/nrappkit/src/port/generic/include',
]
USE_LIBS += [
'/media/webrtc/trunk/testing/gtest_gtest/gtest',
'gkmedias',
'nksrtp_s',
'nss',
'webrtc',
'yuv',
'zlib',
]
if CONFIG['BUILD_ARM_NEON']:
USE_LIBS += [
'yuv_neon',
]
if CONFIG['JS_SHARED_LIBRARY']:
USE_LIBS += [
'js',
]
USE_LIBS += ['mozglue']
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
OS_LIBS += CONFIG['REALTIME_LIBS']
if CONFIG['MOZ_ALSA']:
OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
if CONFIG['MOZ_NATIVE_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
if CONFIG['MOZ_NATIVE_LIBVPX']:
OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
if not CONFIG['MOZ_TREE_PIXMAN']:
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
OS_LIBS += CONFIG['XLIBS']
OS_LIBS += CONFIG['MOZ_GTK2_LIBS']
OS_LIBS += [
'gmodule-2.0',
'gthread-2.0',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
OS_LIBS += CONFIG['MOZ_GTK3_LIBS']
USE_LIBS += [
'freetype',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
OS_LIBS += CONFIG['XLIBS']
OS_LIBS += CONFIG['TK_LIBS']
OS_LIBS += CONFIG['MOZ_PANGO_LIBS']
if CONFIG['OS_TARGET'] in ('Linux', 'DragonFly', 'FreeBSD', 'NetBSD',
'OpenBSD'):
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
if CONFIG['OS_TARGET'] == 'Darwin':
OS_LIBS += CONFIG['TK_LIBS']
FAIL_ON_WARNINGS = True

View File

@ -28,7 +28,7 @@
#include "signaling/src/jsep/JsepSessionImpl.h"
#include "signaling/src/jsep/JsepTrack.h"
#include "mtransport_test_utils.h"
#include "TestHarness.h"
namespace mozilla {
static const char* kCandidates[] = {

View File

@ -9,15 +9,145 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
'jsep_session_unittest',
'mediaconduit_unittests',
'mediapipeline_unittest',
'sdp_unittests',
'signaling_unittests',
'sdp_unittests',
'signaling_unittests',
])
include('/ipc/chromium/chromium-config.mozbuild')
include('common.build')
if CONFIG['OS_TARGET'] in ('Darwin', 'Android'):
DEFINES['GTEST_USE_OWN_TR1_TUPLE'] = 1
for var in ('USE_FAKE_MEDIA_STREAMS', 'USE_FAKE_PCOBSERVER',
'NR_SOCKET_IS_VOID_PTR', 'HAVE_STRDUP'):
DEFINES[var] = True
GENERATED_INCLUDES += [
'/dom/bindings',
]
LOCAL_INCLUDES += [
'/ipc/chromium/src',
'/media/mtransport',
'/media/mtransport/test',
'/media/mtransport/third_party/nICEr/src/ice',
'/media/mtransport/third_party/nICEr/src/net',
'/media/mtransport/third_party/nICEr/src/stun',
'/media/mtransport/third_party/nrappkit/src/event',
'/media/mtransport/third_party/nrappkit/src/log',
'/media/mtransport/third_party/nrappkit/src/plugin',
'/media/mtransport/third_party/nrappkit/src/registry',
'/media/mtransport/third_party/nrappkit/src/share',
'/media/mtransport/third_party/nrappkit/src/stats',
'/media/mtransport/third_party/nrappkit/src/util/libekr',
'/media/webrtc',
'/media/webrtc/signaling/src/common/browser_logging',
'/media/webrtc/signaling/src/common/time_profiling',
'/media/webrtc/signaling/src/media',
'/media/webrtc/signaling/src/media-conduit',
'/media/webrtc/signaling/src/mediapipeline',
'/media/webrtc/signaling/src/peerconnection',
'/media/webrtc/signaling/src/sdp/sipcc',
'/media/webrtc/trunk',
'/media/webrtc/trunk/testing/gtest/include',
'/xpcom/base',
]
if CONFIG['OS_TARGET'] == 'Android':
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/android/include',
]
if CONFIG['OS_TARGET'] == 'Linux':
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/linux/include',
]
if CONFIG['OS_TARGET'] == 'Darwin':
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/darwin/include',
]
OS_LIBS += [
'-framework AudioToolbox',
'-framework AudioUnit',
'-framework Carbon',
'-framework CoreAudio',
'-framework OpenGL',
'-framework QTKit',
'-framework QuartzCore',
'-framework Security',
'-framework SystemConfiguration',
'-framework IOKit',
'-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
'-framework CoreUI',
]
if CONFIG['OS_TARGET'] in ('DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD'):
LOCAL_INCLUDES += [
'/media/mtransport/third_party/nrappkit/src/port/darwin/include',
'/media/mtransport/third_party/nrappkit/src/port/generic/include',
]
USE_LIBS += [
'/media/webrtc/signalingtest/signaling_ecc/ecc',
'/media/webrtc/trunk/testing/gtest_gtest/gtest',
'gkmedias',
'mtransport_s',
'nksrtp_s',
'nss',
'webrtc',
'yuv',
'zlib',
]
if CONFIG['BUILD_ARM_NEON']:
USE_LIBS += [
'yuv_neon',
]
if CONFIG['JS_SHARED_LIBRARY']:
USE_LIBS += [
'js',
]
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
OS_LIBS += CONFIG['REALTIME_LIBS']
if CONFIG['MOZ_ALSA']:
OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
if CONFIG['MOZ_NATIVE_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
if CONFIG['MOZ_NATIVE_LIBVPX']:
OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
if not CONFIG['MOZ_TREE_PIXMAN']:
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
OS_LIBS += CONFIG['XLIBS']
OS_LIBS += CONFIG['MOZ_GTK2_LIBS']
OS_LIBS += [
'gmodule-2.0',
'gthread-2.0',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
OS_LIBS += CONFIG['MOZ_GTK3_LIBS']
USE_LIBS += [
'freetype',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
OS_LIBS += CONFIG['XLIBS']
OS_LIBS += CONFIG['TK_LIBS']
OS_LIBS += CONFIG['MOZ_PANGO_LIBS']
if CONFIG['OS_TARGET'] in ('Linux', 'DragonFly', 'FreeBSD', 'NetBSD',
'OpenBSD'):
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
if CONFIG['OS_TARGET'] == 'Darwin':
OS_LIBS += CONFIG['TK_LIBS']
FAIL_ON_WARNINGS = True

View File

@ -31,6 +31,8 @@
#include "mozilla/Services.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsNetUtil.h"
#include "nsIIOService.h"
#include "nsIDNSService.h"
#include "nsWeakReference.h"
#include "nricectx.h"
@ -2110,9 +2112,6 @@ public:
uint16_t stun_port_;
};
#if !defined(MOZILLA_XPCOMRT_API)
// FIXME XPCOMRT doesn't support nsPrefService
// See Bug 1129188 - Create standalone libpref for use in standalone WebRTC
static void SetIntPrefOnMainThread(nsCOMPtr<nsIPrefBranch> prefs,
const char *pref_name,
int new_value) {
@ -2162,7 +2161,6 @@ class FsFrPrefClearer {
private:
nsCOMPtr<nsIPrefBranch> mPrefs;
};
#endif // !defined(MOZILLA_XPCOMRT_API)
TEST_P(SignalingTest, JustInit)
{
@ -3910,10 +3908,6 @@ TEST_P(SignalingTest, hugeSdp)
a2_->CreateAnswer(OFFER_AV);
}
#if !defined(MOZILLA_XPCOMRT_API)
// FIXME XPCOMRT doesn't support nsPrefService
// See Bug 1129188 - Create standalone libpref for use in standalone WebRTC
// Test max_fs and max_fr prefs have proper impact on SDP offer
TEST_P(SignalingTest, MaxFsFrInOffer)
{
@ -4048,7 +4042,6 @@ TEST_P(SignalingTest, MaxFsFrCallerCodec)
ASSERT_EQ(video_conduit->SendingMaxFs(), (unsigned short) 600);
ASSERT_EQ(video_conduit->SendingMaxFr(), (unsigned short) 60);
}
#endif // !defined(MOZILLA_XPCOMRT_API)
// Validate offer with multiple video codecs
TEST_P(SignalingTest, ValidateMultipleVideoCodecsInOffer)

View File

@ -1,7 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "../jsep_session_unittest.cpp"

View File

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "../mediaconduit_unittests.cpp"

View File

@ -1,7 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
// Original author: ekr@rtfm.com
#include "../mediapipeline_unittest.cpp"

View File

@ -1,58 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Standalone WebRTC does not link on Android.
# See Bug 1127510 - Standalone WebRTC unit tests fail to link on Android
if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk' and CONFIG['OS_TARGET'] != 'Android':
CppUnitTests([
'jsep_session_unittest_standalone',
# mediaconduit_unittests disabled for standalone build until GMP support added.
# See Bug 1121677 - Enable GMP for WebRTC standalone.
# 'mediaconduit_unittests_standalone',
'mediapipeline_unittest_standalone',
'sdp_unittests_standalone',
'signaling_unittests_standalone',
])
include('/ipc/chromium/chromium-config.mozbuild')
include('../common.build')
for var in ('MOZILLA_INTERNAL_API', 'MOZILLA_XPCOMRT_API'):
DEFINES[var] = True
if CONFIG['OS_TARGET'] == 'Linux':
USE_LIBS += [
'static:/nsprpub/lib/libc/src/plc4',
]
OS_LIBS += [
'-lrt',
]
LOCAL_INCLUDES += [
'..',
'/xpcom/libxpcomrt',
]
USE_LIBS += [
'/media/webrtc/signalingstandalone/signaling_ecc/ecc',
'fallible',
'media_standalone',
'mfbt',
'mozglue',
'mtransport_standalone',
'necko_standalone',
'nspr',
'nss',
'unicharutil_standalone',
'xpcomrt',
]
if CONFIG['OS_TARGET'] == 'Android':
USE_LIBS += [
'freetype',
]
USE_LIBS += ['mozglue']

View File

@ -1,7 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "../sdp_unittests.cpp"

View File

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "../signaling_unittests.cpp"

View File

@ -61,7 +61,9 @@ DIRS += [
if CONFIG['MOZ_WEBRTC']:
DIRS += [
'/media/webrtc',
'/media/mtransport',
'/media/mtransport/third_party',
'/media/mtransport/build',
'/media/mtransport/standalone',
]
if CONFIG['MOZ_OMX_PLUGIN']:
@ -190,6 +192,5 @@ if CONFIG['ENABLE_TESTS']:
if CONFIG['MOZ_WEBRTC'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
DIRS += [
'/media/webrtc/signaling/test',
'/media/webrtc/signaling/test/standalone',
'/media/mtransport/test',
]

View File

@ -397,7 +397,6 @@ nsComponentManagerImpl::Init()
#if defined(MOZILLA_XPCOMRT_API)
RegisterModule(&kXPCOMRTModule, nullptr);
RegisterModule(&kNeckoStandaloneModule, nullptr);
RegisterModule(&kStunUDPSocketFilterHandlerModule, nullptr);
#else
RegisterModule(&kXPCOMModule, nullptr);
#endif // defined(MOZILLA_XPCOMRT_API)

View File

@ -70,7 +70,6 @@ extern const char staticComponentType[];
#if defined(MOZILLA_XPCOMRT_API)
extern const mozilla::Module kXPCOMRTModule;
extern const mozilla::Module kNeckoStandaloneModule;
extern const mozilla::Module kStunUDPSocketFilterHandlerModule;
#else
extern const mozilla::Module kXPCOMModule;
#endif