Adding support for OpenSL ES output in native WebRTC

BUG=4573,2982,2175,3590
TEST=modules_unittests --gtest_filter=AudioDevice*, AppRTCDemo and WebRTCDemo

Summary:

- Removes dependency of the 'enable_android_opensl' compiler flag.
  Instead, OpenSL ES is always supported, and will enabled for devices that
  supports low-latency output.
- WebRTC no longer supports OpenSL ES for the input/recording side.
- Removes old code and demos using OpenSL ES for audio input.
- Improves accuracy of total delay estimates (better AEC performance).
- Reduces roundtrip audio latency; especially when OpenSL can be used.

Performance verified on: Nexus 5, 6, 7 and 9. Samsung Galaxy S4 and S6.
Android One device.

R=magjed@webrtc.org, phoglund@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/51759004

Cr-Commit-Position: refs/heads/master@{#9208}
This commit is contained in:
henrika
2015-05-18 16:49:16 +02:00
parent 02c9b36733
commit b26198972c
66 changed files with 2324 additions and 3660 deletions

View File

@ -90,68 +90,6 @@
},
],
},
{
'target_name': 'libopensl-demo-jni',
'type': 'loadable_module',
'dependencies': [
'<(webrtc_root)/modules/modules.gyp:audio_device',
],
'sources': [
'examples/android/opensl_loopback/jni/opensl_runner.cc',
'examples/android/opensl_loopback/fake_audio_device_buffer.cc',
],
'link_settings': {
'libraries': [
'-llog',
'-lOpenSLES',
],
},
},
{
'target_name': 'OpenSlDemo',
'type': 'none',
'dependencies': [
'libopensl-demo-jni',
'<(modules_java_gyp_path):*',
],
'actions': [
{
# TODO(henrik): Convert building of the demo to a proper GYP
# target so this action is not needed once chromium's
# apk-building machinery can be used. (crbug.com/225101)
'action_name': 'build_opensldemo_apk',
'variables': {
'android_opensl_demo_root': '<(webrtc_root)/examples/android/opensl_loopback',
'ant_log': '../../../<(INTERMEDIATE_DIR)/ant.log', # ../../.. to compensate for the cd below.
},
'inputs' : [
'<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar',
'<(PRODUCT_DIR)/libopensl-demo-jni.so',
'<!@(find <(android_opensl_demo_root)/src -name "*.java")',
'<!@(find <(android_opensl_demo_root)/res -name "*.xml")',
'<!@(find <(android_opensl_demo_root)/res -name "*.png")',
'<(android_opensl_demo_root)/AndroidManifest.xml',
'<(android_opensl_demo_root)/build.xml',
'<(android_opensl_demo_root)/project.properties',
],
'outputs': ['<(PRODUCT_DIR)/OpenSlDemo-debug.apk'],
'action': [
'bash', '-ec',
'rm -fr <(_outputs) <(android_opensl_demo_root)/{bin,libs,gen,obj} && '
'mkdir -p <(android_opensl_demo_root)/libs/<(android_app_abi) && '
'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below
'<(android_strip) -o <(android_opensl_demo_root)/libs/<(android_app_abi)/libopensl-demo-jni.so <(PRODUCT_DIR)/libopensl-demo-jni.so && '
'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_opensl_demo_root)/libs/ &&'
'cd <(android_opensl_demo_root) && '
'{ ANDROID_SDK_ROOT=<(android_sdk_root) '
'ant debug > <(ant_log) 2>&1 || '
' { cat <(ant_log) ; exit 1; } } && '
'cd - > /dev/null && '
'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)'
],
},
],
},
],
}],
],