Remove other gonk widget conditionals and unused files.

Tag #288.
This commit is contained in:
wolfbeast 2018-05-13 22:46:04 +02:00 • committed by Roy Tam
commit 74df182488
232 changed files with 256 additions and 36730 deletions

View file

@ -29,8 +29,6 @@ if CONFIG['MOZ_PULSEAUDIO']:
'cubeb_pulse.c',
]
DEFINES['USE_PULSE'] = True
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
DEFINES['DISABLE_LIBPULSE_DLOPEN'] = True
if CONFIG['MOZ_JACK']:
SOURCES += [
@ -73,24 +71,13 @@ if CONFIG['OS_TARGET'] == 'Android':
SOURCES += ['cubeb_opensl.c']
SOURCES += ['cubeb_resampler.cpp']
DEFINES['USE_OPENSL'] = True
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
SOURCES += [
'cubeb_audiotrack.c',
]
DEFINES['USE_AUDIOTRACK'] = True
SOURCES += [
'cubeb_audiotrack.c',
]
DEFINES['USE_AUDIOTRACK'] = True
FINAL_LIBRARY = 'gkmedias'
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
if CONFIG['ANDROID_VERSION'] >= '17':
LOCAL_INCLUDES += [
'%' + '%s/frameworks/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
]
else:
LOCAL_INCLUDES += [
'%' + '%s/system/media/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
]
CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']

View file

@ -27,11 +27,6 @@ mtransport_lcppsrcs = [
'transportlayerprsock.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
mtransport_lcppsrcs += [
'gonk_addrs.cpp',
]
mtransport_cppsrcs = [
'/media/mtransport/%s' % s for s in sorted(mtransport_lcppsrcs)
]

View file

@ -1,170 +0,0 @@
/* -*- Mode: C++; tab-width: 2; 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/. */
extern "C" {
#include <arpa/inet.h>
#include "r_types.h"
#include "stun.h"
#include "addrs.h"
}
#include <vector>
#include <string>
#include "nsINetworkInterface.h"
#include "nsINetworkInterfaceListService.h"
#include "runnable_utils.h"
#include "nsCOMPtr.h"
#include "nsMemory.h"
#include "nsThreadUtils.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/SyncRunnable.h"
namespace {
struct NetworkInterface {
struct sockaddr_in addr;
std::string name;
// See NR_INTERFACE_TYPE_* in nICEr/src/net/local_addrs.h
int type;
};
nsresult
GetInterfaces(std::vector<NetworkInterface>* aInterfaces)
{
MOZ_ASSERT(aInterfaces);
// Obtain network interfaces from network manager.
nsresult rv;
nsCOMPtr<nsINetworkInterfaceListService> listService =
do_GetService("@mozilla.org/network/interface-list-service;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
int32_t flags =
nsINetworkInterfaceListService::LIST_NOT_INCLUDE_SUPL_INTERFACES |
nsINetworkInterfaceListService::LIST_NOT_INCLUDE_MMS_INTERFACES |
nsINetworkInterfaceListService::LIST_NOT_INCLUDE_IMS_INTERFACES |
nsINetworkInterfaceListService::LIST_NOT_INCLUDE_DUN_INTERFACES |
nsINetworkInterfaceListService::LIST_NOT_INCLUDE_FOTA_INTERFACES;
nsCOMPtr<nsINetworkInterfaceList> networkList;
NS_ENSURE_SUCCESS(listService->GetDataInterfaceList(flags,
getter_AddRefs(networkList)),
NS_ERROR_FAILURE);
// Translate nsINetworkInterfaceList to NetworkInterface.
int32_t listLength;
NS_ENSURE_SUCCESS(networkList->GetNumberOfInterface(&listLength),
NS_ERROR_FAILURE);
aInterfaces->clear();
for (int32_t i = 0; i < listLength; i++) {
nsCOMPtr<nsINetworkInfo> info;
if (NS_FAILED(networkList->GetInterfaceInfo(i, getter_AddRefs(info)))) {
continue;
}
char16_t **ips = nullptr;
uint32_t *prefixs = nullptr;
uint32_t count = 0;
bool isAddressGot = false;
NetworkInterface interface;
memset(&(interface.addr), 0, sizeof(interface.addr));
interface.addr.sin_family = AF_INET;
if (NS_FAILED(info->GetAddresses(&ips, &prefixs, &count))) {
continue;
}
for (uint32_t j = 0; j < count; j++) {
nsAutoString ip;
ip.Assign(ips[j]);
if (inet_pton(AF_INET, NS_ConvertUTF16toUTF8(ip).get(),
&(interface.addr.sin_addr.s_addr)) == 1) {
isAddressGot = true;
break;
}
}
free(prefixs);
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, ips);
if (!isAddressGot) {
continue;
}
nsAutoString ifaceName;
if (NS_FAILED(info->GetName(ifaceName))) {
continue;
}
interface.name = NS_ConvertUTF16toUTF8(ifaceName).get();
int32_t type;
if (NS_FAILED(info->GetType(&type))) {
continue;
}
switch (type) {
case nsINetworkInfo::NETWORK_TYPE_WIFI:
interface.type = NR_INTERFACE_TYPE_WIFI;
break;
case nsINetworkInfo::NETWORK_TYPE_MOBILE:
interface.type = NR_INTERFACE_TYPE_MOBILE;
break;
}
aInterfaces->push_back(interface);
}
return NS_OK;
}
} // anonymous namespace
int
nr_stun_get_addrs(nr_local_addr aAddrs[], int aMaxAddrs,
int aDropLoopback, int aDropLinkLocal, int* aCount)
{
nsresult rv;
int r;
// Get network interface list.
std::vector<NetworkInterface> interfaces;
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
mozilla::SyncRunnable::DispatchToThread(
mainThread.get(),
mozilla::WrapRunnableNMRet(&rv, &GetInterfaces, &interfaces),
false);
if (NS_FAILED(rv)) {
return R_FAILED;
}
// Translate to nr_transport_addr.
int32_t n = 0;
size_t num_interface = std::min(interfaces.size(), (size_t)aMaxAddrs);
for (size_t i = 0; i < num_interface; ++i) {
NetworkInterface &interface = interfaces[i];
if (nr_sockaddr_to_transport_addr((sockaddr*)&(interface.addr),
IPPROTO_UDP, 0, &(aAddrs[n].addr))) {
r_log(NR_LOG_STUN, LOG_WARNING, "Problem transforming address");
return R_FAILED;
}
strlcpy(aAddrs[n].addr.ifname, interface.name.c_str(),
sizeof(aAddrs[n].addr.ifname));
aAddrs[n].interface.type = interface.type;
aAddrs[n].interface.estimated_speed = 0;
n++;
}
*aCount = n;
r = nr_stun_remove_duplicate_addrs(aAddrs, aDropLoopback, aDropLinkLocal, aCount);
if (r != 0) {
return r;
}
for (int i = 0; i < *aCount; ++i) {
char typestr[100];
nr_local_addr_fmt_info_string(aAddrs + i, typestr, sizeof(typestr));
r_log(NR_LOG_STUN, LOG_DEBUG, "Address %d: %s on %s, type: %s\n",
i, aAddrs[i].addr.as_string, aAddrs[i].addr.ifname, typestr);
}
return 0;
}

View file

@ -4,7 +4,7 @@
# 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'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
if CONFIG['OS_TARGET'] != 'WINNT':
SOURCES += [
'buffered_stun_socket_unittest.cpp',
'ice_unittest.cpp',

View file

@ -5,14 +5,13 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIST_INSTALL = False
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
SOURCES += [
'libstagefright.cpp',
]
# Some codec-related code uses multi-character constants; allow this.
# XXX: could instead use the FOURCC macro to define these constants.
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
SOURCES['libstagefright.cpp'].flags += ['-Wno-error=multichar']
SOURCES += [
'libstagefright.cpp',
]
# Some codec-related code uses multi-character constants; allow this.
# XXX: could instead use the FOURCC macro to define these constants.
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
SOURCES['libstagefright.cpp'].flags += ['-Wno-error=multichar']
SharedLibrary('stagefright')

View file

@ -5,10 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIST_INSTALL = False
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
SOURCES += [
'libutils.cpp',
]
SOURCES += [
'libutils.cpp',
]
SharedLibrary('utils')

View file

@ -5,10 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIST_INSTALL = False
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
SOURCES += [
'libvideoeditorplayer.cpp',
]
SOURCES += [
'libvideoeditorplayer.cpp',
]
SharedLibrary('videoeditorplayer')

View file

@ -20,13 +20,10 @@ SOURCES += [
SharedLibrary('omxplugin')
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
pass
else:
LOCAL_INCLUDES += [
'include/ics',
'include/ics/media/stagefright/openmax',
]
LOCAL_INCLUDES += [
'include/ics',
'include/ics/media/stagefright/openmax',
]
if CONFIG['GNU_CXX']:
# Stagefright header files define many multichar constants.
@ -35,23 +32,11 @@ if CONFIG['GNU_CXX']:
'-Wno-shadow',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
EXTRA_DSO_LDOPTS += [
'-lutils',
'-lstagefright',
'-lmedia',
'-lstagefright_omx',
'-lbinder',
'-lui',
'-lhardware',
'-lcutils',
]
else:
USE_LIBS += [
'/media/omx-plugin/lib/ics/libstagefright/stagefright',
'/media/omx-plugin/lib/ics/libutils/utils',
'videoeditorplayer',
]
USE_LIBS += [
'/media/omx-plugin/lib/ics/libstagefright/stagefright',
'/media/omx-plugin/lib/ics/libutils/utils',
'videoeditorplayer',
]
# Don't use STL wrappers; this isn't Gecko code
DISABLE_STL_WRAPPING = True

View file

@ -101,22 +101,21 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
else:
CXXFLAGS += ['-validate-charset-']
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
GYP_DIRS += ['trunk/testing']
GYP_DIRS['trunk/testing'].input = 'trunk/testing/gtest.gyp'
GYP_DIRS['trunk/testing'].variables = gyp_vars
# We allow warnings for third-party code that can be updated from upstream.
GYP_DIRS['trunk/testing'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
GYP_DIRS['trunk/testing'].non_unified_sources += webrtc_non_unified_sources
GYP_DIRS += ['trunk/testing']
GYP_DIRS['trunk/testing'].input = 'trunk/testing/gtest.gyp'
GYP_DIRS['trunk/testing'].variables = gyp_vars
# We allow warnings for third-party code that can be updated from upstream.
GYP_DIRS['trunk/testing'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
GYP_DIRS['trunk/testing'].non_unified_sources += webrtc_non_unified_sources
if CONFIG['MOZ_WEBRTC_SIGNALING']:
GYP_DIRS += ['signalingtest']
GYP_DIRS['signalingtest'].input = 'signaling/signaling.gyp'
GYP_DIRS['signalingtest'].variables = gyp_vars.copy()
GYP_DIRS['signalingtest'].variables.update(
build_for_test=1,
moz_webrtc_mediacodec=0,
build_for_standalone=0
)
GYP_DIRS['signalingtest'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
GYP_DIRS['signalingtest'].non_unified_sources += signaling_non_unified_sources
if CONFIG['MOZ_WEBRTC_SIGNALING']:
GYP_DIRS += ['signalingtest']
GYP_DIRS['signalingtest'].input = 'signaling/signaling.gyp'
GYP_DIRS['signalingtest'].variables = gyp_vars.copy()
GYP_DIRS['signalingtest'].variables.update(
build_for_test=1,
moz_webrtc_mediacodec=0,
build_for_standalone=0
)
GYP_DIRS['signalingtest'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
GYP_DIRS['signalingtest'].non_unified_sources += signaling_non_unified_sources

View file

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# TODO: bug 1172551 - get these tests working on iOS
if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'uikit':
if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'uikit':
GeckoCppUnitTests([
'jsep_session_unittest',
'jsep_track_unittest',