diff --git a/OWNERS b/OWNERS index acedc548b..36d9928e7 100644 --- a/OWNERS +++ b/OWNERS @@ -9,3 +9,4 @@ per-file .gitignore=* per-file AUTHORS=* per-file DEPS=* per-file WATCHLISTS=* +per-file webrtc_examples.gyp=* diff --git a/webrtc/examples/OWNERS b/webrtc/examples/OWNERS new file mode 100644 index 000000000..5c2e16824 --- /dev/null +++ b/webrtc/examples/OWNERS @@ -0,0 +1,2 @@ +fischman@webrtc.org +henrike@webrtc.org \ No newline at end of file diff --git a/webrtc/modules/audio_device/android/test/AndroidManifest.xml b/webrtc/examples/android/opensl_loopback/AndroidManifest.xml similarity index 100% rename from webrtc/modules/audio_device/android/test/AndroidManifest.xml rename to webrtc/examples/android/opensl_loopback/AndroidManifest.xml diff --git a/webrtc/modules/audio_device/android/test/README b/webrtc/examples/android/opensl_loopback/README similarity index 100% rename from webrtc/modules/audio_device/android/test/README rename to webrtc/examples/android/opensl_loopback/README diff --git a/webrtc/modules/audio_device/android/test/build.xml b/webrtc/examples/android/opensl_loopback/build.xml similarity index 100% rename from webrtc/modules/audio_device/android/test/build.xml rename to webrtc/examples/android/opensl_loopback/build.xml diff --git a/webrtc/modules/audio_device/android/test/fake_audio_device_buffer.cc b/webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.cc similarity index 97% rename from webrtc/modules/audio_device/android/test/fake_audio_device_buffer.cc rename to webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.cc index c12849c9d..81adc8ff9 100644 --- a/webrtc/modules/audio_device/android/test/fake_audio_device_buffer.cc +++ b/webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.cc @@ -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 diff --git a/webrtc/modules/audio_device/android/test/fake_audio_device_buffer.h b/webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.h similarity index 90% rename from webrtc/modules/audio_device/android/test/fake_audio_device_buffer.h rename to webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.h index 9372e2940..b98ee1e81 100644 --- a/webrtc/modules/audio_device/android/test/fake_audio_device_buffer.h +++ b/webrtc/examples/android/opensl_loopback/fake_audio_device_buffer.h @@ -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_ diff --git a/webrtc/modules/audio_device/android/test/jni/opensl_runner.cc b/webrtc/examples/android/opensl_loopback/jni/opensl_runner.cc similarity index 94% rename from webrtc/modules/audio_device/android/test/jni/opensl_runner.cc rename to webrtc/examples/android/opensl_loopback/jni/opensl_runner.cc index 9d013300d..5b7c09234 100644 --- a/webrtc/modules/audio_device/android/test/jni/opensl_runner.cc +++ b/webrtc/examples/android/opensl_loopback/jni/opensl_runner.cc @@ -11,12 +11,12 @@ #include #include +#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(); diff --git a/webrtc/modules/audio_device/android/test/project.properties b/webrtc/examples/android/opensl_loopback/project.properties similarity index 100% rename from webrtc/modules/audio_device/android/test/project.properties rename to webrtc/examples/android/opensl_loopback/project.properties diff --git a/webrtc/modules/audio_device/android/test/res/drawable/logo.png b/webrtc/examples/android/opensl_loopback/res/drawable/logo.png similarity index 100% rename from webrtc/modules/audio_device/android/test/res/drawable/logo.png rename to webrtc/examples/android/opensl_loopback/res/drawable/logo.png diff --git a/webrtc/modules/audio_device/android/test/res/layout/open_sl_demo.xml b/webrtc/examples/android/opensl_loopback/res/layout/open_sl_demo.xml similarity index 100% rename from webrtc/modules/audio_device/android/test/res/layout/open_sl_demo.xml rename to webrtc/examples/android/opensl_loopback/res/layout/open_sl_demo.xml diff --git a/webrtc/modules/audio_device/android/test/res/values/strings.xml b/webrtc/examples/android/opensl_loopback/res/values/strings.xml similarity index 100% rename from webrtc/modules/audio_device/android/test/res/values/strings.xml rename to webrtc/examples/android/opensl_loopback/res/values/strings.xml diff --git a/webrtc/modules/audio_device/android/test/src/org/webrtc/app/OpenSlDemo.java b/webrtc/examples/android/opensl_loopback/src/org/webrtc/app/OpenSlDemo.java similarity index 100% rename from webrtc/modules/audio_device/android/test/src/org/webrtc/app/OpenSlDemo.java rename to webrtc/examples/android/opensl_loopback/src/org/webrtc/app/OpenSlDemo.java diff --git a/webrtc/modules/audio_device/android/test/src/org/webrtc/app/OpenSlRunner.java b/webrtc/examples/android/opensl_loopback/src/org/webrtc/app/OpenSlRunner.java similarity index 100% rename from webrtc/modules/audio_device/android/test/src/org/webrtc/app/OpenSlRunner.java rename to webrtc/examples/android/opensl_loopback/src/org/webrtc/app/OpenSlRunner.java diff --git a/webrtc/modules/audio_device/audio_device.gypi b/webrtc/modules/audio_device/audio_device.gypi index de008e885..944f4222d 100644 --- a/webrtc/modules/audio_device/audio_device.gypi +++ b/webrtc/modules/audio_device/audio_device.gypi @@ -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', - ' /dev/null && ' - 'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)' - ], - }, - ], - }], - }], ['OS=="android" and enable_android_opensl==1', { 'targets': [ { diff --git a/webrtc/webrtc_examples.gyp b/webrtc/webrtc_examples.gyp index 328681af6..a7565ae9c 100644 --- a/webrtc/webrtc_examples.gyp +++ b/webrtc/webrtc_examples.gyp @@ -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', + ' /dev/null && ' + 'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)' + ], + }, + ], + }, ], }], ],