Bug 1389598 - Part 2: Remove gonk references from media/ r=jesup
authorEric Rahm <erahm@mozilla.com>
Fri, 11 Aug 2017 17:46:15 -0700
changeset 425165 4d161570009cb679d7df4d196578248b5f5cbfc1
parent 425164 9d605719172c32c2c8ebe995090e22cec74e2247
child 425166 69da38fcf84c9091473c4c501df11d6f6b9e0e60
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1389598
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1389598 - Part 2: Remove gonk references from media/ r=jesup
build/gyp.mozbuild
media/mtransport/common.build
media/mtransport/gonk_addrs.cpp
media/mtransport/third_party/nICEr/nicer.gyp
media/webrtc/signaling/signaling.gyp
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/trunk/build/common.gypi
media/webrtc/trunk/webrtc/common_audio/resampler/resampler.cc
media/webrtc/trunk/webrtc/modules/audio_device/gonk/audio_manager.cc
media/webrtc/trunk/webrtc/modules/audio_device/gonk/audio_manager.h
media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc
media/webrtc/trunk/webrtc/modules/video_capture/video_capture.h
media/webrtc/trunk/webrtc/system_wrappers/include/static_instance.h
media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features.cc
media/webrtc/trunk/webrtc/voice_engine/voice_engine_defines.h
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -55,17 +55,16 @@ gyp_vars.update({
     'use_glib': 1 if CONFIG['GLIB_LIBS'] else 0,
     # bug 1373485 - avoid pkg-config for gtk2 in webrtc
     'use_gtk': 0,
 
      # turn off mandatory use of NEON and instead use NEON detection
     'arm_neon': 0,
     'arm_neon_optional': 1,
 
-    'moz_widget_toolkit_gonk': 0,
     'moz_webrtc_omx': 0,
     'moz_webrtc_mediacodec': 0,
 
     # Turn off multi monitor screen share
     'multi_monitor_screenshare%' : 0,
 
     # (for vp8) chromium sets to 0 also
     'use_temporal_layers': 0,
--- a/media/mtransport/common.build
+++ b/media/mtransport/common.build
@@ -23,21 +23,16 @@ mtransport_lcppsrcs = [
     '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 = [
     '/media/mtransport/%s' % s for s in sorted(mtransport_lcppsrcs)
 ]
 
 LOCAL_INCLUDES += [
     '/media/mtransport/',
     '/media/mtransport/third_party/',
     '/media/mtransport/third_party/nICEr/src/crypto',
deleted file mode 100644
--- a/media/mtransport/gonk_addrs.cpp
+++ /dev/null
@@ -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;
-}
--- a/media/mtransport/third_party/nICEr/nicer.gyp
+++ b/media/mtransport/third_party/nICEr/nicer.gyp
@@ -2,17 +2,16 @@
 # 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/.
 #
 # nrappkit.gyp
 #
 #
 {
   'variables' : {
-    'build_with_gonk%': 0,
     'have_ethtool_cmd_speed_hi%': 1
   },
   'targets' : [
       {
           'target_name' : 'nicer',
           'type' : 'static_library',
 
           'include_dirs' : [
@@ -229,28 +228,16 @@
                  ],
 
 		 'include_dirs': [
 		     '../nrappkit/src/port/linux/include'
 		 ],
 
 		 'sources': [
 		 ],
-              }],
-              ['moz_widget_toolkit_gonk==1', {
-                'defines' : [
-                  'WEBRTC_GONK',
-                  'NO_REG_RPC',
-                ],
-             }],
-             # Gonk has its own nr_stun_get_addrs implementation.
-             ['build_with_gonk==1', {
-               'defines': [
-                  "USE_PLATFORM_NR_STUN_GET_ADDRS",
-               ]
              }],
              ['have_ethtool_cmd_speed_hi==0', {
                'defines': [
                   "DONT_HAVE_ETHTOOL_SPEED_HI",
                ]
              }]
           ],
       }]
--- a/media/webrtc/signaling/signaling.gyp
+++ b/media/webrtc/signaling/signaling.gyp
@@ -34,26 +34,16 @@
 # sip.gyp - a library for SIP
 #
 
 {
   'variables': {
     'chromium_code': 1,
   },
 
-  'target_defaults': {
-    'conditions': [
-      ['moz_widget_toolkit_gonk==1', {
-        'defines' : [
-          'WEBRTC_GONK',
-       ],
-      }],
-    ],
-  },
-
   'targets': [
 
     #
     # ECC
     #
     {
       'target_name': 'ecc',
       'type': 'static_library',
@@ -291,17 +281,17 @@
             'LINUX',
             'GIPS_VER=3510',
             'SECLIB_OPENSSL',
           ],
 
           'cflags_mozilla': [
           ],
         }],
-        ['OS=="android" or moz_widget_toolkit_gonk==1', {
+        ['OS=="android"', {
           'cflags_mozilla': [
             # This warning complains about important MOZ_EXPORT attributes
             # on forward declarations for Android API types.
             '-Wno-error=attributes',
           ],
         }],
         ['OS=="win"', {
           'include_dirs': [
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -2254,22 +2254,18 @@ JsepSessionImpl::SetupDefaultCodecs()
   // bandwidth (say <100Kbps), and if we're audio-only, down to 8 or
   // 12Kbps.
   mSupportedCodecs.values.push_back(new JsepAudioCodecDescription(
       "109",
       "opus",
       48000,
       2,
       960,
-#ifdef WEBRTC_GONK
       // TODO Move this elsewhere to be adaptive to rate - Bug 1207925
-      16000 // B2G uses lower capture sampling rate
-#else
       40000
-#endif
       ));
 
   mSupportedCodecs.values.push_back(new JsepAudioCodecDescription(
       "9",
       "G722",
       8000,
       1,
       320,
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -20,20 +20,16 @@
 #include "ImageTypes.h"
 #include "ImageContainer.h"
 #include "DOMMediaStream.h"
 #include "MediaStreamTrack.h"
 #include "MediaStreamListener.h"
 #include "MediaStreamVideoSink.h"
 #include "VideoUtils.h"
 #include "VideoStreamTrack.h"
-#ifdef WEBRTC_GONK
-#include "GrallocImages.h"
-#include "mozilla/layers/GrallocTextureClient.h"
-#endif
 
 #include "nsError.h"
 #include "AudioSegment.h"
 #include "MediaSegment.h"
 #include "MediaPipelineFilter.h"
 #include "RtpLogger.h"
 #include "databuffer.h"
 #include "transportflow.h"
--- a/media/webrtc/trunk/build/common.gypi
+++ b/media/webrtc/trunk/build/common.gypi
@@ -423,17 +423,17 @@
         # NSS usage.
         ['(OS=="linux" or OS=="solaris" or os_bsd==1) and use_openssl==0', {
           'use_nss%': 1,
         }, {
           'use_nss%': 0,
         }],
 
         # Flags to use X11 on non-Mac POSIX platforms
-        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or moz_widget_toolkit_gonk==1', {
+        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
           'use_glib%': 0,
           'use_x11%': 0,
         }, {
           'use_glib%': 1,
           'use_x11%': 1,
         }],
 
         # We always use skia text rendering in Aura on Windows, since GDI
--- a/media/webrtc/trunk/webrtc/common_audio/resampler/resampler.cc
+++ b/media/webrtc/trunk/webrtc/common_audio/resampler/resampler.cc
@@ -18,17 +18,17 @@
 #include <assert.h>
 
 #include "webrtc/common_audio/resampler/include/resampler.h"
 #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
 
 // TODO(jesup) better adjust per platform ability
 // Note: if these are changed (higher), you may need to change the
 // KernelDelay values in the unit tests here and in output_mixer.
-#if defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK)
+#if defined(WEBRTC_ANDROID)
 #define RESAMPLER_QUALITY 2
 #else
 #define RESAMPLER_QUALITY 3
 #endif
 
 namespace webrtc {
 
 Resampler::Resampler() : state_(NULL), channels_(0)
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/audio_device/gonk/audio_manager.cc
+++ /dev/null
@@ -1,1 +0,0 @@
-#include "../android/audio_manager.cc"
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/audio_device/gonk/audio_manager.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef WEBRTC_MODULES_AUDIO_DEVICE_GONK_AUDIO_MANAGER_H_
-#define WEBRTC_MODULES_AUDIO_DEVICE_GONK_AUDIO_MANAGER_H_
-
-#include "../android/audio_manager.h"
-
-#endif
--- a/media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc
@@ -24,17 +24,17 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.h"
 
 namespace webrtc_adm_linux_pulse {
 
-#if defined(__OpenBSD__) || defined(WEBRTC_GONK)
+#if defined(__OpenBSD__)
 LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so")
 #else
 LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so.0")
 #endif
 #define X(sym) \
     LATE_BINDING_SYMBOL_TABLE_DEFINE_ENTRY(PulseAudioSymbolTable, sym)
 PULSE_AUDIO_SYMBOLS_LIST
 #undef X
--- a/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.h
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.h
@@ -12,17 +12,17 @@
 #define WEBRTC_MODULES_VIDEO_CAPTURE_VIDEO_CAPTURE_H_
 
 #include "webrtc/modules/audio_processing/include/config.h"
 #include "webrtc/api/video/video_rotation.h"
 #include "webrtc/media/base/videosinkinterface.h"
 #include "webrtc/modules/include/module.h"
 #include "webrtc/modules/video_capture/video_capture_defines.h"
 
-#if defined(ANDROID) && !defined(WEBRTC_GONK)
+#if defined(ANDROID)
 #include <jni.h>
 #endif
 
 namespace webrtc {
 
 // Mozilla addition
 enum class CaptureDeviceType {
   Camera = 0,
--- a/media/webrtc/trunk/webrtc/system_wrappers/include/static_instance.h
+++ b/media/webrtc/trunk/webrtc/system_wrappers/include/static_instance.h
@@ -8,17 +8,17 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STATIC_INSTANCE_H_
 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STATIC_INSTANCE_H_
 
 #include <assert.h>
 
-#if defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK)
+#if defined(WEBRTC_ANDROID)
 #define OS_LINUX
 #endif
 #include "base/singleton.h"
 
 namespace webrtc {
 
 enum CountOperation {
   kRelease,
--- a/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features.cc
+++ b/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features.cc
@@ -62,24 +62,24 @@ static int GetCPUInfo(CPUFeature feature
 }
 #else
 // Default to straight C for other platforms.
 static int GetCPUInfo(CPUFeature feature) {
   (void)feature;
   return 0;
 }
 
-#if !defined(WEBRTC_GONK) && !defined(ANDROID)
+#if !defined(ANDROID)
 #ifdef WEBRTC_ARCH_ARM_V7
 uint64_t WebRtc_GetCPUFeaturesARM(void) {
   return kCPUFeatureARMv7
 #ifdef WEBRTC_ARCH_ARM_NEON
          | kCPUFeatureNEON
 #endif
          | kCPUFeatureVFPv3;
 }
 #endif // WEBRTC_ARCH_ARM_V7
-#endif // !WEBRTC_GONK && !ANDROID
+#endif // !ANDROID
 
 #endif
 
 WebRtc_CPUInfo WebRtc_GetCPUInfo = GetCPUInfo;
 WebRtc_CPUInfo WebRtc_GetCPUInfoNoASM = GetCPUInfoNoASM;
--- a/media/webrtc/trunk/webrtc/voice_engine/voice_engine_defines.h
+++ b/media/webrtc/trunk/webrtc/voice_engine/voice_engine_defines.h
@@ -55,23 +55,23 @@ enum { kMinTelephoneEventSeparationMs = 
                                                    // telephone events
 enum { kVoiceEngineMaxIpPacketSizeBytes = 1500 };  // assumes Ethernet
 
 enum { kVoiceEngineMaxModuleVersionSize = 960 };
 
 // Audio processing
 const NoiseSuppression::Level kDefaultNsMode = NoiseSuppression::kModerate;
 const GainControl::Mode kDefaultAgcMode =
-#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_GONK)
+#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
     GainControl::kAdaptiveDigital;
 #else
     GainControl::kAdaptiveAnalog;
 #endif
 const bool kDefaultAgcState =
-#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_GONK)
+#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
     false;
 #else
     true;
 #endif
 const GainControl::Mode kDefaultRxAgcMode = GainControl::kAdaptiveDigital;
 
 // Codec
 // Min init target rate for iSAC-wb