diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn index 41ca820099..7a0bce0736 100644 --- a/webrtc/modules/audio_device/BUILD.gn +++ b/webrtc/modules/audio_device/BUILD.gn @@ -110,10 +110,6 @@ rtc_static_library("audio_device") { "android/audio_track_jni.h", "android/build_info.cc", "android/build_info.h", - "android/helpers_android.cc", - "android/helpers_android.h", - "android/jvm_android.cc", - "android/jvm_android.h", "android/opensles_common.cc", "android/opensles_common.h", "android/opensles_player.cc", diff --git a/webrtc/modules/audio_device/android/audio_manager.cc b/webrtc/modules/audio_device/android/audio_manager.cc index 1081e7fbc1..6925c3d614 100644 --- a/webrtc/modules/audio_device/android/audio_manager.cc +++ b/webrtc/modules/audio_device/android/audio_manager.cc @@ -17,7 +17,7 @@ #include "webrtc/base/arraysize.h" #include "webrtc/base/checks.h" #include "webrtc/modules/audio_device/android/audio_common.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" +#include "webrtc/modules/utility/include/helpers_android.h" #define TAG "AudioManager" #define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, TAG, __VA_ARGS__) diff --git a/webrtc/modules/audio_device/android/audio_manager.h b/webrtc/modules/audio_device/android/audio_manager.h index e03159190a..6540cc505d 100644 --- a/webrtc/modules/audio_device/android/audio_manager.h +++ b/webrtc/modules/audio_device/android/audio_manager.h @@ -18,12 +18,12 @@ #include "webrtc/base/thread_checker.h" #include "webrtc/modules/audio_device/android/audio_common.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" -#include "webrtc/modules/audio_device/android/jvm_android.h" -#include "webrtc/modules/audio_device/android/opensles_common.h" #include "webrtc/modules/audio_device/audio_device_config.h" -#include "webrtc/modules/audio_device/audio_device_generic.h" #include "webrtc/modules/audio_device/include/audio_device_defines.h" +#include "webrtc/modules/audio_device/android/opensles_common.h" +#include "webrtc/modules/audio_device/audio_device_generic.h" +#include "webrtc/modules/utility/include/helpers_android.h" +#include "webrtc/modules/utility/include/jvm_android.h" namespace webrtc { diff --git a/webrtc/modules/audio_device/android/audio_record_jni.h b/webrtc/modules/audio_device/android/audio_record_jni.h index 49469e6f93..3a1a94aa41 100644 --- a/webrtc/modules/audio_device/android/audio_record_jni.h +++ b/webrtc/modules/audio_device/android/audio_record_jni.h @@ -17,10 +17,10 @@ #include "webrtc/base/thread_checker.h" #include "webrtc/modules/audio_device/android/audio_manager.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" -#include "webrtc/modules/audio_device/android/jvm_android.h" -#include "webrtc/modules/audio_device/audio_device_generic.h" #include "webrtc/modules/audio_device/include/audio_device_defines.h" +#include "webrtc/modules/audio_device/audio_device_generic.h" +#include "webrtc/modules/utility/include/helpers_android.h" +#include "webrtc/modules/utility/include/jvm_android.h" namespace webrtc { diff --git a/webrtc/modules/audio_device/android/audio_track_jni.h b/webrtc/modules/audio_device/android/audio_track_jni.h index a80dec2c30..2c78a5901c 100644 --- a/webrtc/modules/audio_device/android/audio_track_jni.h +++ b/webrtc/modules/audio_device/android/audio_track_jni.h @@ -18,10 +18,10 @@ #include "webrtc/base/thread_checker.h" #include "webrtc/modules/audio_device/android/audio_common.h" #include "webrtc/modules/audio_device/android/audio_manager.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" -#include "webrtc/modules/audio_device/android/jvm_android.h" -#include "webrtc/modules/audio_device/audio_device_generic.h" #include "webrtc/modules/audio_device/include/audio_device_defines.h" +#include "webrtc/modules/audio_device/audio_device_generic.h" +#include "webrtc/modules/utility/include/helpers_android.h" +#include "webrtc/modules/utility/include/jvm_android.h" namespace webrtc { diff --git a/webrtc/modules/audio_device/android/build_info.cc b/webrtc/modules/audio_device/android/build_info.cc index d983a58504..3628e408e5 100644 --- a/webrtc/modules/audio_device/android/build_info.cc +++ b/webrtc/modules/audio_device/android/build_info.cc @@ -10,7 +10,7 @@ #include "webrtc/modules/audio_device/android/build_info.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" +#include "webrtc/modules/utility/include/helpers_android.h" namespace webrtc { diff --git a/webrtc/modules/audio_device/android/build_info.h b/webrtc/modules/audio_device/android/build_info.h index 92fb2ea380..d9640dd7bf 100644 --- a/webrtc/modules/audio_device/android/build_info.h +++ b/webrtc/modules/audio_device/android/build_info.h @@ -15,7 +15,7 @@ #include #include -#include "webrtc/modules/audio_device/android/jvm_android.h" +#include "webrtc/modules/utility/include/jvm_android.h" namespace webrtc { diff --git a/webrtc/modules/audio_device/android/ensure_initialized.cc b/webrtc/modules/audio_device/android/ensure_initialized.cc index febfb2024f..9bc08ab196 100644 --- a/webrtc/modules/audio_device/android/ensure_initialized.cc +++ b/webrtc/modules/audio_device/android/ensure_initialized.cc @@ -23,7 +23,7 @@ RTC_POP_IGNORING_WUNDEF() #include "webrtc/base/checks.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/jvm_android.h" +#include "webrtc/modules/utility/include/jvm_android.h" namespace webrtc { namespace audiodevicemodule { diff --git a/webrtc/modules/audio_device/android/opensles_player.h b/webrtc/modules/audio_device/android/opensles_player.h index 6fe1c11672..62de50eacd 100644 --- a/webrtc/modules/audio_device/android/opensles_player.h +++ b/webrtc/modules/audio_device/android/opensles_player.h @@ -18,10 +18,10 @@ #include "webrtc/base/thread_checker.h" #include "webrtc/modules/audio_device/android/audio_common.h" #include "webrtc/modules/audio_device/android/audio_manager.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" #include "webrtc/modules/audio_device/android/opensles_common.h" -#include "webrtc/modules/audio_device/audio_device_generic.h" #include "webrtc/modules/audio_device/include/audio_device_defines.h" +#include "webrtc/modules/audio_device/audio_device_generic.h" +#include "webrtc/modules/utility/include/helpers_android.h" namespace webrtc { diff --git a/webrtc/modules/audio_device/android/opensles_recorder.h b/webrtc/modules/audio_device/android/opensles_recorder.h index 158d3a87f9..952371a43a 100644 --- a/webrtc/modules/audio_device/android/opensles_recorder.h +++ b/webrtc/modules/audio_device/android/opensles_recorder.h @@ -20,10 +20,10 @@ #include "webrtc/base/thread_checker.h" #include "webrtc/modules/audio_device/android/audio_common.h" #include "webrtc/modules/audio_device/android/audio_manager.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" #include "webrtc/modules/audio_device/android/opensles_common.h" -#include "webrtc/modules/audio_device/audio_device_generic.h" #include "webrtc/modules/audio_device/include/audio_device_defines.h" +#include "webrtc/modules/audio_device/audio_device_generic.h" +#include "webrtc/modules/utility/include/helpers_android.h" namespace webrtc { diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn index a648748d37..b8f5f2ebaf 100644 --- a/webrtc/modules/utility/BUILD.gn +++ b/webrtc/modules/utility/BUILD.gn @@ -13,12 +13,16 @@ rtc_static_library("utility") { "include/audio_frame_operations.h", "include/file_player.h", "include/file_recorder.h", + "include/helpers_android.h", + "include/jvm_android.h", "include/process_thread.h", "source/audio_frame_operations.cc", "source/coder.cc", "source/coder.h", "source/file_player.cc", "source/file_recorder.cc", + "source/helpers_android.cc", + "source/jvm_android.cc", "source/process_thread_impl.cc", "source/process_thread_impl.h", ] diff --git a/webrtc/modules/audio_device/android/helpers_android.h b/webrtc/modules/utility/include/helpers_android.h similarity index 91% rename from webrtc/modules/audio_device/android/helpers_android.h rename to webrtc/modules/utility/include/helpers_android.h index 5833497f38..2840ca965e 100644 --- a/webrtc/modules/audio_device/android/helpers_android.h +++ b/webrtc/modules/utility/include/helpers_android.h @@ -8,14 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_HELPERS_ANDROID_H_ -#define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_HELPERS_ANDROID_H_ +#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_ANDROID_H_ +#define WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_ANDROID_H_ #include #include -#include "webrtc/base/checks.h" - // Abort the process if |jni| has a Java exception pending. // TODO(henrika): merge with CHECK_JNI_EXCEPTION() in jni_helpers.h. #define CHECK_EXCEPTION(jni) \ @@ -86,4 +84,4 @@ class ScopedGlobalRef { } // namespace webrtc -#endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_HELPERS_ANDROID_H_ +#endif // WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_ANDROID_H_ diff --git a/webrtc/modules/audio_device/android/jvm_android.h b/webrtc/modules/utility/include/jvm_android.h similarity index 96% rename from webrtc/modules/audio_device/android/jvm_android.h rename to webrtc/modules/utility/include/jvm_android.h index 0620ad31bb..51a0bd841a 100644 --- a/webrtc/modules/audio_device/android/jvm_android.h +++ b/webrtc/modules/utility/include/jvm_android.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_JVM_ANDROID_H_ -#define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_JVM_ANDROID_H_ +#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_ +#define WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_ #include @@ -17,7 +17,7 @@ #include #include "webrtc/base/thread_checker.h" -#include "webrtc/modules/audio_device/android/helpers_android.h" +#include "webrtc/modules/utility/include/helpers_android.h" namespace webrtc { @@ -184,4 +184,4 @@ class JVM { } // namespace webrtc -#endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_JVM_ANDROID_H_ +#endif // WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_ diff --git a/webrtc/modules/audio_device/android/helpers_android.cc b/webrtc/modules/utility/source/helpers_android.cc similarity index 96% rename from webrtc/modules/audio_device/android/helpers_android.cc rename to webrtc/modules/utility/source/helpers_android.cc index 5e5b1a9ef4..aea35f8d5a 100644 --- a/webrtc/modules/audio_device/android/helpers_android.cc +++ b/webrtc/modules/utility/source/helpers_android.cc @@ -8,7 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/audio_device/android/helpers_android.h" +#include "webrtc/base/checks.h" +#include "webrtc/modules/utility/include/helpers_android.h" #include #include @@ -44,7 +45,7 @@ jlong PointerTojlong(void* ptr) { return ret; } -jmethodID GetMethodID( +jmethodID GetMethodID ( JNIEnv* jni, jclass c, const char* name, const char* signature) { jmethodID m = jni->GetMethodID(c, name, signature); CHECK_EXCEPTION(jni) << "Error during GetMethodID: " << name << ", " @@ -53,7 +54,7 @@ jmethodID GetMethodID( return m; } -jmethodID GetStaticMethodID( +jmethodID GetStaticMethodID ( JNIEnv* jni, jclass c, const char* name, const char* signature) { jmethodID m = jni->GetStaticMethodID(c, name, signature); CHECK_EXCEPTION(jni) << "Error during GetStaticMethodID: " << name << ", " diff --git a/webrtc/modules/audio_device/android/jvm_android.cc b/webrtc/modules/utility/source/jvm_android.cc similarity index 99% rename from webrtc/modules/audio_device/android/jvm_android.cc rename to webrtc/modules/utility/source/jvm_android.cc index 832f86983b..9d08688700 100644 --- a/webrtc/modules/audio_device/android/jvm_android.cc +++ b/webrtc/modules/utility/source/jvm_android.cc @@ -12,7 +12,7 @@ #include -#include "webrtc/modules/audio_device/android/jvm_android.h" +#include "webrtc/modules/utility/include/jvm_android.h" #include "webrtc/base/checks.h" diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn index 4fed648a74..919708e241 100644 --- a/webrtc/voice_engine/BUILD.gn +++ b/webrtc/voice_engine/BUILD.gn @@ -195,6 +195,7 @@ if (rtc_include_tests) { "//webrtc/modules/audio_processing", "//webrtc/modules/media_file", "//webrtc/modules/rtp_rtcp", + "//webrtc/modules/utility", "//webrtc/system_wrappers", "//webrtc/test:test_support_main", ] diff --git a/webrtc/voice_engine/voice_engine_impl.cc b/webrtc/voice_engine/voice_engine_impl.cc index 4dda4663f8..5b92d27313 100644 --- a/webrtc/voice_engine/voice_engine_impl.cc +++ b/webrtc/voice_engine/voice_engine_impl.cc @@ -9,7 +9,10 @@ */ #if defined(WEBRTC_ANDROID) -#include "webrtc/modules/audio_device/android/jvm_android.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/utility/include/jvm_android.h" #endif #include "webrtc/base/checks.h"