summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--recipes/gst-plugins-bad-1.0-static.recipe4
-rw-r--r--recipes/gst-plugins-bad-1.0.recipe4
-rw-r--r--recipes/webrtc-audio-processing.recipe51
-rw-r--r--recipes/webrtc-audio-processing/0000-Add-fix_interlocked_exchange_pointer_win.h.patch59
-rw-r--r--recipes/webrtc-audio-processing/0000-Add-sal.h-as-it-s-missing-in-cerbero-mingw.patch230
-rw-r--r--recipes/webrtc-audio-processing/0001-build-enforce-linking-with-no-undefined-add-explicit.patch41
-rw-r--r--recipes/webrtc-audio-processing/0002-build-Make-sure-files-with-SSE2-code-are-compiled-wi.patch66
-rw-r--r--recipes/webrtc-audio-processing/0003-Don-t-include-execinfo.h-for-windows.patch39
-rw-r--r--recipes/webrtc-audio-processing/0004-Don-t-use-MSVC-specific-exception-handler-for-MINGW.patch31
-rw-r--r--recipes/webrtc-audio-processing/0005-Add-missing-throw-in-destructor-override.patch30
-rw-r--r--recipes/webrtc-audio-processing/0006-lrint-is-available-with-mingw.patch31
-rw-r--r--recipes/webrtc-audio-processing/0007-Fix-case-sensitivity-issue-with-MinGW-cross-build.patch42
-rw-r--r--recipes/webrtc-audio-processing/0008-Add-missing-windows-specific-headers.patch123
-rw-r--r--recipes/webrtc-audio-processing/0009-Fix-build-on-win64.patch30
-rw-r--r--recipes/webrtc-audio-processing/0010-Add-cerbero-gnustl-support-for-Android.patch62
-rw-r--r--recipes/webrtc-audio-processing/0011-Disable-backtrace-on-android.patch37
-rw-r--r--recipes/webrtc-audio-processing/0012-Don-t-blindly-link-to-pthread.patch29
-rw-r--r--recipes/webrtc-audio-processing/0013-Add-required-define-for-Windows.patch33
-rw-r--r--recipes/webrtc-audio-processing/0014-Properly-select-the-right-system-wrappers.patch80
-rw-r--r--recipes/webrtc-audio-processing/0015-Fix-case-sensitivity-in-windows-include.patch43
-rw-r--r--recipes/webrtc-audio-processing/0016-Define-MSVC-_WIN32-so-we-can-build-on-mingw.patch26
-rw-r--r--recipes/webrtc-audio-processing/0017-Add-missing-windows-conditions-variable.patch616
-rw-r--r--recipes/webrtc-audio-processing/0018-Protect-against-unsupported-CPU-types.patch37
-rw-r--r--recipes/webrtc-audio-processing/0019-osx-Fix-type-OS_FLAGS-instead-of-OS_CFLAGS.patch27
-rw-r--r--recipes/webrtc-audio-processing/0020-Sync-defines-and-libs-with-build.gn.patch75
-rw-r--r--recipes/webrtc-audio-processing/0021-Use-no-undefined-to-support-both-clang-and-gcc.patch25
-rw-r--r--recipes/webrtc-audio-processing/0022-Re-add-pthread-linking-on-linux.patch25
-rw-r--r--recipes/webrtc-audio-processing/0023-Add-ARM-64bit-support.patch28
28 files changed, 1922 insertions, 2 deletions
diff --git a/recipes/gst-plugins-bad-1.0-static.recipe b/recipes/gst-plugins-bad-1.0-static.recipe
index 1e44b3b..6fac7fe 100644
--- a/recipes/gst-plugins-bad-1.0-static.recipe
+++ b/recipes/gst-plugins-bad-1.0-static.recipe
@@ -23,7 +23,8 @@ class Recipe(custom.GStreamerStatic):
deps = ['gstreamer-1.0', 'gst-plugins-base-1.0', 'bzip2', 'libass',
'faad2', 'libkate', 'zlib', 'openh264', 'opus', 'nettle', 'librtmp',
'libsrtp', 'schroedinger', 'libdca', 'libmms', 'libdvdnav',
- 'soundtouch', 'vo-aacenc', 'librsvg', 'openjpeg', 'graphene', 'spandsp']
+ 'soundtouch', 'vo-aacenc', 'librsvg', 'openjpeg', 'graphene',
+ 'spandsp', 'webrtc-audio-processing']
use_system_libs = True
files_plugins_effects_devel = [
@@ -51,6 +52,7 @@ class Recipe(custom.GStreamerStatic):
'libgstvideofiltersbad',
'libgstaudiomixer',
'libgstcompositor',
+ 'libgstwebrtcdsp',
]
files_plugins_codecs_devel = [
diff --git a/recipes/gst-plugins-bad-1.0.recipe b/recipes/gst-plugins-bad-1.0.recipe
index 48e091a..6912310 100644
--- a/recipes/gst-plugins-bad-1.0.recipe
+++ b/recipes/gst-plugins-bad-1.0.recipe
@@ -30,7 +30,8 @@ class Recipe(recipe.Recipe):
deps = ['gstreamer-1.0', 'gst-plugins-base-1.0', 'bzip2', 'libass',
'faad2', 'libkate', 'zlib', 'openh264', 'opus', 'nettle', 'librtmp',
'libsrtp', 'schroedinger', 'libdca', 'libmms', 'libdvdnav',
- 'soundtouch', 'vo-aacenc', 'librsvg', 'openjpeg', 'graphene', 'spandsp']
+ 'soundtouch', 'vo-aacenc', 'librsvg', 'openjpeg', 'graphene',
+ 'spandsp', 'webrtc-audio-processing']
use_system_libs = True
files_lang = ['gst-plugins-bad-1.0']
@@ -90,6 +91,7 @@ class Recipe(recipe.Recipe):
'lib/gstreamer-1.0/libgstvideofiltersbad%(mext)s',
'lib/gstreamer-1.0/libgstaudiomixer%(mext)s',
'lib/gstreamer-1.0/libgstcompositor%(mext)s',
+ 'lib/gstreamer-1.0/libgstwebrtcdsp%(mext)s',
]
files_plugins_codecs = [
diff --git a/recipes/webrtc-audio-processing.recipe b/recipes/webrtc-audio-processing.recipe
new file mode 100644
index 0000000..a3c20dc
--- /dev/null
+++ b/recipes/webrtc-audio-processing.recipe
@@ -0,0 +1,51 @@
+# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
+
+class Recipe(recipe.Recipe):
+ name = 'webrtc-audio-processing'
+ version = '0.2'
+ licenses = [License.BSD_like]
+ stype = SourceType.TARBALL
+ url = 'http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/{0}-{1}.tar.xz'.format(name, version)
+
+ platform_deps = {Platform.ANDROID: ['gnustl']}
+
+ patches = [ 'webrtc-audio-processing/0000-Add-sal.h-as-it-s-missing-in-cerbero-mingw.patch',
+ 'webrtc-audio-processing/0000-Add-fix_interlocked_exchange_pointer_win.h.patch',
+ 'webrtc-audio-processing/0001-build-enforce-linking-with-no-undefined-add-explicit.patch',
+ 'webrtc-audio-processing/0002-build-Make-sure-files-with-SSE2-code-are-compiled-wi.patch',
+ 'webrtc-audio-processing/0003-Don-t-include-execinfo.h-for-windows.patch',
+ 'webrtc-audio-processing/0004-Don-t-use-MSVC-specific-exception-handler-for-MINGW.patch',
+ 'webrtc-audio-processing/0005-Add-missing-throw-in-destructor-override.patch',
+ 'webrtc-audio-processing/0006-lrint-is-available-with-mingw.patch',
+ 'webrtc-audio-processing/0007-Fix-case-sensitivity-issue-with-MinGW-cross-build.patch',
+ 'webrtc-audio-processing/0008-Add-missing-windows-specific-headers.patch',
+ 'webrtc-audio-processing/0009-Fix-build-on-win64.patch',
+ 'webrtc-audio-processing/0010-Add-cerbero-gnustl-support-for-Android.patch',
+ 'webrtc-audio-processing/0011-Disable-backtrace-on-android.patch',
+ 'webrtc-audio-processing/0012-Don-t-blindly-link-to-pthread.patch',
+ 'webrtc-audio-processing/0013-Add-required-define-for-Windows.patch',
+ 'webrtc-audio-processing/0014-Properly-select-the-right-system-wrappers.patch',
+ 'webrtc-audio-processing/0015-Fix-case-sensitivity-in-windows-include.patch',
+ 'webrtc-audio-processing/0016-Define-MSVC-_WIN32-so-we-can-build-on-mingw.patch',
+ 'webrtc-audio-processing/0017-Add-missing-windows-conditions-variable.patch',
+ 'webrtc-audio-processing/0018-Protect-against-unsupported-CPU-types.patch',
+ 'webrtc-audio-processing/0019-osx-Fix-type-OS_FLAGS-instead-of-OS_CFLAGS.patch',
+ 'webrtc-audio-processing/0020-Sync-defines-and-libs-with-build.gn.patch',
+ 'webrtc-audio-processing/0021-Use-no-undefined-to-support-both-clang-and-gcc.patch',
+ 'webrtc-audio-processing/0022-Re-add-pthread-linking-on-linux.patch',
+ 'webrtc-audio-processing/0023-Add-ARM-64bit-support.patch']
+ autoreconf = True
+
+ files_libs = ['libwebrtc_audio_processing']
+ files_devel = ['include/webrtc_audio_processing', 'lib/pkgconfig/webrtc-audio-processing.pc']
+
+ def prepare(self):
+ if self.config.target_platform == Platform.ANDROID:
+ # TODO add --enable-neon=runtime, there is a conflict with cerbero
+ # that defines -mfpu=vfp... plus webrtc-audio-processing build
+ # system is doing it wrong, as it should add -mfpu=neon only for
+ # the files that contains neon intrinsic.
+ self.configure_options += ' --with-gnustl'
+ elif self.config.target_platform == Platform.WINDOWS:
+ # This recipe requires at least Windows Vista
+ self.append_env['CFLAGS'] = ' -UWINVER -U_WIN32_WINNT -DWINVER=0x0600 -D_WIN32_WINNT=0x0600'
diff --git a/recipes/webrtc-audio-processing/0000-Add-fix_interlocked_exchange_pointer_win.h.patch b/recipes/webrtc-audio-processing/0000-Add-fix_interlocked_exchange_pointer_win.h.patch
new file mode 100644
index 0000000..f16da35
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0000-Add-fix_interlocked_exchange_pointer_win.h.patch
@@ -0,0 +1,59 @@
+From 8a30ba00ec8a7d0dbc42478ee920890c78ce9e3e Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Tue, 5 Jul 2016 18:24:18 -0400
+Subject: [PATCH] Add fix_interlocked_exchange_pointer_win.h
+
+It's missing in the tarball.
+---
+ .../include/fix_interlocked_exchange_pointer_win.h | 39 ++++++++++++++++++++++
+ 1 file changed, 39 insertions(+)
+ create mode 100644 webrtc/system_wrappers/include/fix_interlocked_exchange_pointer_win.h
+
+diff --git a/webrtc/system_wrappers/include/fix_interlocked_exchange_pointer_win.h b/webrtc/system_wrappers/include/fix_interlocked_exchange_pointer_win.h
+new file mode 100644
+index 0000000..8fb32ef
+--- /dev/null
++++ b/webrtc/system_wrappers/include/fix_interlocked_exchange_pointer_win.h
+@@ -0,0 +1,39 @@
++/*
++ * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
++ *
++ * Use of this source code is governed by a BSD-style license
++ * that can be found in the LICENSE file in the root of the source
++ * tree. An additional intellectual property rights grant can be found
++ * in the file PATENTS. All contributing project authors may
++ * be found in the AUTHORS file in the root of the source tree.
++ */
++
++// Various inline functions and macros to fix compilation of 32 bit target
++// on MSVC with /Wp64 flag enabled.
++
++// The original code can be found here:
++// http://src.chromium.org/svn/trunk/src/base/fix_wp64.h
++
++#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
++#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
++
++#include <windows.h>
++
++// Platform SDK fixes when building with /Wp64 for a 32 bits target.
++#if !defined(_WIN64) && defined(_Wp64)
++
++#ifdef InterlockedExchangePointer
++#undef InterlockedExchangePointer
++// The problem is that the macro provided for InterlockedExchangePointer() is
++// doing a (LONG) C-style cast that triggers invariably the warning C4312 when
++// building on 32 bits.
++inline void* InterlockedExchangePointer(void* volatile* target, void* value) {
++ return reinterpret_cast<void*>(static_cast<LONG_PTR>(InterlockedExchange(
++ reinterpret_cast<volatile LONG*>(target),
++ static_cast<LONG>(reinterpret_cast<LONG_PTR>(value)))));
++}
++#endif // #ifdef InterlockedExchangePointer
++
++#endif // #if !defined(_WIN64) && defined(_Wp64)
++
++#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0000-Add-sal.h-as-it-s-missing-in-cerbero-mingw.patch b/recipes/webrtc-audio-processing/0000-Add-sal.h-as-it-s-missing-in-cerbero-mingw.patch
new file mode 100644
index 0000000..3313e7e
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0000-Add-sal.h-as-it-s-missing-in-cerbero-mingw.patch
@@ -0,0 +1,230 @@
+From 26fab98e56891510af4c8fdc1df52284c646f48b Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 14:31:36 -0400
+Subject: [PATCH 8/8] Add sal.h as it's missing in cerbero/mingw
+
+---
+ sal.h | 211 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 211 insertions(+)
+ create mode 100644 sal.h
+
+diff --git a/sal.h b/sal.h
+new file mode 100644
+index 0000000..5c200d4
+--- /dev/null
++++ b/sal.h
+@@ -0,0 +1,211 @@
++/**
++ * This file has no copyright assigned and is placed in the Public Domain.
++ * This file is part of the mingw-w64 runtime package.
++ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
++ */
++
++#ifndef SAL_HXX
++#define SAL_HXX
++
++#ifdef __GNUC__
++# define __inner_checkReturn __attribute__((warn_unused_result))
++#elif defined(_MSC_VER)
++# define __inner_checkReturn __declspec("SAL_checkReturn")
++#else
++# define __inner_checkReturn
++#endif
++
++#define __checkReturn __inner_checkReturn
++
++/* Pointer parameters */
++#define _In_
++#define _Out_
++#define _Inout_
++#define _In_z_
++#define _Inout_z_
++#define _In_reads_(s)
++#define _In_reads_bytes_(s)
++#define _In_reads_z_(s)
++#define _In_reads_or_z_(s)
++#define _Out_writes_(s)
++#define _Out_writes_bytes_(s)
++#define _Out_writes_z_(s)
++#define _Inout_updates_(s)
++#define _Inout_updates_bytes_(s)
++#define _Inout_updates_z_(s)
++#define _Out_writes_to_(s,c)
++#define _Out_writes_bytes_to_(s, c)
++#define _Out_writes_all_(s)
++#define _Out_writes_bytes_all_(s)
++#define _Inout_updates_to_(s, c)
++#define _Inout_updates_bytes_to_(s, c)
++#define _Inout_updates_all_(s)
++#define _Inout_updates_bytes_all_(s)
++#define _In_reads_to_ptr_(p)
++#define _In_reads_to_ptr_z_(p)
++#define _Out_writes_to_ptr_(p)
++#define _Out_writes_to_ptr_z(p)
++
++/* Optional pointer parameters */
++#define _In_opt_
++#define _Out_opt_
++#define _Inout_opt_
++#define _In_opt_z_
++#define _Inout_opt_z_
++#define _In_reads_opt_(s)
++#define _In_reads_bytes_opt_(s)
++#define _In_reads_opt_z_(s)
++
++#define _Out_writes_opt_(s)
++#define _Out_writes_opt_z_(s)
++#define _Inout_updates_opt_(s)
++#define _Inout_updates_bytes_opt_(s)
++#define _Inout_updates_opt_z_(s)
++#define _Out_writes_to_opt_(s, c)
++#define _Out_writes_bytes_to_opt_(s, c)
++#define _Out_writes_all_opt_(s)
++#define _Out_writes_bytes_all_opt_(s)
++
++#define _Inout_updates_to_opt_(s, c)
++#define _Inout_updates_bytes_to_opt_(s, c)
++#define _Inout_updates_all_opt_(s)
++#define _Inout_updates_bytes_all_opt_(s)
++#define _In_reads_to_ptr_opt_(p)
++#define _In_reads_to_ptr_opt_z_(p)
++#define _Out_writes_to_ptr_opt_(p)
++#define _Out_writes_to_ptr_opt_z_(p)
++
++/* Output pointer parameters */
++#define _Outptr_
++#define _Outptr_opt_
++#define _Outptr_result_maybenull_
++#define _Outptr_opt_result_maybenull_
++#define _Outptr_result_z_
++#define _Outptr_opt_result_z_
++#define _Outptr_result_maybenull_z_
++#define _Outptr_opt_result_maybenull_z_
++#define _COM_Outptr_
++#define _COM_Outptr_opt_
++#define _COM_Outptr_result_maybenull_
++#define _COM_Outptr_opt_result_maybenull_
++#define _Outptr_result_buffer_(s)
++#define _Outptr_result_bytebuffer_(s)
++#define _Outptr_opt_result_buffer_(s)
++#define _Outptr_opt_result_bytebuffer_(s)
++#define _Outptr_result_buffer_to_(s, c)
++#define _Outptr_result_bytebuffer_to_(s, c)
++#define _Outptr_result_bytebuffer_maybenull_(s)
++#define _Outptr_opt_result_buffer_to_(s, c)
++#define _Outptr_opt_result_bytebuffer_to_(s, c)
++#define _Result_nullonfailure_
++#define _Result_zeroonfailure_
++#define _Outptr_result_nullonfailure_
++#define _Outptr_opt_result_nullonfailure_
++#define _Outref_result_nullonfailure_
++
++/* Output reference parameters */
++#define _Outref_
++#define _Outref_result_maybenull_
++#define _Outref_result_buffer_(s)
++#define _Outref_result_bytebuffer_(s)
++#define _Outref_result_buffer_to_(s, c)
++#define _Outref_result_bytebuffer_to_(s, c)
++#define _Outref_result_buffer_all_(s)
++#define _Outref_result_bytebuffer_all_(s)
++#define _Outref_result_buffer_maybenull_(s)
++#define _Outref_result_bytebuffer_maybenull_(s)
++#define _Outref_result_buffer_to_maybenull_(s, c)
++#define _Outref_result_bytebuffer_to_maybenull_(s, c)
++#define _Outref_result_buffer_all_maybenull_(s)
++#define _Outref_result_bytebuffer_all_maybenull_(s)
++
++/* Return values */
++#define _Ret_z_
++#define _Ret_writes_(s)
++#define _Ret_writes_bytes_(s)
++#define _Ret_writes_z_(s)
++#define _Ret_writes_bytes_to_(s, c)
++#define _Ret_writes_maybenull_(s)
++#define _Ret_writes_to_maybenull_(s, c)
++#define _Ret_writes_maybenull_z_(s)
++#define _Ret_maybenull_
++#define _Ret_maybenull_z_
++#define _Ret_null_
++#define _Ret_notnull_
++#define _Ret_writes_bytes_to_(s, c)
++#define _Ret_writes_bytes_maybenull_(s)
++#define _Ret_writes_bytes_to_maybenull_(s, c)
++
++/* Other common annotations */
++#define _In_range_(low, hi)
++#define _Out_range_(low, hi)
++#define _Ret_range_(low, hi)
++#define _Deref_in_range_(low, hi)
++#define _Deref_out_range_(low, hi)
++#define _Deref_inout_range_(low, hi)
++#define _Pre_equal_to_(expr)
++#define _Post_equal_to_(expr)
++#define _Struct_size_bytes_(size)
++
++/* Function annotations */
++#define _Called_from_function_class_(name)
++#define _Check_return_ __checkReturn
++#define _Function_class_(name)
++#define _Raises_SEH_exception_
++#define _Maybe_raises_SEH_exception_
++#define _Must_inspect_result_
++#define _Use_decl_annotations_
++
++/* Success/failure annotations */
++#define _Always_(anno_list)
++#define _On_failure_(anno_list)
++#define _Return_type_success_(expr)
++#define _Success_(expr)
++
++#define _Reserved_
++#define _Const_
++
++/* Buffer properties */
++#define _Readable_bytes_(s)
++#define _Readable_elements_(s)
++#define _Writable_bytes_(s)
++#define _Writable_elements_(s)
++#define _Null_terminated_
++#define _NullNull_terminated_
++#define _Pre_readable_size_(s)
++#define _Pre_writable_size_(s)
++#define _Pre_readable_byte_size_(s)
++#define _Pre_writable_byte_size_(s)
++#define _Post_readable_size_(s)
++#define _Post_writable_size_(s)
++#define _Post_readable_byte_size_(s)
++#define _Post_writable_byte_size_(s)
++
++/* Field properties */
++#define _Field_size_(s)
++#define _Field_size_full_(s)
++#define _Field_size_full_opt_(s)
++#define _Field_size_opt_(s)
++#define _Field_size_part_(s, c)
++#define _Field_size_part_opt_(s, c)
++#define _Field_size_bytes_(size)
++#define _Field_size_bytes_full_(size)
++#define _Field_size_bytes_full_opt_(s)
++#define _Field_size_bytes_opt_(s)
++#define _Field_size_bytes_part_(s, c)
++#define _Field_size_bytes_part_opt_(s, c)
++#define _Field_z_
++#define _Field_range_(min, max)
++
++/* Structural annotations */
++#define _At_(e, a)
++#define _At_buffer_(e, i, c, a)
++#define _Group_(a)
++#define _When_(e, a)
++
++/* Analysis */
++#define _Analysis_assume_(expr)
++#define _Analysis_assume_nullterminated_(expr)
++
++#endif
++
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0001-build-enforce-linking-with-no-undefined-add-explicit.patch b/recipes/webrtc-audio-processing/0001-build-enforce-linking-with-no-undefined-add-explicit.patch
new file mode 100644
index 0000000..9924779
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0001-build-enforce-linking-with-no-undefined-add-explicit.patch
@@ -0,0 +1,41 @@
+From d58164e4d87854233564b59e76259b72e21507f6 Mon Sep 17 00:00:00 2001
+From: Rex Dieter <rdieter@math.unl.edu>
+Date: Wed, 1 Jun 2016 10:09:45 +0530
+Subject: [PATCH 01/19] build: enforce linking with --no-undefined, add
+ explicit -lpthread
+
+In investigating x86/sse2 issues in recent webrtc-audio-processing-0.2
+release, I found that it was possible for libwebrtc_audio_processing to
+contain undefined symbols.
+
+Attached is a patch that addresses this:
+* adds -Wl,--no-undefined to libwebrtc_audio_processing_la_LDFLAGS
+* adds explicit -lpthread linkage (else, there are undefined references
+ to pthread-related symbols)
+
+Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
+---
+ webrtc/modules/audio_processing/Makefile.am | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/webrtc/modules/audio_processing/Makefile.am b/webrtc/modules/audio_processing/Makefile.am
+index b685fb9..6a5c508 100644
+--- a/webrtc/modules/audio_processing/Makefile.am
++++ b/webrtc/modules/audio_processing/Makefile.am
+@@ -166,8 +166,11 @@ libwebrtc_audio_processing_la_LIBADD = $(top_builddir)/webrtc/libwebrtc.la \
+ $(top_builddir)/webrtc/base/libbase.la \
+ $(top_builddir)/webrtc/system_wrappers/libsystem_wrappers.la \
+ $(top_builddir)/webrtc/common_audio/libcommon_audio.la \
+- $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la
+-libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBWEBRTC_AUDIO_PROCESSING_VERSION_INFO)
++ $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la \
++ -lpthread
++libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) \
++ -Wl,--no-undefined \
++ -version-info $(LIBWEBRTC_AUDIO_PROCESSING_VERSION_INFO)
+
+ # FIXME: The MIPS optimisations need to be hooked up once we have the
+ # autotools conditionals in place
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0002-build-Make-sure-files-with-SSE2-code-are-compiled-wi.patch b/recipes/webrtc-audio-processing/0002-build-Make-sure-files-with-SSE2-code-are-compiled-wi.patch
new file mode 100644
index 0000000..3c1cc6b
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0002-build-Make-sure-files-with-SSE2-code-are-compiled-wi.patch
@@ -0,0 +1,66 @@
+From 066cf53da73779086ada515d7633279c53d72fa2 Mon Sep 17 00:00:00 2001
+From: Rex Dieter <rdieter@math.unl.edu>
+Date: Tue, 21 Jun 2016 16:46:48 +0530
+Subject: [PATCH 02/19] build: Make sure files with SSE2 code are compiled with
+ -msse2
+
+Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
+---
+ webrtc/common_audio/Makefile.am | 9 ++++++++-
+ webrtc/modules/audio_processing/Makefile.am | 8 +++++++-
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/webrtc/common_audio/Makefile.am b/webrtc/common_audio/Makefile.am
+index 3ff1de8..3bbd318 100644
+--- a/webrtc/common_audio/Makefile.am
++++ b/webrtc/common_audio/Makefile.am
+@@ -93,10 +93,17 @@ libcommon_audio_la_SOURCES = resampler/include/push_resampler.h \
+ window_generator.cc
+
+ if HAVE_X86
+-libcommon_audio_la_SOURCES += \
++noinst_LTLIBRARIES += libcommon_audio_sse2.la
++libcommon_audio_sse2_la_SOURCES = \
+ resampler/sinc_resampler_sse.cc \
+ fir_filter_sse.cc \
+ fir_filter_sse.h
++
++libcommon_audio_sse2_la_CFLAGS = $(AM_CFLAGS) $(COMMON_CFLAGS) -msse2
++libcommon_audio_sse2_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS) -msse2
++libcommon_audio_sse2_la_LDFLAGS = $(AM_LDFLAGS)
++
++libcommon_audio_la_LIBADD = libcommon_audio_sse2.la
+ endif
+
+ if HAVE_ARM
+diff --git a/webrtc/modules/audio_processing/Makefile.am b/webrtc/modules/audio_processing/Makefile.am
+index 6a5c508..30ca898 100644
+--- a/webrtc/modules/audio_processing/Makefile.am
++++ b/webrtc/modules/audio_processing/Makefile.am
+@@ -147,9 +147,14 @@ libwebrtc_audio_processing_la_SOURCES += \
+ endif
+
+ if HAVE_X86
+-libwebrtc_audio_processing_la_SOURCES += \
++noinst_LTLIBRARIES = libwebrtc_audio_processing_privatearch.la
++LIBWEBRTC_PRIVATEARCH=libwebrtc_audio_processing_privatearch.la
++libwebrtc_audio_processing_privatearch_la_SOURCES = \
+ aec/aec_core_sse2.c \
+ aec/aec_rdft_sse2.c
++libwebrtc_audio_processing_privatearch_la_CFLAGS = $(AM_CFLAGS) $(COMMON_CFLAGS) -msse2
++libwebrtc_audio_processing_privatearch_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS) -msse2
++libwebrtc_audio_processing_privatearch_la_LDFLAGS = $(AM_LDFLAGS)
+ endif
+
+ if HAVE_NEON
+@@ -167,6 +172,7 @@ libwebrtc_audio_processing_la_LIBADD = $(top_builddir)/webrtc/libwebrtc.la \
+ $(top_builddir)/webrtc/system_wrappers/libsystem_wrappers.la \
+ $(top_builddir)/webrtc/common_audio/libcommon_audio.la \
+ $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la \
++ $(LIBWEBRTC_PRIVATEARCH) \
+ -lpthread
+ libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) \
+ -Wl,--no-undefined \
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0003-Don-t-include-execinfo.h-for-windows.patch b/recipes/webrtc-audio-processing/0003-Don-t-include-execinfo.h-for-windows.patch
new file mode 100644
index 0000000..9d08c1c
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0003-Don-t-include-execinfo.h-for-windows.patch
@@ -0,0 +1,39 @@
+From 6355e0ef6a871897a34c1fe1f10f62d147d8f43f Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 14:11:48 -0400
+Subject: [PATCH 03/19] Don't include execinfo.h for windows
+
+And that even if we have GLIBC. This fixes a build issue in mingw.
+
+Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/base/checks.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/webrtc/base/checks.cc b/webrtc/base/checks.cc
+index 49a31f2..32a2f74 100644
+--- a/webrtc/base/checks.cc
++++ b/webrtc/base/checks.cc
+@@ -16,7 +16,7 @@
+ #include <cstdio>
+ #include <cstdlib>
+
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
++#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(WEBRTC_WIN)
+ #include <cxxabi.h>
+ #include <execinfo.h>
+ #endif
+@@ -55,7 +55,7 @@ void PrintError(const char* format, ...) {
+ // to get usable symbols on Linux. This is copied from V8. Chromium has a more
+ // advanced stace trace system; also more difficult to copy.
+ void DumpBacktrace() {
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
++#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(WEBRTC_WIN)
+ void* trace[100];
+ int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
+ char** symbols = backtrace_symbols(trace, size);
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0004-Don-t-use-MSVC-specific-exception-handler-for-MINGW.patch b/recipes/webrtc-audio-processing/0004-Don-t-use-MSVC-specific-exception-handler-for-MINGW.patch
new file mode 100644
index 0000000..c35e0a8
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0004-Don-t-use-MSVC-specific-exception-handler-for-MINGW.patch
@@ -0,0 +1,31 @@
+From 07f1de1f39d0bded62220d8dcc3ea5308af9839a Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 14:15:09 -0400
+Subject: [PATCH 04/19] Don't use MSVC specific exception handler for MINGW
+
+Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/base/platform_thread.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/webrtc/base/platform_thread.cc b/webrtc/base/platform_thread.cc
+index 4167392..33d2bdd 100644
+--- a/webrtc/base/platform_thread.cc
++++ b/webrtc/base/platform_thread.cc
+@@ -70,7 +70,11 @@ void SetCurrentThreadName(const char* name) {
+ __try {
+ ::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(DWORD),
+ reinterpret_cast<ULONG_PTR*>(&threadname_info));
++#ifdef __MINGW32__
++ } catch (...) {
++#else
+ } __except (EXCEPTION_EXECUTE_HANDLER) {
++#endif
+ }
+ #elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
+ prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name));
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0005-Add-missing-throw-in-destructor-override.patch b/recipes/webrtc-audio-processing/0005-Add-missing-throw-in-destructor-override.patch
new file mode 100644
index 0000000..b66aead
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0005-Add-missing-throw-in-destructor-override.patch
@@ -0,0 +1,30 @@
+From 637b5bd28370e18287897fd0ba2570705d6da80f Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 14:16:42 -0400
+Subject: [PATCH 05/19] Add missing throw in destructor override
+
+This is being inforced by mingw.
+
+Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/common_audio/vad/vad.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/webrtc/common_audio/vad/vad.cc b/webrtc/common_audio/vad/vad.cc
+index 95a162f..2e9cd69 100644
+--- a/webrtc/common_audio/vad/vad.cc
++++ b/webrtc/common_audio/vad/vad.cc
+@@ -23,7 +23,7 @@ class VadImpl final : public Vad {
+ Reset();
+ }
+
+- ~VadImpl() override { WebRtcVad_Free(handle_); }
++ ~VadImpl() throw() override { WebRtcVad_Free(handle_); }
+
+ Activity VoiceActivity(const int16_t* audio,
+ size_t num_samples,
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0006-lrint-is-available-with-mingw.patch b/recipes/webrtc-audio-processing/0006-lrint-is-available-with-mingw.patch
new file mode 100644
index 0000000..0b02543
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0006-lrint-is-available-with-mingw.patch
@@ -0,0 +1,31 @@
+From 20f3ac5a17b31635029374507148ae2122a7a663 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 14:17:45 -0400
+Subject: [PATCH 06/19] lrint is available with mingw
+
+This make use of lrint when building with mingw. The assembly code
+for X86 is MSVC specific and would not build.
+
+Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ .../modules/audio_coding/codecs/isac/main/source/os_specific_inline.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/os_specific_inline.h b/webrtc/modules/audio_coding/codecs/isac/main/source/os_specific_inline.h
+index 2b446e9..a0453a0 100644
+--- a/webrtc/modules/audio_coding/codecs/isac/main/source/os_specific_inline.h
++++ b/webrtc/modules/audio_coding/codecs/isac/main/source/os_specific_inline.h
+@@ -15,7 +15,7 @@
+ #include <math.h>
+ #include "webrtc/typedefs.h"
+
+-#if defined(WEBRTC_POSIX)
++#if defined(__GNUC__)
+ #define WebRtcIsac_lrint lrint
+ #elif (defined(WEBRTC_ARCH_X86) && defined(WIN32))
+ static __inline long int WebRtcIsac_lrint(double x_dbl) {
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0007-Fix-case-sensitivity-issue-with-MinGW-cross-build.patch b/recipes/webrtc-audio-processing/0007-Fix-case-sensitivity-issue-with-MinGW-cross-build.patch
new file mode 100644
index 0000000..6d108ed
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0007-Fix-case-sensitivity-issue-with-MinGW-cross-build.patch
@@ -0,0 +1,42 @@
+From 64ad5f20beb6d7695c68986eda4bfc36ea1c3053 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 14:19:18 -0400
+Subject: [PATCH 07/19] Fix case sensitivity issue with MinGW cross-build
+
+Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/system_wrappers/source/file_impl.cc | 2 +-
+ webrtc/system_wrappers/source/rw_lock_win.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/webrtc/system_wrappers/source/file_impl.cc b/webrtc/system_wrappers/source/file_impl.cc
+index 0ee0dea..39a036a 100644
+--- a/webrtc/system_wrappers/source/file_impl.cc
++++ b/webrtc/system_wrappers/source/file_impl.cc
+@@ -13,7 +13,7 @@
+ #include <assert.h>
+
+ #ifdef _WIN32
+-#include <Windows.h>
++#include <windows.h>
+ #else
+ #include <stdarg.h>
+ #include <string.h>
+diff --git a/webrtc/system_wrappers/source/rw_lock_win.h b/webrtc/system_wrappers/source/rw_lock_win.h
+index c279eab..07fac96 100644
+--- a/webrtc/system_wrappers/source/rw_lock_win.h
++++ b/webrtc/system_wrappers/source/rw_lock_win.h
+@@ -13,7 +13,7 @@
+
+ #include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
+
+-#include <Windows.h>
++#include <windows.h>
+
+ namespace webrtc {
+
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0008-Add-missing-windows-specific-headers.patch b/recipes/webrtc-audio-processing/0008-Add-missing-windows-specific-headers.patch
new file mode 100644
index 0000000..eca2b17
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0008-Add-missing-windows-specific-headers.patch
@@ -0,0 +1,123 @@
+From 14eb908dd6e938c49a8f4c4a0d85252d6aa278ff Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 15:08:17 -0400
+Subject: [PATCH 08/19] Add missing windows specific headers
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/base/win32.h | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 103 insertions(+)
+ create mode 100644 webrtc/base/win32.h
+
+diff --git a/webrtc/base/win32.h b/webrtc/base/win32.h
+new file mode 100644
+index 0000000..6969c10
+--- /dev/null
++++ b/webrtc/base/win32.h
+@@ -0,0 +1,103 @@
++/*
++ * Copyright 2004 The WebRTC Project Authors. All rights reserved.
++ *
++ * Use of this source code is governed by a BSD-style license
++ * that can be found in the LICENSE file in the root of the source
++ * tree. An additional intellectual property rights grant can be found
++ * in the file PATENTS. All contributing project authors may
++ * be found in the AUTHORS file in the root of the source tree.
++ */
++#ifndef WEBRTC_BASE_WIN32_H_
++#define WEBRTC_BASE_WIN32_H_
++#if defined(WEBRTC_WIN)
++#ifndef WIN32_LEAN_AND_MEAN
++#define WIN32_LEAN_AND_MEAN
++#endif
++// Make sure we don't get min/max macros
++#ifndef NOMINMAX
++#define NOMINMAX
++#endif
++#include <winsock2.h>
++#include <windows.h>
++#ifndef SECURITY_MANDATORY_LABEL_AUTHORITY
++// Add defines that we use if we are compiling against older sdks
++#define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L)
++#define TokenIntegrityLevel static_cast<TOKEN_INFORMATION_CLASS>(0x19)
++typedef struct _TOKEN_MANDATORY_LABEL {
++ SID_AND_ATTRIBUTES Label;
++} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL;
++#endif // SECURITY_MANDATORY_LABEL_AUTHORITY
++#undef SetPort
++#include <string>
++#include "webrtc/base/stringutils.h"
++#include "webrtc/base/basictypes.h"
++namespace rtc {
++const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size);
++int win32_inet_pton(int af, const char* src, void *dst);
++inline std::wstring ToUtf16(const char* utf8, size_t len) {
++ int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len),
++ NULL, 0);
++ wchar_t* ws = STACK_ARRAY(wchar_t, len16);
++ ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len), ws, len16);
++ return std::wstring(ws, len16);
++}
++inline std::wstring ToUtf16(const std::string& str) {
++ return ToUtf16(str.data(), str.length());
++}
++inline std::string ToUtf8(const wchar_t* wide, size_t len) {
++ int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len),
++ NULL, 0, NULL, NULL);
++ char* ns = STACK_ARRAY(char, len8);
++ ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len), ns, len8,
++ NULL, NULL);
++ return std::string(ns, len8);
++}
++inline std::string ToUtf8(const wchar_t* wide) {
++ return ToUtf8(wide, wcslen(wide));
++}
++inline std::string ToUtf8(const std::wstring& wstr) {
++ return ToUtf8(wstr.data(), wstr.length());
++}
++// Convert FILETIME to time_t
++void FileTimeToUnixTime(const FILETIME& ft, time_t* ut);
++// Convert time_t to FILETIME
++void UnixTimeToFileTime(const time_t& ut, FILETIME * ft);
++// Convert a Utf8 path representation to a non-length-limited Unicode pathname.
++bool Utf8ToWindowsFilename(const std::string& utf8, std::wstring* filename);
++// Convert a FILETIME to a UInt64
++inline uint64_t ToUInt64(const FILETIME& ft) {
++ ULARGE_INTEGER r = {{ft.dwLowDateTime, ft.dwHighDateTime}};
++ return r.QuadPart;
++}
++enum WindowsMajorVersions {
++ kWindows2000 = 5,
++ kWindowsVista = 6,
++};
++bool GetOsVersion(int* major, int* minor, int* build);
++inline bool IsWindowsVistaOrLater() {
++ int major;
++ return (GetOsVersion(&major, NULL, NULL) && major >= kWindowsVista);
++}
++inline bool IsWindowsXpOrLater() {
++ int major, minor;
++ return (GetOsVersion(&major, &minor, NULL) &&
++ (major >= kWindowsVista ||
++ (major == kWindows2000 && minor >= 1)));
++}
++inline bool IsWindows8OrLater() {
++ int major, minor;
++ return (GetOsVersion(&major, &minor, NULL) &&
++ (major > kWindowsVista ||
++ (major == kWindowsVista && minor >= 2)));
++}
++// Determine the current integrity level of the process.
++bool GetCurrentProcessIntegrityLevel(int* level);
++inline bool IsCurrentProcessLowIntegrity() {
++ int level;
++ return (GetCurrentProcessIntegrityLevel(&level) &&
++ level < SECURITY_MANDATORY_MEDIUM_RID);
++}
++bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable);
++} // namespace rtc
++#endif // WEBRTC_WIN
++#endif // WEBRTC_BASE_WIN32_H_
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0009-Fix-build-on-win64.patch b/recipes/webrtc-audio-processing/0009-Fix-build-on-win64.patch
new file mode 100644
index 0000000..0e0aefe
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0009-Fix-build-on-win64.patch
@@ -0,0 +1,30 @@
+From b4e65a077431f3937a3938d918f510edddb4b403 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 15:24:54 -0400
+Subject: [PATCH 09/19] Fix build on win64
+
+This trace function is mixing long int and long long int pointers.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/system_wrappers/source/trace_posix.cc | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/webrtc/system_wrappers/source/trace_posix.cc b/webrtc/system_wrappers/source/trace_posix.cc
+index cb702d8..1419d24 100644
+--- a/webrtc/system_wrappers/source/trace_posix.cc
++++ b/webrtc/system_wrappers/source/trace_posix.cc
+@@ -36,8 +36,9 @@ int32_t TracePosix::AddTime(char* trace_message, const TraceLevel level) const {
+ return -1;
+ }
+ struct tm buffer;
++ time_t sys_time_sec = system_time_high_res.tv_sec;
+ const struct tm* system_time =
+- localtime_r(&system_time_high_res.tv_sec, &buffer);
++ localtime_r(&sys_time_sec, &buffer);
+
+ const uint32_t ms_time = system_time_high_res.tv_usec / 1000;
+ uint32_t prev_tickCount = 0;
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0010-Add-cerbero-gnustl-support-for-Android.patch b/recipes/webrtc-audio-processing/0010-Add-cerbero-gnustl-support-for-Android.patch
new file mode 100644
index 0000000..23c30b5
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0010-Add-cerbero-gnustl-support-for-Android.patch
@@ -0,0 +1,62 @@
+From b0b6edbc13f3cb791d454c6152e4d98f802853aa Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 16:19:49 -0400
+Subject: [PATCH 10/19] Add cerbero gnustl support for Android
+
+---
+ configure.ac | 19 ++++++++++++++++++-
+ webrtc/modules/audio_processing/Makefile.am | 1 +
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index d1a8be9..400b4a4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,23 @@ AS_CASE(["x${with_ns_mode}"],
+ [NS_FIXED=0])
+ AM_CONDITIONAL(NS_FIXED, [test "x${NS_FIXED}" = "x1"])
+
++AC_ARG_WITH(
++ gnustl,
++ AC_HELP_STRING(
++ [--with-gnustl],
++ [use gnustl @<:@default=no@:>@]),
++ [AS_CASE(
++ [$withval], [no], [], [yes], [],
++ [AC_MSG_ERROR([bad value "$withval" for --with-gnustl])])],
++ [with_gnustl=no])
++if test "x$with_gnustl" != "xno"; then
++ PKG_CHECK_MODULES(GNUSTL, gnustl)
++ STL="gnustl"
++fi
++AC_SUBST(GNUSTL_LIBS)
++AC_SUBST(GNUSTL_CFLAGS)
++AC_SUBST(STL)
++
+
+ # Borrowed from gst-plugins-bad
+ AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])
+@@ -104,7 +121,7 @@ AS_IF([test "x$enable_neon" != "xno"],
+ AM_CONDITIONAL([HAVE_NEON], [test "x$HAVE_NEON" = "x1"])
+
+ COMMON_CFLAGS="-DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD ${PLATFORM_CFLAGS} ${OS_CFLAGS} ${ARCH_CFLAGS} -DNDEBUG -I\$(top_srcdir)"
+-COMMON_CXXFLAGS="-std=c++11 -DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD ${PLATFORM_CFLAGS} ${OS_CFLAGS} ${ARCH_CFLAGS} -DNDEBUG -I\$(top_srcdir)"
++COMMON_CXXFLAGS="-std=c++11 -DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD ${PLATFORM_CFLAGS} ${OS_CFLAGS} ${ARCH_CFLAGS} ${GNUSTL_CFLAGS} -DNDEBUG -I\$(top_srcdir)"
+ AC_SUBST([COMMON_CFLAGS])
+ AC_SUBST([COMMON_CXXFLAGS])
+
+diff --git a/webrtc/modules/audio_processing/Makefile.am b/webrtc/modules/audio_processing/Makefile.am
+index 30ca898..eb9bfc0 100644
+--- a/webrtc/modules/audio_processing/Makefile.am
++++ b/webrtc/modules/audio_processing/Makefile.am
+@@ -173,6 +173,7 @@ libwebrtc_audio_processing_la_LIBADD = $(top_builddir)/webrtc/libwebrtc.la \
+ $(top_builddir)/webrtc/common_audio/libcommon_audio.la \
+ $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la \
+ $(LIBWEBRTC_PRIVATEARCH) \
++ $(GNUSTL_LIBS) \
+ -lpthread
+ libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) \
+ -Wl,--no-undefined \
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0011-Disable-backtrace-on-android.patch b/recipes/webrtc-audio-processing/0011-Disable-backtrace-on-android.patch
new file mode 100644
index 0000000..aa7f748
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0011-Disable-backtrace-on-android.patch
@@ -0,0 +1,37 @@
+From 31097f798ebb7b23afe4f85107e874f126c51522 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 16:44:09 -0400
+Subject: [PATCH 11/19] Disable backtrace on android
+
+The check get confused if one uses GNU STL rather then STL port.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/base/checks.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/webrtc/base/checks.cc b/webrtc/base/checks.cc
+index 32a2f74..77cbb1c 100644
+--- a/webrtc/base/checks.cc
++++ b/webrtc/base/checks.cc
+@@ -16,7 +16,7 @@
+ #include <cstdio>
+ #include <cstdlib>
+
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(WEBRTC_WIN)
++#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(WEBRTC_WIN) && !defined(WEBRTC_ANDROID)
+ #include <cxxabi.h>
+ #include <execinfo.h>
+ #endif
+@@ -55,7 +55,7 @@ void PrintError(const char* format, ...) {
+ // to get usable symbols on Linux. This is copied from V8. Chromium has a more
+ // advanced stace trace system; also more difficult to copy.
+ void DumpBacktrace() {
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(WEBRTC_WIN)
++#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(WEBRTC_WIN) && !defined(WEBRTC_ANDROID)
+ void* trace[100];
+ int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
+ char** symbols = backtrace_symbols(trace, size);
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0012-Don-t-blindly-link-to-pthread.patch b/recipes/webrtc-audio-processing/0012-Don-t-blindly-link-to-pthread.patch
new file mode 100644
index 0000000..2f4a6ec
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0012-Don-t-blindly-link-to-pthread.patch
@@ -0,0 +1,29 @@
+From 690890834094394bfca3433253fbcc3079cf5d73 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Thu, 30 Jun 2016 16:49:16 -0400
+Subject: [PATCH 12/19] Don't blindly link to pthread
+
+This otherwise breaks the build on Android and Windows.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/modules/audio_processing/Makefile.am | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/webrtc/modules/audio_processing/Makefile.am b/webrtc/modules/audio_processing/Makefile.am
+index eb9bfc0..8e45e3d 100644
+--- a/webrtc/modules/audio_processing/Makefile.am
++++ b/webrtc/modules/audio_processing/Makefile.am
+@@ -173,8 +173,7 @@ libwebrtc_audio_processing_la_LIBADD = $(top_builddir)/webrtc/libwebrtc.la \
+ $(top_builddir)/webrtc/common_audio/libcommon_audio.la \
+ $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la \
+ $(LIBWEBRTC_PRIVATEARCH) \
+- $(GNUSTL_LIBS) \
+- -lpthread
++ $(GNUSTL_LIBS)
+ libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) \
+ -Wl,--no-undefined \
+ -version-info $(LIBWEBRTC_AUDIO_PROCESSING_VERSION_INFO)
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0013-Add-required-define-for-Windows.patch b/recipes/webrtc-audio-processing/0013-Add-required-define-for-Windows.patch
new file mode 100644
index 0000000..e2e63c2
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0013-Add-required-define-for-Windows.patch
@@ -0,0 +1,33 @@
+From 7f656b91d9f48d72f0e89eda299f586018a8344c Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Mon, 4 Jul 2016 15:07:48 -0400
+Subject: [PATCH 13/19] Add required define for Windows
+
+This will also add it to the .pc file as WEBRTC_WIN leaks into the
+public interface and undefined __STRICT_ANSI__ so M_PI is available.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ configure.ac | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 400b4a4..4333751 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,8 +67,11 @@ AS_CASE(["${host}"],
+ [OS_FLAGS="-DWEBRTC_MAC -DWEBRTC_IOS"],
+ [OS_FLAGS="-DWEBRTC_MAC"])
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
++ ],
++ [*-mingw32*],
++ [
++ PLATFORM_CFLAGS="-DWEBRTC_WIN -U__STRICT_ANSI__"
+ ]
+- # FIXME: Add Windows support
+ )
+ AC_SUBST(PLATFORM_CFLAGS)
+
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0014-Properly-select-the-right-system-wrappers.patch b/recipes/webrtc-audio-processing/0014-Properly-select-the-right-system-wrappers.patch
new file mode 100644
index 0000000..3e16934
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0014-Properly-select-the-right-system-wrappers.patch
@@ -0,0 +1,80 @@
+From 2fdaa677557602f946ababdf68b1866ba3d1cb4d Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Mon, 4 Jul 2016 16:02:29 -0400
+Subject: [PATCH 14/19] Properly select the right system wrappers
+
+This is needed for windows build to be usable.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ configure.ac | 6 ++++++
+ webrtc/system_wrappers/Makefile.am | 12 ++++++++++--
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4333751..bd8e409 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -55,11 +55,13 @@ AS_CASE(["${host}"],
+ [
+ OS_CFLAGS="-DWEBRTC_ANDROID -DWEBRTC_LINUX"
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
++ HAVE_POSIX=1
+ ],
+ [*-*linux*],
+ [
+ OS_CFLAGS="-DWEBRTC_LINUX"
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
++ HAVE_POSIX=1
+ ],
+ [*-*darwin*],
+ [
+@@ -67,13 +69,17 @@ AS_CASE(["${host}"],
+ [OS_FLAGS="-DWEBRTC_MAC -DWEBRTC_IOS"],
+ [OS_FLAGS="-DWEBRTC_MAC"])
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
++ HAVE_POSIX=1
+ ],
+ [*-mingw32*],
+ [
+ PLATFORM_CFLAGS="-DWEBRTC_WIN -U__STRICT_ANSI__"
++ HAVE_WIN=1
+ ]
+ )
+ AC_SUBST(PLATFORM_CFLAGS)
++AM_CONDITIONAL(HAVE_POSIX, [test "x${HAVE_POSIX}" = "x1"])
++AM_CONDITIONAL(HAVE_WIN, [test "x${HAVE_WIN}" = "x1"])
+
+ AS_CASE(["${host_cpu}"],
+ [i?86|x86_64],
+diff --git a/webrtc/system_wrappers/Makefile.am b/webrtc/system_wrappers/Makefile.am
+index 6c9f4ee..8215013 100644
+--- a/webrtc/system_wrappers/Makefile.am
++++ b/webrtc/system_wrappers/Makefile.am
+@@ -42,13 +42,21 @@ libsystem_wrappers_la_SOURCES = include/aligned_malloc.h \
+ source/trace_impl.h \
+ source/trace_posix.h \
+ source/trace_win.h
+-# This assumes that we want the POSIX implementation -- should eventually be
+-# converted to a conditional to include Windows support
++if HAVE_POSIX
+ libsystem_wrappers_la_SOURCES += source/critical_section_posix.cc \
+ source/event_timer_posix.cc \
+ source/rw_lock_posix.cc \
+ source/thread_posix.cc \
+ source/trace_posix.cc
++endif
++if HAVE_WIN
++libsystem_wrappers_la_SOURCES += source/critical_section_win.cc \
++ source/event_timer_win.cc \
++ source/rw_lock_win.cc \
++ source/rw_lock_generic.cc \
++ source/thread_win.cc \
++ source/trace_win.cc
++endif
+ libsystem_wrappers_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS)
+
+ EXTRA_DIST = BUILD.gn \
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0015-Fix-case-sensitivity-in-windows-include.patch b/recipes/webrtc-audio-processing/0015-Fix-case-sensitivity-in-windows-include.patch
new file mode 100644
index 0000000..c2bcaee
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0015-Fix-case-sensitivity-in-windows-include.patch
@@ -0,0 +1,43 @@
+From 9f75161dbff32ea1fc2b1492ec93df3188b4d948 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Mon, 4 Jul 2016 16:03:15 -0400
+Subject: [PATCH 15/19] Fix case sensitivity in windows include
+
+While cross-compiling from linux, we need all include to be
+lower case.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/system_wrappers/source/event_timer_win.cc | 2 +-
+ webrtc/system_wrappers/source/trace_win.cc | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/webrtc/system_wrappers/source/event_timer_win.cc b/webrtc/system_wrappers/source/event_timer_win.cc
+index 4c58698..bc388c2 100644
+--- a/webrtc/system_wrappers/source/event_timer_win.cc
++++ b/webrtc/system_wrappers/source/event_timer_win.cc
+@@ -10,7 +10,7 @@
+
+ #include "webrtc/system_wrappers/source/event_timer_win.h"
+
+-#include "Mmsystem.h"
++#include "mmsystem.h"
+
+ namespace webrtc {
+
+diff --git a/webrtc/system_wrappers/source/trace_win.cc b/webrtc/system_wrappers/source/trace_win.cc
+index 4caedfc..fce691f 100644
+--- a/webrtc/system_wrappers/source/trace_win.cc
++++ b/webrtc/system_wrappers/source/trace_win.cc
+@@ -13,7 +13,7 @@
+ #include <assert.h>
+ #include <stdarg.h>
+
+-#include "Mmsystem.h"
++#include "mmsystem.h"
+
+ namespace webrtc {
+ TraceWindows::TraceWindows()
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0016-Define-MSVC-_WIN32-so-we-can-build-on-mingw.patch b/recipes/webrtc-audio-processing/0016-Define-MSVC-_WIN32-so-we-can-build-on-mingw.patch
new file mode 100644
index 0000000..d10ae61
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0016-Define-MSVC-_WIN32-so-we-can-build-on-mingw.patch
@@ -0,0 +1,26 @@
+From 3c7d0a358081fb17a877802399b7685e55947289 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Mon, 4 Jul 2016 17:54:45 -0400
+Subject: [PATCH 16/19] Define MSVC _WIN32 so we can build on mingw
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bd8e409..2ca5ea9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,7 +73,7 @@ AS_CASE(["${host}"],
+ ],
+ [*-mingw32*],
+ [
+- PLATFORM_CFLAGS="-DWEBRTC_WIN -U__STRICT_ANSI__"
++ PLATFORM_CFLAGS="-DWEBRTC_WIN -D_WIN32 -U__STRICT_ANSI__"
+ HAVE_WIN=1
+ ]
+ )
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0017-Add-missing-windows-conditions-variable.patch b/recipes/webrtc-audio-processing/0017-Add-missing-windows-conditions-variable.patch
new file mode 100644
index 0000000..54894f0
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0017-Add-missing-windows-conditions-variable.patch
@@ -0,0 +1,616 @@
+From c3f28010a64db0239474a565ff4251a390d6ee16 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Mon, 4 Jul 2016 22:12:20 -0400
+Subject: [PATCH 1/5] Add missing windows conditions variable
+
+Those are used by generic RW lock implementation.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=96754
+---
+ webrtc/system_wrappers/Makefile.am | 41 ++++-
+ .../include/condition_variable_wrapper.h | 42 +++++
+ .../system_wrappers/source/condition_variable.cc | 41 +++++
+ .../source/condition_variable_event_win.cc | 195 +++++++++++++++++++++
+ .../source/condition_variable_event_win.h | 46 +++++
+ .../source/condition_variable_native_win.cc | 104 +++++++++++
+ .../source/condition_variable_native_win.h | 54 ++++++
+ 7 files changed, 514 insertions(+), 9 deletions(-)
+ create mode 100644 webrtc/system_wrappers/include/condition_variable_wrapper.h
+ create mode 100644 webrtc/system_wrappers/source/condition_variable.cc
+ create mode 100644 webrtc/system_wrappers/source/condition_variable_event_win.cc
+ create mode 100644 webrtc/system_wrappers/source/condition_variable_event_win.h
+ create mode 100644 webrtc/system_wrappers/source/condition_variable_native_win.cc
+ create mode 100644 webrtc/system_wrappers/source/condition_variable_native_win.h
+
+diff --git a/webrtc/system_wrappers/Makefile.am b/webrtc/system_wrappers/Makefile.am
+index 8215013..09973a7 100644
+--- a/webrtc/system_wrappers/Makefile.am
++++ b/webrtc/system_wrappers/Makefile.am
+@@ -2,6 +2,7 @@ noinst_LTLIBRARIES = libsystem_wrappers.la
+
+ noinst_HEADERS = include/aligned_array.h \
+ include/asm_defines.h \
++ include/condition_variable_wrapper.h \
+ include/compile_assert_c.h \
+ include/event_wrapper.h \
+ include/scoped_vector.h \
+@@ -42,27 +43,49 @@ libsystem_wrappers_la_SOURCES = include/aligned_malloc.h \
+ source/trace_impl.h \
+ source/trace_posix.h \
+ source/trace_win.h
++
++EXTRA_DIST = BUILD.gn
++
+ if HAVE_POSIX
+ libsystem_wrappers_la_SOURCES += source/critical_section_posix.cc \
+ source/event_timer_posix.cc \
+ source/rw_lock_posix.cc \
+ source/thread_posix.cc \
+ source/trace_posix.cc
++else
++EXTRA_DIST += source/critical_section_posix.cc \
++ source/event_timer_posix.cc \
++ source/rw_lock_posix.cc \
++ source/thread_posix.cc \
++ source/trace_posix.cc
+ endif
++
+ if HAVE_WIN
+-libsystem_wrappers_la_SOURCES += source/critical_section_win.cc \
++libsystem_wrappers_la_SOURCES += include/fix_interlocked_exchange_pointer_win.h \
++ source/critical_section_win.cc \
++ source/condition_variable.cc \
++ source/condition_variable_event_win.cc \
++ source/condition_variable_event_win.h \
++ source/condition_variable_native_win.cc \
++ source/condition_variable_native_win.h \
+ source/event_timer_win.cc \
+ source/rw_lock_win.cc \
+ source/rw_lock_generic.cc \
+ source/thread_win.cc \
+ source/trace_win.cc
++else
++EXTRA_DIST += include/fix_interlocked_exchange_pointer_win.h \
++ source/critical_section_win.cc \
++ source/condition_variable.cc \
++ source/condition_variable_event_win.cc \
++ source/condition_variable_event_win.h \
++ source/condition_variable_native_win.cc \
++ source/condition_variable_native_win.h \
++ source/event_timer_win.cc \
++ source/rw_lock_generic.cc \
++ source/rw_lock_win.cc \
++ source/thread_win.cc \
++ source/trace_win.cc
+ endif
+-libsystem_wrappers_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS)
+
+-EXTRA_DIST = BUILD.gn \
+- source/critical_section_win.cc \
+- source/event_timer_win.cc \
+- source/rw_lock_generic.cc \
+- source/rw_lock_win.cc \
+- source/thread_win.cc \
+- source/trace_win.cc
++libsystem_wrappers_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS)
+diff --git a/webrtc/system_wrappers/include/condition_variable_wrapper.h b/webrtc/system_wrappers/include/condition_variable_wrapper.h
+new file mode 100644
+index 0000000..37ca30f
+--- /dev/null
++++ b/webrtc/system_wrappers/include/condition_variable_wrapper.h
+@@ -0,0 +1,42 @@
++/*
++ * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
++ *
++ * Use of this source code is governed by a BSD-style license
++ * that can be found in the LICENSE file in the root of the source
++ * tree. An additional intellectual property rights grant can be found
++ * in the file PATENTS. All contributing project authors may
++ * be found in the AUTHORS file in the root of the source tree.
++ */
++
++#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_
++#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_
++
++namespace webrtc {
++
++class CriticalSectionWrapper;
++
++class ConditionVariableWrapper {
++ public:
++ // Factory method, constructor disabled.
++ static ConditionVariableWrapper* CreateConditionVariable();
++
++ virtual ~ConditionVariableWrapper() {}
++
++ // Calling thread will atomically release crit_sect and wait until next
++ // some other thread calls Wake() or WakeAll().
++ virtual void SleepCS(CriticalSectionWrapper& crit_sect) = 0;
++
++ // Same as above but with a timeout.
++ virtual bool SleepCS(CriticalSectionWrapper& crit_sect,
++ unsigned long max_time_in_ms) = 0;
++
++ // Wakes one thread calling SleepCS().
++ virtual void Wake() = 0;
++
++ // Wakes all threads calling SleepCS().
++ virtual void WakeAll() = 0;
++};
++
++} // namespace webrtc
++
++#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_
+diff --git a/webrtc/system_wrappers/source/condition_variable.cc b/webrtc/system_wrappers/source/condition_variable.cc
+new file mode 100644
+index 0000000..f5ae93a
+--- /dev/null
++++ b/webrtc/system_wrappers/source/condition_variable.cc
+@@ -0,0 +1,41 @@
++/*
++ * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
++ *
++ * Use of this source code is governed by a BSD-style license
++ * that can be found in the LICENSE file in the root of the source
++ * tree. An additional intellectual property rights grant can be found
++ * in the file PATENTS. All contributing project authors may
++ * be found in the AUTHORS file in the root of the source tree.
++ */
++
++#include "webrtc/system_wrappers/include/condition_variable_wrapper.h"
++
++#if defined(_WIN32)
++#include <windows.h>
++#include "webrtc/system_wrappers/source/condition_variable_event_win.h"
++#include "webrtc/system_wrappers/source/condition_variable_native_win.h"
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
++#include <pthread.h>
++#include "webrtc/system_wrappers/source/condition_variable_posix.h"
++#endif
++
++namespace webrtc {
++
++ConditionVariableWrapper* ConditionVariableWrapper::CreateConditionVariable() {
++#if defined(_WIN32)
++ // Try to create native condition variable implementation.
++ ConditionVariableWrapper* ret_val = ConditionVariableNativeWin::Create();
++ if (!ret_val) {
++ // Native condition variable implementation does not exist. Create generic
++ // condition variable based on events.
++ ret_val = new ConditionVariableEventWin();
++ }
++ return ret_val;
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
++ return ConditionVariablePosix::Create();
++#else
++ return NULL;
++#endif
++}
++
++} // namespace webrtc
+diff --git a/webrtc/system_wrappers/source/condition_variable_event_win.cc b/webrtc/system_wrappers/source/condition_variable_event_win.cc
+new file mode 100644
+index 0000000..41b019d
+--- /dev/null
++++ b/webrtc/system_wrappers/source/condition_variable_event_win.cc
+@@ -0,0 +1,195 @@
++/*
++Source:
++http://www1.cse.wustl.edu/~schmidt/ACE-copying.html
++
++License:
++Copyright and Licensing Information for ACE(TM), TAO(TM), CIAO(TM), DAnCE(TM),
++and CoSMIC(TM)
++
++ACE(TM), TAO(TM), CIAO(TM), DAnCE>(TM), and CoSMIC(TM) (henceforth referred to
++as "DOC software") are copyrighted by Douglas C. Schmidt and his research
++group at Washington University, University of California, Irvine, and
++Vanderbilt University, Copyright (c) 1993-2009, all rights reserved. Since DOC
++software is open-source, freely available software, you are free to use,
++modify, copy, and distribute--perpetually and irrevocably--the DOC software
++source code and object code produced from the source, as well as copy and
++distribute modified versions of this software. You must, however, include this
++copyright statement along with any code built using DOC software that you
++release. No copyright statement needs to be provided if you just ship binary
++executables of your software products.
++You can use DOC software in commercial and/or binary software releases and are
++under no obligation to redistribute any of your source code that is built
++using DOC software. Note, however, that you may not misappropriate the DOC
++software code, such as copyrighting it yourself or claiming authorship of the
++DOC software code, in a way that will prevent DOC software from being
++distributed freely using an open-source development model. You needn't inform
++anyone that you're using DOC software in your software, though we encourage
++you to let us know so we can promote your project in the DOC software success
++stories.
++
++The ACE, TAO, CIAO, DAnCE, and CoSMIC web sites are maintained by the DOC
++Group at the Institute for Software Integrated Systems (ISIS) and the Center
++for Distributed Object Computing of Washington University, St. Louis for the
++development of open-source software as part of the open-source software
++community. Submissions are provided by the submitter ``as is'' with no
++warranties whatsoever, including any warranty of merchantability,
++noninfringement of third party intellectual property, or fitness for any
++particular purpose. In no event shall the submitter be liable for any direct,
++indirect, special, exemplary, punitive, or consequential damages, including
++without limitation, lost profits, even if advised of the possibility of such
++damages. Likewise, DOC software is provided as is with no warranties of any
++kind, including the warranties of design, merchantability, and fitness for a
++particular purpose, noninfringement, or arising from a course of dealing,
++usage or trade practice. Washington University, UC Irvine, Vanderbilt
++University, their employees, and students shall have no liability with respect
++to the infringement of copyrights, trade secrets or any patents by DOC
++software or any part thereof. Moreover, in no event will Washington
++University, UC Irvine, or Vanderbilt University, their employees, or students
++be liable for any lost revenue or profits or other special, indirect and
++consequential damages.
++
++DOC software is provided with no support and without any obligation on the
++part of Washington University, UC Irvine, Vanderbilt University, their
++employees, or students to assist in its use, correction, modification, or
++enhancement. A number of companies around the world provide commercial support
++for DOC software, however. DOC software is Y2K-compliant, as long as the
++underlying OS platform is Y2K-compliant. Likewise, DOC software is compliant
++with the new US daylight savings rule passed by Congress as "The Energy Policy
++Act of 2005," which established new daylight savings times (DST) rules for the
++United States that expand DST as of March 2007. Since DOC software obtains
++time/date and calendaring information from operating systems users will not be
++affected by the new DST rules as long as they upgrade their operating systems
++accordingly.
++
++The names ACE(TM), TAO(TM), CIAO(TM), DAnCE(TM), CoSMIC(TM), Washington
++University, UC Irvine, and Vanderbilt University, may not be used to endorse
++or promote products or services derived from this source without express
++written permission from Washington University, UC Irvine, or Vanderbilt
++University. This license grants no permission to call products or services
++derived from this source ACE(TM), TAO(TM), CIAO(TM), DAnCE(TM), or CoSMIC(TM),
++nor does it grant permission for the name Washington University, UC Irvine, or
++Vanderbilt University to appear in their names.
++*/
++
++/*
++ * This source code contain modifications to the original source code
++ * which can be found here:
++ * http://www.cs.wustl.edu/~schmidt/win32-cv-1.html (section 3.2).
++ * Modifications:
++ * 1) Dynamic detection of native support for condition variables.
++ * 2) Use of WebRTC defined types and classes. Renaming of some functions.
++ * 3) Introduction of a second event for wake all functionality. This prevents
++ * a thread from spinning on the same condition variable, preventing other
++ * threads from waking up.
++ */
++
++#include "webrtc/system_wrappers/source/condition_variable_event_win.h"
++#include "webrtc/system_wrappers/source/critical_section_win.h"
++
++namespace webrtc {
++
++ConditionVariableEventWin::ConditionVariableEventWin() : eventID_(WAKEALL_0) {
++ memset(&num_waiters_[0], 0, sizeof(num_waiters_));
++
++ InitializeCriticalSection(&num_waiters_crit_sect_);
++
++ events_[WAKEALL_0] = CreateEvent(NULL, // no security attributes
++ TRUE, // manual-reset, sticky event
++ FALSE, // initial state non-signaled
++ NULL); // no name for event
++
++ events_[WAKEALL_1] = CreateEvent(NULL, // no security attributes
++ TRUE, // manual-reset, sticky event
++ FALSE, // initial state non-signaled
++ NULL); // no name for event
++
++ events_[WAKE] = CreateEvent(NULL, // no security attributes
++ FALSE, // auto-reset, sticky event
++ FALSE, // initial state non-signaled
++ NULL); // no name for event
++}
++
++ConditionVariableEventWin::~ConditionVariableEventWin() {
++ CloseHandle(events_[WAKE]);
++ CloseHandle(events_[WAKEALL_1]);
++ CloseHandle(events_[WAKEALL_0]);
++
++ DeleteCriticalSection(&num_waiters_crit_sect_);
++}
++
++void ConditionVariableEventWin::SleepCS(CriticalSectionWrapper& crit_sect) {
++ SleepCS(crit_sect, INFINITE);
++}
++
++bool ConditionVariableEventWin::SleepCS(CriticalSectionWrapper& crit_sect,
++ unsigned long max_time_in_ms) {
++ EnterCriticalSection(&num_waiters_crit_sect_);
++
++ // Get the eventID for the event that will be triggered by next
++ // WakeAll() call and start waiting for it.
++ const EventWakeUpType eventID =
++ (WAKEALL_0 == eventID_) ? WAKEALL_1 : WAKEALL_0;
++
++ ++(num_waiters_[eventID]);
++ LeaveCriticalSection(&num_waiters_crit_sect_);
++
++ CriticalSectionWindows* cs =
++ static_cast<CriticalSectionWindows*>(&crit_sect);
++ LeaveCriticalSection(&cs->crit);
++ HANDLE events[2];
++ events[0] = events_[WAKE];
++ events[1] = events_[eventID];
++ const DWORD result = WaitForMultipleObjects(2, // Wait on 2 events.
++ events,
++ FALSE, // Wait for either.
++ max_time_in_ms);
++
++ const bool ret_val = (result != WAIT_TIMEOUT);
++
++ EnterCriticalSection(&num_waiters_crit_sect_);
++ --(num_waiters_[eventID]);
++
++ // Last waiter should only be true for WakeAll(). WakeAll() correspond
++ // to position 1 in events[] -> (result == WAIT_OBJECT_0 + 1)
++ const bool last_waiter = (result == WAIT_OBJECT_0 + 1) &&
++ (num_waiters_[eventID] == 0);
++ LeaveCriticalSection(&num_waiters_crit_sect_);
++
++ if (last_waiter) {
++ // Reset/unset the WakeAll() event since all threads have been
++ // released.
++ ResetEvent(events_[eventID]);
++ }
++
++ EnterCriticalSection(&cs->crit);
++ return ret_val;
++}
++
++void ConditionVariableEventWin::Wake() {
++ EnterCriticalSection(&num_waiters_crit_sect_);
++ const bool have_waiters = (num_waiters_[WAKEALL_0] > 0) ||
++ (num_waiters_[WAKEALL_1] > 0);
++ LeaveCriticalSection(&num_waiters_crit_sect_);
++
++ if (have_waiters) {
++ SetEvent(events_[WAKE]);
++ }
++}
++
++void ConditionVariableEventWin::WakeAll() {
++ EnterCriticalSection(&num_waiters_crit_sect_);
++
++ // Update current WakeAll() event
++ eventID_ = (WAKEALL_0 == eventID_) ? WAKEALL_1 : WAKEALL_0;
++
++ // Trigger current event
++ const EventWakeUpType eventID = eventID_;
++ const bool have_waiters = num_waiters_[eventID] > 0;
++ LeaveCriticalSection(&num_waiters_crit_sect_);
++
++ if (have_waiters) {
++ SetEvent(events_[eventID]);
++ }
++}
++
++} // namespace webrtc
+diff --git a/webrtc/system_wrappers/source/condition_variable_event_win.h b/webrtc/system_wrappers/source/condition_variable_event_win.h
+new file mode 100644
+index 0000000..cdcef7d
+--- /dev/null
++++ b/webrtc/system_wrappers/source/condition_variable_event_win.h
+@@ -0,0 +1,46 @@
++/*
++ * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
++ *
++ * Use of this source code is governed by a BSD-style license
++ * that can be found in the LICENSE file in the root of the source
++ * tree. An additional intellectual property rights grant can be found
++ * in the file PATENTS. All contributing project authors may
++ * be found in the AUTHORS file in the root of the source tree.
++ */
++
++#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_EVENT_WIN_H_
++#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_EVENT_WIN_H_
++
++#include <windows.h>
++
++#include "webrtc/system_wrappers/include/condition_variable_wrapper.h"
++
++namespace webrtc {
++
++class ConditionVariableEventWin : public ConditionVariableWrapper {
++ public:
++ ConditionVariableEventWin();
++ virtual ~ConditionVariableEventWin();
++
++ void SleepCS(CriticalSectionWrapper& crit_sect);
++ bool SleepCS(CriticalSectionWrapper& crit_sect, unsigned long max_time_inMS);
++ void Wake();
++ void WakeAll();
++
++ private:
++ enum EventWakeUpType {
++ WAKEALL_0 = 0,
++ WAKEALL_1 = 1,
++ WAKE = 2,
++ EVENT_COUNT = 3
++ };
++
++ unsigned int num_waiters_[2];
++ EventWakeUpType eventID_;
++ CRITICAL_SECTION num_waiters_crit_sect_;
++ HANDLE events_[EVENT_COUNT];
++};
++
++} // namespace webrtc
++
++#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_EVENT_WIN_H_
+diff --git a/webrtc/system_wrappers/source/condition_variable_native_win.cc b/webrtc/system_wrappers/source/condition_variable_native_win.cc
+new file mode 100644
+index 0000000..45225f2
+--- /dev/null
++++ b/webrtc/system_wrappers/source/condition_variable_native_win.cc
+@@ -0,0 +1,104 @@
++/*
++ * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
++ *
++ * Use of this source code is governed by a BSD-style license
++ * that can be found in the LICENSE file in the root of the source
++ * tree. An additional intellectual property rights grant can be found
++ * in the file PATENTS. All contributing project authors may
++ * be found in the AUTHORS file in the root of the source tree.
++ */
++
++#include "webrtc/system_wrappers/include/trace.h"
++#include "webrtc/system_wrappers/source/condition_variable_native_win.h"
++#include "webrtc/system_wrappers/source/critical_section_win.h"
++
++namespace webrtc {
++
++static HMODULE library = NULL;
++static bool win_support_condition_variables_primitive = false;
++
++PInitializeConditionVariable PInitializeConditionVariable_;
++PSleepConditionVariableCS PSleepConditionVariableCS_;
++PWakeConditionVariable PWakeConditionVariable_;
++PWakeAllConditionVariable PWakeAllConditionVariable_;
++
++typedef void (WINAPI *PInitializeConditionVariable)(PCONDITION_VARIABLE);
++typedef BOOL (WINAPI *PSleepConditionVariableCS)(PCONDITION_VARIABLE,
++ PCRITICAL_SECTION, DWORD);
++typedef void (WINAPI *PWakeConditionVariable)(PCONDITION_VARIABLE);
++typedef void (WINAPI *PWakeAllConditionVariable)(PCONDITION_VARIABLE);
++
++ConditionVariableNativeWin::ConditionVariableNativeWin() {
++}
++
++ConditionVariableNativeWin::~ConditionVariableNativeWin() {
++}
++
++ConditionVariableWrapper* ConditionVariableNativeWin::Create() {
++ ConditionVariableNativeWin* ret_val = new ConditionVariableNativeWin();
++ if (!ret_val->Init()) {
++ delete ret_val;
++ return NULL;
++ }
++ return ret_val;
++}
++
++bool ConditionVariableNativeWin::Init() {
++ if (!library) {
++ // Native implementation is supported on Vista+.
++ library = LoadLibrary(TEXT("Kernel32.dll"));
++ // TODO(henrike): this code results in an attempt to load the above dll
++ // every time the previous attempt failed. Only try to load once.
++ if (library) {
++ // TODO(henrike): not thread safe as reading and writing to library is not
++ // serialized. Fix.
++ WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Loaded Kernel.dll");
++
++ PInitializeConditionVariable_ =
++ (PInitializeConditionVariable) GetProcAddress(
++ library, "InitializeConditionVariable");
++ PSleepConditionVariableCS_ = (PSleepConditionVariableCS) GetProcAddress(
++ library, "SleepConditionVariableCS");
++ PWakeConditionVariable_ = (PWakeConditionVariable) GetProcAddress(
++ library, "WakeConditionVariable");
++ PWakeAllConditionVariable_ = (PWakeAllConditionVariable) GetProcAddress(
++ library, "WakeAllConditionVariable");
++
++ if (PInitializeConditionVariable_ && PSleepConditionVariableCS_
++ && PWakeConditionVariable_ && PWakeAllConditionVariable_) {
++ WEBRTC_TRACE(
++ kTraceStateInfo, kTraceUtility, -1,
++ "Loaded native condition variables");
++ win_support_condition_variables_primitive = true;
++ }
++ }
++ }
++ if (!win_support_condition_variables_primitive) {
++ return false;
++ }
++ PInitializeConditionVariable_(&condition_variable_);
++ return true;
++}
++
++void ConditionVariableNativeWin::SleepCS(CriticalSectionWrapper& crit_sect) {
++ SleepCS(crit_sect, INFINITE);
++}
++
++bool ConditionVariableNativeWin::SleepCS(CriticalSectionWrapper& crit_sect,
++ unsigned long max_time_in_ms) {
++ CriticalSectionWindows* cs =
++ static_cast<CriticalSectionWindows*>(&crit_sect);
++ BOOL ret_val = PSleepConditionVariableCS_(&condition_variable_,
++ &(cs->crit), max_time_in_ms);
++ return ret_val != 0;
++}
++
++void ConditionVariableNativeWin::Wake() {
++ PWakeConditionVariable_(&condition_variable_);
++}
++
++void ConditionVariableNativeWin::WakeAll() {
++ PWakeAllConditionVariable_(&condition_variable_);
++}
++
++} // namespace webrtc
+diff --git a/webrtc/system_wrappers/source/condition_variable_native_win.h b/webrtc/system_wrappers/source/condition_variable_native_win.h
+new file mode 100644
+index 0000000..c22787f
+--- /dev/null
++++ b/webrtc/system_wrappers/source/condition_variable_native_win.h
+@@ -0,0 +1,54 @@
++/*
++ * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
++ *
++ * Use of this source code is governed by a BSD-style license
++ * that can be found in the LICENSE file in the root of the source
++ * tree. An additional intellectual property rights grant can be found
++ * in the file PATENTS. All contributing project authors may
++ * be found in the AUTHORS file in the root of the source tree.
++ */
++
++#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_NATIVE_WIN_H_
++#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_NATIVE_WIN_H_
++
++#include <windows.h>
++
++#include "webrtc/system_wrappers/include/condition_variable_wrapper.h"
++
++namespace webrtc {
++
++#if !defined CONDITION_VARIABLE_INIT
++typedef struct RTL_CONDITION_VARIABLE_ {
++ void* Ptr;
++} RTL_CONDITION_VARIABLE, *PRTL_CONDITION_VARIABLE;
++
++typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;
++#endif
++
++typedef void (WINAPI* PInitializeConditionVariable)(PCONDITION_VARIABLE);
++typedef BOOL (WINAPI* PSleepConditionVariableCS)(PCONDITION_VARIABLE,
++ PCRITICAL_SECTION, DWORD);
++typedef void (WINAPI* PWakeConditionVariable)(PCONDITION_VARIABLE);
++typedef void (WINAPI* PWakeAllConditionVariable)(PCONDITION_VARIABLE);
++
++class ConditionVariableNativeWin : public ConditionVariableWrapper {
++ public:
++ static ConditionVariableWrapper* Create();
++ virtual ~ConditionVariableNativeWin();
++
++ void SleepCS(CriticalSectionWrapper& crit_sect);
++ bool SleepCS(CriticalSectionWrapper& crit_sect, unsigned long max_time_inMS);
++ void Wake();
++ void WakeAll();
++
++ private:
++ ConditionVariableNativeWin();
++
++ bool Init();
++
++ CONDITION_VARIABLE condition_variable_;
++};
++
++} // namespace webrtc
++
++#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_NATIVE_WIN_H_
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0018-Protect-against-unsupported-CPU-types.patch b/recipes/webrtc-audio-processing/0018-Protect-against-unsupported-CPU-types.patch
new file mode 100644
index 0000000..50b9232
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0018-Protect-against-unsupported-CPU-types.patch
@@ -0,0 +1,37 @@
+From 3190f90874cd577ed557b3eed0b703da48a00eab Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Tue, 5 Jul 2016 18:07:45 -0400
+Subject: [PATCH 1/4] Protect against unsupported CPU types
+
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2ca5ea9..d6c2457 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -75,7 +75,8 @@ AS_CASE(["${host}"],
+ [
+ PLATFORM_CFLAGS="-DWEBRTC_WIN -D_WIN32 -U__STRICT_ANSI__"
+ HAVE_WIN=1
+- ]
++ ],
++ [AC_MSG_ERROR([Unsupported host $host])]
+ )
+ AC_SUBST(PLATFORM_CFLAGS)
+ AM_CONDITIONAL(HAVE_POSIX, [test "x${HAVE_POSIX}" = "x1"])
+@@ -96,8 +97,9 @@ AS_CASE(["${host_cpu}"],
+ [
+ HAVE_ARM=1
+ ARCH_CFLAGS="-DWEBRTC_ARCH_ARM"
+- ]
++ ],
+ # FIXME: Add MIPS support, see webrtc/BUILD.gn for defines
++ [AC_MSG_ERROR([Unsupported CPU type $host_cpu])]
+ )
+ AM_CONDITIONAL(HAVE_X86, [test "x${HAVE_X86}" = "x1"])
+ AM_CONDITIONAL(HAVE_ARM, [test "x${HAVE_ARM}" = "x1"])
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0019-osx-Fix-type-OS_FLAGS-instead-of-OS_CFLAGS.patch b/recipes/webrtc-audio-processing/0019-osx-Fix-type-OS_FLAGS-instead-of-OS_CFLAGS.patch
new file mode 100644
index 0000000..dddc1be
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0019-osx-Fix-type-OS_FLAGS-instead-of-OS_CFLAGS.patch
@@ -0,0 +1,27 @@
+From a0ba303ba94b7af3fd176bc441119ac6eaae19b4 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Tue, 5 Jul 2016 18:44:19 -0400
+Subject: [PATCH 2/4] osx: Fix type OS_FLAGS instead of OS_CFLAGS
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d6c2457..7a8798e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -66,8 +66,8 @@ AS_CASE(["${host}"],
+ [*-*darwin*],
+ [
+ AS_IF([test "$HAVE_IOS" = "yes"],
+- [OS_FLAGS="-DWEBRTC_MAC -DWEBRTC_IOS"],
+- [OS_FLAGS="-DWEBRTC_MAC"])
++ [OS_CFLAGS="-DWEBRTC_MAC -DWEBRTC_IOS"],
++ [OS_CFLAGS="-DWEBRTC_MAC"])
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
+ HAVE_POSIX=1
+ ],
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0020-Sync-defines-and-libs-with-build.gn.patch b/recipes/webrtc-audio-processing/0020-Sync-defines-and-libs-with-build.gn.patch
new file mode 100644
index 0000000..6f9725c
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0020-Sync-defines-and-libs-with-build.gn.patch
@@ -0,0 +1,75 @@
+From 0feae482658849cdccd5b37e60aeae6c78e416e8 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Wed, 6 Jul 2016 11:32:55 -0400
+Subject: [PATCH 1/3] Sync defines and libs with build.gn
+
+---
+ configure.ac | 13 +++++++++----
+ webrtc/modules/audio_processing/Makefile.am | 2 +-
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7a8798e..2658849 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,26 +53,29 @@ AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IO
+ AS_CASE(["${host}"],
+ [*android*],
+ [
+- OS_CFLAGS="-DWEBRTC_ANDROID -DWEBRTC_LINUX"
++ OS_CFLAGS="-DWEBRTC_ANDROID -DWEBRTC_LINUX -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME"
++ OS_LDFLAGS="-llog"
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
+ HAVE_POSIX=1
+ ],
+ [*-*linux*],
+ [
+- OS_CFLAGS="-DWEBRTC_LINUX"
++ OS_CFLAGS="-DWEBRTC_LINUX -DWEBRTC_THREAD_RR"
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
++ OS_LDFLAGS="-lrt"
+ HAVE_POSIX=1
+ ],
+ [*-*darwin*],
+ [
++ OS_CFLAGS="-DWEBRTC_MAC -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME"
+ AS_IF([test "$HAVE_IOS" = "yes"],
+- [OS_CFLAGS="-DWEBRTC_MAC -DWEBRTC_IOS"],
+- [OS_CFLAGS="-DWEBRTC_MAC"])
++ [OS_CFLAGS+=" -DWEBRTC_IOS"])
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
+ HAVE_POSIX=1
+ ],
+ [*-mingw32*],
+ [
++ OS_LDFLAGS="-lwinmm"
+ PLATFORM_CFLAGS="-DWEBRTC_WIN -D_WIN32 -U__STRICT_ANSI__"
+ HAVE_WIN=1
+ ],
+@@ -133,8 +136,10 @@ AM_CONDITIONAL([HAVE_NEON], [test "x$HAVE_NEON" = "x1"])
+
+ COMMON_CFLAGS="-DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD ${PLATFORM_CFLAGS} ${OS_CFLAGS} ${ARCH_CFLAGS} -DNDEBUG -I\$(top_srcdir)"
+ COMMON_CXXFLAGS="-std=c++11 -DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD ${PLATFORM_CFLAGS} ${OS_CFLAGS} ${ARCH_CFLAGS} ${GNUSTL_CFLAGS} -DNDEBUG -I\$(top_srcdir)"
++COMMON_LDFLAGS="${OS_LDFLAGS}"
+ AC_SUBST([COMMON_CFLAGS])
+ AC_SUBST([COMMON_CXXFLAGS])
++AC_SUBST([COMMON_LDFLAGS])
+
+ AC_CONFIG_FILES([
+ webrtc-audio-processing.pc
+diff --git a/webrtc/modules/audio_processing/Makefile.am b/webrtc/modules/audio_processing/Makefile.am
+index 8e45e3d..de259f0 100644
+--- a/webrtc/modules/audio_processing/Makefile.am
++++ b/webrtc/modules/audio_processing/Makefile.am
+@@ -174,7 +174,7 @@ libwebrtc_audio_processing_la_LIBADD = $(top_builddir)/webrtc/libwebrtc.la \
+ $(top_builddir)/webrtc/modules/audio_coding/libaudio_coding.la \
+ $(LIBWEBRTC_PRIVATEARCH) \
+ $(GNUSTL_LIBS)
+-libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) \
++libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) $(COMMON_LDFLAGS) \
+ -Wl,--no-undefined \
+ -version-info $(LIBWEBRTC_AUDIO_PROCESSING_VERSION_INFO)
+
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0021-Use-no-undefined-to-support-both-clang-and-gcc.patch b/recipes/webrtc-audio-processing/0021-Use-no-undefined-to-support-both-clang-and-gcc.patch
new file mode 100644
index 0000000..812cd64
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0021-Use-no-undefined-to-support-both-clang-and-gcc.patch
@@ -0,0 +1,25 @@
+From 01ad1123b46a8a1dda8c56cf9f632ef73526196b Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Wed, 6 Jul 2016 13:44:15 -0400
+Subject: [PATCH 2/3] Use -no-undefined to support both clang and gcc
+
+---
+ webrtc/modules/audio_processing/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/webrtc/modules/audio_processing/Makefile.am b/webrtc/modules/audio_processing/Makefile.am
+index de259f0..5a98913 100644
+--- a/webrtc/modules/audio_processing/Makefile.am
++++ b/webrtc/modules/audio_processing/Makefile.am
+@@ -175,7 +175,7 @@ libwebrtc_audio_processing_la_LIBADD = $(top_builddir)/webrtc/libwebrtc.la \
+ $(LIBWEBRTC_PRIVATEARCH) \
+ $(GNUSTL_LIBS)
+ libwebrtc_audio_processing_la_LDFLAGS = $(AM_LDFLAGS) $(COMMON_LDFLAGS) \
+- -Wl,--no-undefined \
++ -no-undefined \
+ -version-info $(LIBWEBRTC_AUDIO_PROCESSING_VERSION_INFO)
+
+ # FIXME: The MIPS optimisations need to be hooked up once we have the
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0022-Re-add-pthread-linking-on-linux.patch b/recipes/webrtc-audio-processing/0022-Re-add-pthread-linking-on-linux.patch
new file mode 100644
index 0000000..461f490
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0022-Re-add-pthread-linking-on-linux.patch
@@ -0,0 +1,25 @@
+From 3d3a874a75bef020dcdb30e20c722b5a159c1ee1 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Wed, 6 Jul 2016 13:57:00 -0400
+Subject: [PATCH 3/3] Re-add pthread linking on linux
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2658849..5aab9e6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -62,7 +62,7 @@ AS_CASE(["${host}"],
+ [
+ OS_CFLAGS="-DWEBRTC_LINUX -DWEBRTC_THREAD_RR"
+ PLATFORM_CFLAGS="-DWEBRTC_POSIX"
+- OS_LDFLAGS="-lrt"
++ OS_LDFLAGS="-lrt -lpthread"
+ HAVE_POSIX=1
+ ],
+ [*-*darwin*],
+--
+2.7.4
+
diff --git a/recipes/webrtc-audio-processing/0023-Add-ARM-64bit-support.patch b/recipes/webrtc-audio-processing/0023-Add-ARM-64bit-support.patch
new file mode 100644
index 0000000..de6e14b
--- /dev/null
+++ b/recipes/webrtc-audio-processing/0023-Add-ARM-64bit-support.patch
@@ -0,0 +1,28 @@
+From 37962a1bb1f0bd1b8eed28ced4a5bc4190934107 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Wed, 6 Jul 2016 15:18:15 -0400
+Subject: [PATCH] Add ARM 64bit support
+
+---
+ configure.ac | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 5aab9e6..e2b0f3b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -101,6 +101,11 @@ AS_CASE(["${host_cpu}"],
+ HAVE_ARM=1
+ ARCH_CFLAGS="-DWEBRTC_ARCH_ARM"
+ ],
++ [aarch64*],
++ [
++ HAVE_NEON=1
++ ARCH_CFLAGS="-DWEBRTC_HAS_NEON -DWEBRTC_ARCH_ARM64"
++ ],
+ # FIXME: Add MIPS support, see webrtc/BUILD.gn for defines
+ [AC_MSG_ERROR([Unsupported CPU type $host_cpu])]
+ )
+--
+2.7.4
+