diff --git a/src/modules/audio_processing/Android.mk b/src/modules/audio_processing/Android.mk index c03c1b0fc9..7b2a499752 100644 --- a/src/modules/audio_processing/Android.mk +++ b/src/modules/audio_processing/Android.mk @@ -33,7 +33,9 @@ LOCAL_SRC_FILES := \ # Flags passed to both C and C++ files. LOCAL_CFLAGS := \ $(MY_WEBRTC_COMMON_DEFS) \ - '-DWEBRTC_NS_FIXED' + '-DWEBRTC_NS_FIXED' \ + '-DWEBRTC_ANDROID_PLATFORM_BUILD' \ + '-DWEBRTC_AUDIOPROC_DEBUG_DUMP' # floating point # -DWEBRTC_NS_FLOAT' @@ -59,3 +61,89 @@ ifndef NDK_ROOT include external/stlport/libstlport.mk endif include $(BUILD_STATIC_LIBRARY) + +# apm process test app + +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := tests +LOCAL_CPP_EXTENSION := .cc +LOCAL_SRC_FILES:= \ + $(call all-proto-files-under, .) \ + test/process_test.cc + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) \ + '-DWEBRTC_ANDROID_PLATFORM_BUILD' \ + '-DWEBRTC_AUDIOPROC_DEBUG_DUMP' + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/../interface \ + $(LOCAL_PATH)/../.. \ + $(LOCAL_PATH)/../../system_wrappers/interface \ + external/gtest/include + +LOCAL_STATIC_LIBRARIES := \ + libgtest \ + libprotobuf-cpp-2.3.0-lite + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libstlport \ + libwebrtc_audio_preprocessing + +LOCAL_MODULE:= webrtc_audioproc + +ifdef NDK_ROOT +include $(BUILD_EXECUTABLE) +else +include external/stlport/libstlport.mk +include $(BUILD_NATIVE_TEST) +endif + +# apm unit test app + +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := tests +LOCAL_CPP_EXTENSION := .cc +LOCAL_SRC_FILES:= \ + $(call all-proto-files-under, test) \ + test/unit_test.cc \ + ../../../test/testsupport/fileutils.cc + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) \ + '-DWEBRTC_AUDIOPROC_FIXED_PROFILE' \ + '-DWEBRTC_ANDROID_PLATFORM_BUILD' \ + '-DWEBRTC_AUDIOPROC_DEBUG_DUMP' + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/../interface \ + $(LOCAL_PATH)/../.. \ + $(LOCAL_PATH)/../../../test \ + $(LOCAL_PATH)/../../system_wrappers/interface \ + $(LOCAL_PATH)/../../common_audio/signal_processing/include \ + external/gtest/include \ + external/protobuf/src + +LOCAL_STATIC_LIBRARIES := \ + libgtest \ + libprotobuf-cpp-2.3.0-lite + +LOCAL_SHARED_LIBRARIES := \ + libstlport \ + libwebrtc_audio_preprocessing + +LOCAL_MODULE:= webrtc_audioproc_unittest + +ifdef NDK_ROOT +include $(BUILD_EXECUTABLE) +else +include external/stlport/libstlport.mk +include $(BUILD_NATIVE_TEST) +endif diff --git a/src/modules/audio_processing/audio_processing_impl.cc b/src/modules/audio_processing/audio_processing_impl.cc index 2dea0e93a2..f1f2f48591 100644 --- a/src/modules/audio_processing/audio_processing_impl.cc +++ b/src/modules/audio_processing/audio_processing_impl.cc @@ -28,7 +28,7 @@ #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP // Files generated at build-time by the protobuf compiler. -#ifdef WEBRTC_ANDROID +#ifdef WEBRTC_ANDROID_PLATFORM_BUILD #include "external/webrtc/src/modules/audio_processing/debug.pb.h" #else #include "webrtc/audio_processing/debug.pb.h" diff --git a/src/modules/audio_processing/test/process_test.cc b/src/modules/audio_processing/test/process_test.cc index d4841c721a..7ebf8adac3 100644 --- a/src/modules/audio_processing/test/process_test.cc +++ b/src/modules/audio_processing/test/process_test.cc @@ -21,9 +21,11 @@ #include "module_common_types.h" #include "scoped_ptr.h" #include "tick_util.h" - +#ifdef WEBRTC_ANDROID_PLATFORM_BUILD +#include "external/webrtc/src/modules/audio_processing/debug.pb.h" +#else #include "webrtc/audio_processing/debug.pb.h" - +#endif using webrtc::AudioFrame; using webrtc::AudioProcessing; diff --git a/src/modules/audio_processing/test/unit_test.cc b/src/modules/audio_processing/test/unit_test.cc index 573fd8ddd5..00161a614e 100644 --- a/src/modules/audio_processing/test/unit_test.cc +++ b/src/modules/audio_processing/test/unit_test.cc @@ -20,8 +20,11 @@ #include "testsupport/fileutils.h" #include "thread_wrapper.h" #include "trace.h" +#ifdef WEBRTC_ANDROID_PLATFORM_BUILD +#include "external/webrtc/src/modules/audio_processing/test/unittest.pb.h" +#else #include "webrtc/audio_processing/unittest.pb.h" - +#endif #if (defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)) || \ (defined(WEBRTC_LINUX) && defined(WEBRTC_ARCH_X86_64) && !defined(NDEBUG))