Android, OpenSlDemo: moved to webrtc/examples/android/opensl_loopback

BUG=N/A
R=andrew@webrtc.org, fischman@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5400 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2014-01-17 23:12:51 +00:00
parent 4985927d36
commit 32c26eb90b
16 changed files with 69 additions and 72 deletions

1
OWNERS
View File

@ -9,3 +9,4 @@ per-file .gitignore=*
per-file AUTHORS=*
per-file DEPS=*
per-file WATCHLISTS=*
per-file webrtc_examples.gyp=*

2
webrtc/examples/OWNERS Normal file
View File

@ -0,0 +1,2 @@
fischman@webrtc.org
henrike@webrtc.org

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "webrtc/modules/audio_device/android/test/fake_audio_device_buffer.h"
#include "webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.h"
#include <assert.h>

View File

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_FAKE_AUDIO_DEVICE_BUFFER_H_
#define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_FAKE_AUDIO_DEVICE_BUFFER_H_
#ifndef WEBRTC_EXAMPLES_ANDROID_OPENSL_LOOPBACK_FAKE_AUDIO_DEVICE_BUFFER_H_
#define WEBRTC_EXAMPLES_ANDROID_OPENSL_LOOPBACK_FAKE_AUDIO_DEVICE_BUFFER_H_
#include "webrtc/modules/audio_device/android/audio_manager_jni.h"
#include "webrtc/modules/audio_device/android/single_rw_fifo.h"
@ -64,4 +64,4 @@ class FakeAudioDeviceBuffer : public AudioDeviceBuffer {
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_FAKE_AUDIO_DEVICE_BUFFER_H_
#endif // WEBRTC_EXAMPLES_ANDROID_OPENSL_LOOPBACK_FAKE_AUDIO_DEVICE_BUFFER_H_

View File

@ -11,12 +11,12 @@
#include <assert.h>
#include <jni.h>
#include "webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.h"
#include "webrtc/modules/audio_device/android/audio_device_template.h"
#include "webrtc/modules/audio_device/android/audio_record_jni.h"
#include "webrtc/modules/audio_device/android/audio_track_jni.h"
#include "webrtc/modules/audio_device/android/opensles_input.h"
#include "webrtc/modules/audio_device/android/opensles_output.h"
#include "webrtc/modules/audio_device/android/test/fake_audio_device_buffer.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
// Java globals
@ -84,8 +84,6 @@ class OpenSlRunner
jobject obj,
jobject context) {
assert(!g_runner); // Should only be called once.
// Register the application context in the superclass to avoid having to
// qualify the template instantiation again.
OpenSlesInput::SetAndroidAudioDeviceObjects(g_vm, env, context);
OpenSlesOutput::SetAndroidAudioDeviceObjects(g_vm, env, context);
g_runner = new OpenSlRunner();

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -246,70 +246,6 @@
},
],
}],
['OS=="android"', {
'targets': [
{
'target_name': 'libopensl-demo-jni',
'type': 'loadable_module',
'dependencies': [
'audio_device',
],
'sources': [
'android/test/jni/opensl_runner.cc',
'android/test/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)/modules/audio_device/android/test',
'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 -f <(_outputs) && '
'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) && '
'{ ant -q -l <(ant_log) debug || '
' { cat <(ant_log) ; exit 1; } } && '
'cd - > /dev/null && '
'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)'
],
},
],
}],
}],
['OS=="android" and enable_android_opensl==1', {
'targets': [
{

View File

@ -7,7 +7,6 @@
# be found in the AUTHORS file in the root of the source tree.
{
'includes': ['build/common.gypi'],
'conditions': [
['OS=="android"', {
'targets': [
@ -83,6 +82,67 @@
},
],
},
{
'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 -f <(_outputs) && '
'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) && '
'{ ant -q -l <(ant_log) debug || '
' { cat <(ant_log) ; exit 1; } } && '
'cd - > /dev/null && '
'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)'
],
},
],
},
],
}],
],