Bug 880419: rollup of existing modifications to libyuv rs=jesup
authorRandell Jesup <rjesup@jesup.org>
Thu, 16 Jan 2014 17:08:01 -0500
changeset 166821 ad4829ac770a3964e71935678a067f1c98b671e6
parent 166820 aaf73bfa3900c3d7d9577fb5b2474e005d251ffd
child 166822 ccee696962b99445e37c32c94aff0267ab47caa6
push id39295
push userrjesup@wgate.com
push dateTue, 04 Feb 2014 21:09:53 +0000
treeherdermozilla-inbound@326a283714a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs880419
milestone30.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 880419: rollup of existing modifications to libyuv rs=jesup
build/gyp.mozbuild
media/webrtc/trunk/build/common.gypi
media/webrtc/trunk/third_party/libyuv/include/libyuv/basic_types.h
media/webrtc/trunk/third_party/libyuv/libyuv.gyp
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -90,16 +90,18 @@ if CONFIG['ARM_ARCH']:
     if int(CONFIG['ARM_ARCH']) < 7:
         gyp_vars['armv7'] = 0
     elif os == 'Android':
         gyp_vars['armv7'] = 1
     else:
         # CPU detection for ARM works on Android only.  armv7 always uses CPU
         # detection, so we have to set armv7=0 for non-Android target
         gyp_vars['armv7'] = 0
+    # For libyuv
+    gyp_vars['arm_version'] = CONFIG['ARM_ARCH']
 
 # Don't try to compile ssse3/sse4.1 code if toolchain doesn't support
 if CONFIG['INTEL_ARCHITECTURE']:
     if not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] or not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1']:
         gyp_vars['yuv_disable_asm'] = 1
 
 if CONFIG['MACOS_SDK_DIR']:
     gyp_vars['mac_sdk_path'] = CONFIG['MACOS_SDK_DIR']
--- a/media/webrtc/trunk/build/common.gypi
+++ b/media/webrtc/trunk/build/common.gypi
@@ -191,21 +191,25 @@
       'dcheck_always_on%': 0,
 
       # Disable file manager component extension by default.
       'file_manager_extension%': 0,
 
       # Python version.
       'python_ver%': '2.6',
 
+      # Set ARM version (for libyuv)
+      'arm_version%': 6,
+
       # Set ARM-v7 compilation flags
       'armv7%': 0,
 
       # Set Neon compilation flags (only meaningful if armv7==1).
       'arm_neon%': 1,
+      'arm_neon_optional%': 0,
 
       # The system root for cross-compiles. Default: none.
       'sysroot%': '',
 
       # The system libdir used for this ABI.
       'system_libdir%': 'lib',
 
       # On Linux, we build with sse2 for Chromium builds.
@@ -617,18 +621,20 @@
     'enable_hidpi%': '<(enable_hidpi)',
     'enable_touch_ui%': '<(enable_touch_ui)',
     'use_xi2_mt%':'<(use_xi2_mt)',
     'file_manager_extension%': '<(file_manager_extension)',
     'inside_chromium_build%': '<(inside_chromium_build)',
     'fastbuild%': '<(fastbuild)',
     'dcheck_always_on%': '<(dcheck_always_on)',
     'python_ver%': '<(python_ver)',
+    'arm_version%': '<(arm_version)',
     'armv7%': '<(armv7)',
     'arm_neon%': '<(arm_neon)',
+    'arm_neon_optional%': '<(arm_neon_optional)',
     'sysroot%': '<(sysroot)',
     'system_libdir%': '<(system_libdir)',
     'component%': '<(component)',
     'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
     'use_third_party_translations%': '<(use_third_party_translations)',
     'remoting%': '<(remoting)',
     'enable_one_click_signin%': '<(enable_one_click_signin)',
     'enable_webrtc%': '<(enable_webrtc)',
--- a/media/webrtc/trunk/third_party/libyuv/include/libyuv/basic_types.h
+++ b/media/webrtc/trunk/third_party/libyuv/include/libyuv/basic_types.h
@@ -8,22 +8,36 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
 #ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_  // NOLINT
 #define INCLUDE_LIBYUV_BASIC_TYPES_H_
 
 #include <stddef.h>  // for NULL, size_t
 
-#if defined(__ANDROID__) || (defined(_MSC_VER) && (_MSC_VER < 1600))
-#include <sys/types.h>  // for uintptr_t on x86
-#else
+#if !(defined(_MSC_VER) && (_MSC_VER < 1600))
 #include <stdint.h>  // for uintptr_t
 #endif
 
+typedef uint64_t uint64;
+typedef int64_t  int64;
+#if defined(_MSC_VER)
+// nsprpub/pr/include/obsolete/protypes.h defines these weirdly
+typedef long int32;
+typedef unsigned long uint32;
+#else
+typedef uint32_t uint32;
+typedef int32_t  int32;
+#endif
+typedef uint16_t uint16;
+typedef int16_t  int16;
+typedef uint8_t  uint8;
+typedef int8_t   int8;
+#define INT_TYPES_DEFINED 1
+
 #ifndef GG_LONGLONG
 #ifndef INT_TYPES_DEFINED
 #define INT_TYPES_DEFINED
 #ifdef COMPILER_MSVC
 typedef unsigned __int64 uint64;
 typedef __int64 int64;
 #ifndef INT64_C
 #define INT64_C(x) x ## I64
--- a/media/webrtc/trunk/third_party/libyuv/libyuv.gyp
+++ b/media/webrtc/trunk/third_party/libyuv/libyuv.gyp
@@ -7,16 +7,17 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 {
   'includes': [
     'libyuv.gypi',
   ],
   'variables': {
     'use_system_libjpeg%': 0,
+    'yuv_disable_asm%': 0,
     'build_neon': 0,
     'conditions': [
        ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
          'build_neon': 1,
        }],
     ],
   },
   'conditions': [
@@ -62,20 +63,20 @@
     }],
   ],
   'targets': [
     {
       'target_name': 'libyuv',
       # Change type to 'shared_library' to build .so or .dll files.
       'type': 'static_library',
       # Allows libyuv.a redistributable library without external dependencies.
-      'standalone_static_library': 1,
+      # 'standalone_static_library': 1,
       'conditions': [
         # TODO(fbarchard): Use gyp define to enable jpeg.
-        [ 'OS != "ios"', {
+        [ 'OS != "ios" and build_with_mozilla!=1', {
           'defines': [
             'HAVE_JPEG'
           ],
           'conditions': [
             # Android uses libjpeg for system jpeg support.
             [ 'OS == "android" and use_system_libjpeg == 1', {
               'dependencies': [
                  '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg',
@@ -97,16 +98,34 @@
         [ 'build_neon != 0', {
           'dependencies': [
             'libyuv_neon',
           ],
           'defines': [
             'LIBYUV_NEON',
           ]
         }],
+        [ 'yuv_disable_asm!=0', {
+          'defines': [
+            # Enable the following 3 macros to turn off assembly for specified CPU.
+            'LIBYUV_DISABLE_X86',
+            'LIBYUV_DISABLE_NEON',
+            'LIBYUV_DISABLE_MIPS',
+          ],
+        }],
+        ['build_with_mozilla==1', {
+          'include_dirs': [
+            '$(DEPTH)/dist/include',
+          ],
+          'direct_dependent_settings': {
+            'include_dirs': [
+              '$(DEPTH)/dist/include',
+            ],
+          },
+        }],
       ],
       'defines': [
         # Enable the following 3 macros to turn off assembly for specified CPU.
         # 'LIBYUV_DISABLE_X86',
         # 'LIBYUV_DISABLE_NEON',
         # 'LIBYUV_DISABLE_MIPS',
         # Enable the following macro to build libyuv as a shared library (dll).
         # 'LIBYUV_USING_SHARED_LIBRARY',