Merge "fix b/62040757 - bad pointer to native audioplayer in 32-bit builds." into oc-dev
am: 453b68a9b8
Change-Id: Ia8bbc73911c0bcb9c1ec53bb4feb3224fa425a39
diff --git a/Android.bp b/Android.bp
index 9ccad83..f8f354d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -28,7 +28,7 @@
}
ndk_headers {
- name: "libOpenSLES_headers",
+ name: "libOpenSLES_ndk_headers",
from: "include",
to: "",
srcs: ["include/SLES/**/*.h"], // All headers in all subdirs.
@@ -41,3 +41,13 @@
first_version: "9",
unversioned_until: "current",
}
+
+cc_library_headers {
+ name: "libOpenSLES_headers",
+ export_include_dirs: ["include"],
+}
+
+subdirs = [
+ "src",
+ "tests",
+]
diff --git a/src/Android.bp b/src/Android.bp
new file mode 100644
index 0000000..8e0f6eb
--- /dev/null
+++ b/src/Android.bp
@@ -0,0 +1,282 @@
+cc_library_static {
+ name: "libOpenSLESUT",
+
+ srcs: [
+ "assert.cpp",
+ "ut/OpenSLESUT.c",
+ "ut/slesutResult.c",
+ ],
+
+ header_libs: ["libOpenSLES_headers"],
+ export_header_lib_headers: ["libOpenSLES_headers"],
+ export_include_dirs: ["ut"],
+
+ cflags: [
+ "-fvisibility=hidden",
+ "-UNDEBUG",
+
+ "-Wall",
+ "-Werror",
+ ],
+}
+
+cc_library_static {
+ name: "libopensles_helper",
+
+ header_libs: ["libOpenSLES_headers"],
+ export_header_lib_headers: ["libOpenSLES_headers"],
+
+ cflags: [
+ "-Wno-initializer-overrides",
+ //"-Wno-missing-field-initializers",
+ // optional, see comments in MPH_to.c:
+ //"-DUSE_DESIGNATED_INITIALIZERS",
+ //"-S",
+ // and also see ../tools/mphgen/Makefile
+ "-DUSE_DESIGNATED_INITIALIZERS",
+ "-UNDEBUG",
+
+ "-Wall",
+ "-Werror",
+ ],
+
+ srcs: [
+ "assert.cpp",
+ "MPH_to.c",
+ "handlers.c",
+ ],
+}
+
+
+cc_library_shared {
+ name: "libwilhelm",
+
+ cflags: [
+ // do not claim support for any OpenSL ES or OpenMAX AL profiles
+ "-DUSE_PROFILES=0",
+
+ // enable API logging; details are set separately by SL_TRACE_DEFAULT below
+ // or -UUSE_TRACE to disable API logging
+ "-DUSE_TRACE",
+
+ // see Configuration.h for USE_DEBUG
+
+ // enable assert() to do runtime checking
+ // or -DNDEBUG for no runtime checking
+ "-UNDEBUG",
+
+ // select the level of log messages
+ // or -DUSE_LOG=SLAndroidLogLevel_Verbose for verbose logging
+ "-DUSE_LOG=SLAndroidLogLevel_Info",
+
+ // log all API entries and exits (also requires Debug or Verbose log level)
+ // (otherwise a warning log on error results only)
+ //"-DSL_TRACE_DEFAULT=SL_TRACE_ALL",
+
+ // Reduce size of .so and hide internal global symbols
+ "-fvisibility=hidden",
+ "-DLI_API=__attribute__((visibility(\"default\")))",
+
+ "-Wno-multichar",
+ "-Wno-invalid-offsetof",
+
+ "-Wall",
+ "-Wextra",
+ "-Wno-unused-parameter",
+ "-Werror",
+ ],
+
+ product_variables: {
+ platform_sdk_version: {
+ // API level
+ cflags: ["-DPLATFORM_SDK_VERSION=%d"],
+ },
+ },
+
+ srcs: [
+ "OpenSLES_IID.cpp",
+ "assert.cpp",
+ "classes.cpp",
+ "data.cpp",
+ "devices.cpp",
+ "entry.cpp",
+ "handler_bodies.cpp",
+ "trace.cpp",
+ "locks.cpp",
+ "sles.cpp",
+ "sl_iid.cpp",
+ "sllog.cpp",
+ "ThreadPool.cpp",
+ "android/AudioPlayer_to_android.cpp",
+ "android/AudioRecorder_to_android.cpp",
+ "android/MediaPlayer_to_android.cpp",
+ "android/OutputMix_to_android.cpp",
+ "android/VideoCodec_to_android.cpp",
+ "android/BufferQueueSource.cpp",
+ "android/CallbackProtector.cpp",
+ "android/AacBqToPcmCbRenderer.cpp",
+ "android/android_AudioSfDecoder.cpp",
+ "android/android_AudioToCbRenderer.cpp",
+ "android/android_GenericMediaPlayer.cpp",
+ "android/android_GenericPlayer.cpp",
+ "android/android_LocAVPlayer.cpp",
+ "android/android_StreamPlayer.cpp",
+ "android/android_Effect.cpp",
+ "android/util/AacAdtsExtractor.cpp",
+ "android/channels.cpp",
+ "autogen/IID_to_MPH.cpp",
+ "objects/C3DGroup.cpp",
+ "objects/CAudioPlayer.cpp",
+ "objects/CAudioRecorder.cpp",
+ "objects/CEngine.cpp",
+ "objects/COutputMix.cpp",
+ "objects/CMediaPlayer.cpp",
+ "itf/IAndroidBufferQueue.cpp",
+ "itf/IAndroidConfiguration.cpp",
+ "itf/IAndroidEffect.cpp",
+ "itf/IAndroidEffectCapabilities.cpp",
+ "itf/IAndroidEffectSend.cpp",
+ "itf/IAcousticEchoCancellation.cpp",
+ "itf/IAutomaticGainControl.cpp",
+ "itf/IBassBoost.cpp",
+ "itf/IBufferQueue.cpp",
+ "itf/IDynamicInterfaceManagement.cpp",
+ "itf/IEffectSend.cpp",
+ "itf/IEngine.cpp",
+ "itf/IEngineCapabilities.cpp",
+ "itf/IEnvironmentalReverb.cpp",
+ "itf/IEqualizer.cpp",
+ "itf/IMetadataExtraction.cpp",
+ "itf/INoiseSuppression.cpp",
+ "itf/IMuteSolo.cpp",
+ "itf/IObject.cpp",
+ "itf/IOutputMix.cpp",
+ "itf/IPlay.cpp",
+ "itf/IPlaybackRate.cpp",
+ "itf/IPrefetchStatus.cpp",
+ "itf/IPresetReverb.cpp",
+ "itf/IRecord.cpp",
+ "itf/ISeek.cpp",
+ "itf/IStreamInformation.cpp",
+ "itf/IVideoDecoderCapabilities.cpp",
+ "itf/IVirtualizer.cpp",
+ "itf/IVolume.cpp",
+
+ /* unused source files:
+ "sync.cpp",
+ "itf/I3DCommit.cpp",
+ "itf/I3DDoppler.cpp",
+ "itf/I3DGrouping.cpp",
+ "itf/I3DLocation.cpp",
+ "itf/I3DMacroscopic.cpp",
+ "itf/I3DSource.cpp",
+ "itf/IAudioDecoderCapabilities.cpp",
+ "itf/IAudioEncoder.cpp",
+ "itf/IAudioEncoderCapabilities.cpp",
+ "itf/IAudioIODeviceCapabilities.cpp",
+ "itf/IDeviceVolume.cpp",
+ "itf/IDynamicSource.cpp",
+ "itf/ILEDArray.cpp",
+ "itf/IMIDIMessage.cpp",
+ "itf/IMIDIMuteSolo.cpp",
+ "itf/IMIDITempo.cpp",
+ "itf/IMIDITime.cpp",
+ "itf/IMetadataTraversal.cpp",
+ "itf/IPitch.cpp",
+ "itf/IRatePitch.cpp",
+ "itf/IThreadSync.cpp",
+ "itf/IVibra.cpp",
+ "itf/IVisualization.cpp",
+ */
+ ],
+
+ include_dirs: [
+ "frameworks/native/include/media/openmax",
+ ],
+
+ header_libs: ["libOpenSLES_headers"],
+ export_header_lib_headers: ["libOpenSLES_headers"],
+
+ static_libs: [
+ "libopensles_helper",
+ "libOpenSLESUT",
+ ],
+
+ shared_libs: [
+ "liblog",
+ "libutils",
+ "libmedia",
+ "libaudioclient",
+ "libaudiomanager",
+ "libbinder",
+ "libstagefright",
+ "libstagefright_foundation",
+ "libcutils",
+ "libgui",
+ "libdl",
+ "libandroid_runtime",
+
+ "libstagefright_http_support",
+ ],
+ export_shared_lib_headers: [
+ "libmedia",
+ "libstagefright",
+ "libaudioclient",
+ ],
+}
+
+cc_library_shared {
+ name: "libOpenSLES",
+
+ srcs: [
+ "sl_entry.cpp",
+ "sl_iid.cpp",
+ "assert.cpp",
+ ],
+ include_dirs: [
+ "frameworks/native/include/media/openmax",
+ ],
+
+ export_shared_lib_headers: ["libwilhelm"],
+ cflags: [
+ "-DLI_API=",
+ "-fvisibility=hidden",
+ "-UNDEBUG",
+ "-DSL_API=__attribute__((visibility(\"default\")))",
+
+ "-Wall",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libwilhelm",
+ "liblog",
+ ],
+}
+
+cc_library_shared {
+ name: "libOpenMAXAL",
+
+ srcs: [
+ "xa_entry.cpp",
+ "xa_iid.cpp",
+ "assert.cpp",
+ ],
+ include_dirs: [
+ "frameworks/native/include/media/openmax",
+ ],
+
+ export_shared_lib_headers: ["libwilhelm"],
+ cflags: [
+ "-DLI_API=",
+ "-fvisibility=hidden",
+ "-UNDEBUG",
+ "-DXA_API=__attribute__((visibility(\"default\")))",
+
+ "-Wall",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libwilhelm",
+ "liblog",
+ ],
+}
diff --git a/src/Android.mk b/src/Android.mk
deleted file mode 100644
index 1b7024b..0000000
--- a/src/Android.mk
+++ /dev/null
@@ -1,241 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- assert.cpp \
- ut/OpenSLESUT.c \
- ut/slesutResult.c
-
-LOCAL_C_INCLUDES:= $(LOCAL_PATH)/../include
-
-LOCAL_CFLAGS += -fvisibility=hidden -UNDEBUG
-LOCAL_CFLAGS += -Wall -Werror
-
-LOCAL_MODULE := libOpenSLESUT
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_C_INCLUDES:= $(LOCAL_PATH)/../include
-
-LOCAL_CFLAGS += -Wno-initializer-overrides
-# -Wno-missing-field-initializers
-# optional, see comments in MPH_to.c: -DUSE_DESIGNATED_INITIALIZERS -S
-# and also see ../tools/mphgen/Makefile
-LOCAL_CFLAGS += -DUSE_DESIGNATED_INITIALIZERS -UNDEBUG
-LOCAL_CFLAGS += -Wall -Werror
-
-LOCAL_SRC_FILES:= \
- assert.cpp \
- MPH_to.c \
- handlers.c
-
-LOCAL_MODULE:= libopensles_helper
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-# do not claim support for any OpenSL ES or OpenMAX AL profiles
-LOCAL_CFLAGS += -DUSE_PROFILES=0
-
-# enable API logging; details are set separately by SL_TRACE_DEFAULT below
-LOCAL_CFLAGS += -DUSE_TRACE
-# or -UUSE_TRACE to disable API logging
-
-# see Configuration.h for USE_DEBUG
-
-# enable assert() to do runtime checking
-LOCAL_CFLAGS += -UNDEBUG
-# or -DNDEBUG for no runtime checking
-
-# select the level of log messages
-LOCAL_CFLAGS += -DUSE_LOG=SLAndroidLogLevel_Info
-# or -DUSE_LOG=SLAndroidLogLevel_Verbose for verbose logging
-
-# log all API entries and exits (also requires Debug or Verbose log level)
-# LOCAL_CFLAGS += -DSL_TRACE_DEFAULT=SL_TRACE_ALL
-# (otherwise a warning log on error results only)
-
-# API level
-LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
-
-# Reduce size of .so and hide internal global symbols
-LOCAL_CFLAGS += -fvisibility=hidden -DLI_API='__attribute__((visibility("default")))'
-
-LOCAL_SRC_FILES:= \
- OpenSLES_IID.cpp \
- assert.cpp \
- classes.cpp \
- data.cpp \
- devices.cpp \
- entry.cpp \
- handler_bodies.cpp \
- trace.cpp \
- locks.cpp \
- sles.cpp \
- sl_iid.cpp \
- sllog.cpp \
- ThreadPool.cpp \
- android/AudioPlayer_to_android.cpp \
- android/AudioRecorder_to_android.cpp \
- android/MediaPlayer_to_android.cpp \
- android/OutputMix_to_android.cpp \
- android/VideoCodec_to_android.cpp \
- android/BufferQueueSource.cpp \
- android/CallbackProtector.cpp \
- android/AacBqToPcmCbRenderer.cpp \
- android/android_AudioSfDecoder.cpp \
- android/android_AudioToCbRenderer.cpp \
- android/android_GenericMediaPlayer.cpp\
- android/android_GenericPlayer.cpp \
- android/android_LocAVPlayer.cpp \
- android/android_StreamPlayer.cpp \
- android/android_Effect.cpp \
- android/util/AacAdtsExtractor.cpp \
- android/channels.cpp \
- autogen/IID_to_MPH.cpp \
- objects/C3DGroup.cpp \
- objects/CAudioPlayer.cpp \
- objects/CAudioRecorder.cpp \
- objects/CEngine.cpp \
- objects/COutputMix.cpp \
- objects/CMediaPlayer.cpp \
- itf/IAndroidBufferQueue.cpp \
- itf/IAndroidConfiguration.cpp \
- itf/IAndroidEffect.cpp \
- itf/IAndroidEffectCapabilities.cpp\
- itf/IAndroidEffectSend.cpp \
- itf/IAcousticEchoCancellation.cpp \
- itf/IAutomaticGainControl.cpp \
- itf/IBassBoost.cpp \
- itf/IBufferQueue.cpp \
- itf/IDynamicInterfaceManagement.cpp\
- itf/IEffectSend.cpp \
- itf/IEngine.cpp \
- itf/IEngineCapabilities.cpp \
- itf/IEnvironmentalReverb.cpp \
- itf/IEqualizer.cpp \
- itf/IMetadataExtraction.cpp \
- itf/INoiseSuppression.cpp \
- itf/IMuteSolo.cpp \
- itf/IObject.cpp \
- itf/IOutputMix.cpp \
- itf/IPlay.cpp \
- itf/IPlaybackRate.cpp \
- itf/IPrefetchStatus.cpp \
- itf/IPresetReverb.cpp \
- itf/IRecord.cpp \
- itf/ISeek.cpp \
- itf/IStreamInformation.cpp \
- itf/IVideoDecoderCapabilities.cpp \
- itf/IVirtualizer.cpp \
- itf/IVolume.cpp
-
-EXCLUDE_SRC := \
- sync.cpp \
- itf/I3DCommit.cpp \
- itf/I3DDoppler.cpp \
- itf/I3DGrouping.cpp \
- itf/I3DLocation.cpp \
- itf/I3DMacroscopic.cpp \
- itf/I3DSource.cpp \
- itf/IAudioDecoderCapabilities.cpp \
- itf/IAudioEncoder.cpp \
- itf/IAudioEncoderCapabilities.cpp \
- itf/IAudioIODeviceCapabilities.cpp\
- itf/IDeviceVolume.cpp \
- itf/IDynamicSource.cpp \
- itf/ILEDArray.cpp \
- itf/IMIDIMessage.cpp \
- itf/IMIDIMuteSolo.cpp \
- itf/IMIDITempo.cpp \
- itf/IMIDITime.cpp \
- itf/IMetadataTraversal.cpp \
- itf/IPitch.cpp \
- itf/IRatePitch.cpp \
- itf/IThreadSync.cpp \
- itf/IVibra.cpp \
- itf/IVisualization.cpp
-
-LOCAL_C_INCLUDES:= \
- $(LOCAL_PATH)/../include \
- frameworks/av/media/libstagefright \
- frameworks/av/media/libstagefright/include \
- frameworks/av/media/libstagefright/http \
- frameworks/native/include/media/openmax
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include
-
-LOCAL_CFLAGS += -Wno-multichar -Wno-invalid-offsetof
-
-LOCAL_CFLAGS += -Wall -Wextra -Wno-unused-parameter -Werror
-
-LOCAL_STATIC_LIBRARIES += \
- libopensles_helper \
- libOpenSLESUT
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libutils \
- libmedia \
- libaudioclient \
- libaudiomanager \
- libbinder \
- libstagefright \
- libstagefright_foundation \
- libcutils \
- libgui \
- libdl \
- libandroid_runtime
-
-LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
- libmedia \
- libaudioclient
-
-# For Brillo, we do not want this dependency as it significantly increases the
-# size of the checkout. Also, the library is dependent on Java (which is not
-# present in Brillo), so it doesn't really make sense to have it anyways. See
-# b/24507845 for more details.
-ifndef BRILLO
-LOCAL_SHARED_LIBRARIES += \
- libstagefright_http_support
-endif
-
-LOCAL_MODULE := libwilhelm
-
-ifeq ($(TARGET_BUILD_VARIANT),userdebug)
- LOCAL_CFLAGS += -DUSERDEBUG_BUILD=1
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := sl_entry.cpp sl_iid.cpp assert.cpp
-LOCAL_C_INCLUDES:= \
- frameworks/av/media/libstagefright \
- frameworks/av/media/libstagefright/include \
- frameworks/native/include/media/openmax
-LOCAL_MODULE := libOpenSLES
-LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := libwilhelm
-LOCAL_CFLAGS += -DLI_API= -fvisibility=hidden -UNDEBUG \
- -DSL_API='__attribute__((visibility("default")))'
-LOCAL_CFLAGS += -Wall -Werror
-LOCAL_SHARED_LIBRARIES := libwilhelm liblog
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := xa_entry.cpp xa_iid.cpp assert.cpp
-LOCAL_C_INCLUDES:= \
- frameworks/av/media/libstagefright \
- frameworks/av/media/libstagefright/include \
- frameworks/native/include/media/openmax
-LOCAL_MODULE := libOpenMAXAL
-LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := libwilhelm
-LOCAL_CFLAGS += -DLI_API= -fvisibility=hidden -UNDEBUG \
- -DXA_API='__attribute__((visibility("default")))'
-LOCAL_CFLAGS += -Wall -Werror
-LOCAL_SHARED_LIBRARIES := libwilhelm liblog
-include $(BUILD_SHARED_LIBRARY)
diff --git a/src/android/util/AacAdtsExtractor.cpp b/src/android/util/AacAdtsExtractor.cpp
index ecd41da..8851423 100644
--- a/src/android/util/AacAdtsExtractor.cpp
+++ b/src/android/util/AacAdtsExtractor.cpp
@@ -18,7 +18,7 @@
#include <utils/Log.h>
#include "android/include/AacAdtsExtractor.h"
-#include "include/avc_utils.h"
+#include <avc_utils.h>
namespace android {
diff --git a/src/data.cpp b/src/data.cpp
index 0e6ad8b..ace2862 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -22,8 +22,6 @@
#include "data.h"
#endif
-#include <cutils/bitops.h>
-
/** \brief Check a data locator and make local deep copy */
static SLresult checkDataLocator(const char *name, void *pLocator, DataLocator *pDataLocator,
diff --git a/tests/Android.bp b/tests/Android.bp
new file mode 100644
index 0000000..3e3fdff
--- /dev/null
+++ b/tests/Android.bp
@@ -0,0 +1,16 @@
+// Build the unit tests.
+cc_test {
+ name: "libopenslestests",
+
+ shared_libs: ["libOpenSLES"],
+
+ srcs: ["mimeUri_test.cpp"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// Build the manual test programs.
+subdirs = ["*"]
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index 2552f71..0000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Build the unit tests.
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES \
-
-LOCAL_SRC_FILES := mimeUri_test.cpp
-LOCAL_MODULE := libopenslestests
-LOCAL_MODULE_TAGS := tests
-LOCAL_CFLAGS := -Werror -Wall
-include $(BUILD_NATIVE_TEST)
-
-# Build the manual test programs.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/automated/Android.bp b/tests/automated/Android.bp
new file mode 100644
index 0000000..43ee0dd
--- /dev/null
+++ b/tests/automated/Android.bp
@@ -0,0 +1,16 @@
+// Build the unit tests.
+
+cc_test {
+ name: "BufferQueue_test",
+
+ srcs: ["BufferQueue_test.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ static_libs: ["libOpenSLESUT"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
diff --git a/tests/automated/Android.mk b/tests/automated/Android.mk
deleted file mode 100644
index e530021..0000000
--- a/tests/automated/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Build the unit tests.
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm) \
- $(call include-path-for, wilhelm-ut)
-
-LOCAL_SRC_FILES:= \
- BufferQueue_test.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES \
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
-
-LOCAL_CFLAGS := -Werror -Wall
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= BufferQueue_test
-
-include $(BUILD_NATIVE_TEST)
-
-# Build the manual test programs.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/examples/Android.bp b/tests/examples/Android.bp
new file mode 100644
index 0000000..36b3ec5
--- /dev/null
+++ b/tests/examples/Android.bp
@@ -0,0 +1,227 @@
+// slesTest_recBuffQueue
+
+cc_test {
+ name: "slesTest_recBuffQueue",
+ gtest: false,
+
+ srcs: ["slesTestRecBuffQueue.cpp"],
+
+ shared_libs: [
+ "libaudioutils",
+ "libOpenSLES",
+ ],
+
+ static_libs: ["libsndfile"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_playFdPath
+
+cc_binary {
+ name: "slesTest_playFdPath",
+
+ srcs: ["slesTestPlayFdPath.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+
+}
+
+// slesTest_feedback
+
+cc_test {
+ name: "slesTest_feedback",
+ gtest: false,
+
+ srcs: ["slesTestFeedback.cpp"],
+
+ shared_libs: [
+ "libaudioutils",
+ "libOpenSLES",
+ ],
+
+ static_libs: ["libsndfile"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// slesTest_sawtoothBufferQueue
+
+cc_test {
+ name: "slesTest_sawtoothBufferQueue",
+ gtest: false,
+
+ srcs: ["slesTestSawtoothBufferQueue.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_eqFdPath
+
+cc_test {
+ name: "slesTest_eqFdPath",
+ gtest: false,
+
+ srcs: ["slesTestEqFdPath.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_eqOutputPath
+
+cc_test {
+ name: "slesTest_eqOutputPath",
+ gtest: false,
+
+ srcs: ["slesTestEqOutputPath.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_bassboostPath
+
+cc_test {
+ name: "slesTest_bassboostPath",
+ gtest: false,
+
+ srcs: ["slesTestBassBoostPath.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_virtualizer
+
+cc_test {
+ name: "slesTest_virtualizer",
+ gtest: false,
+
+ srcs: ["slesTestVirtualizerPath.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_effectCapabilities
+
+cc_test {
+ name: "slesTest_effectCapabilities",
+ gtest: false,
+
+ srcs: ["slesTestEffectCapabilities.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_sendToPresetReverb
+
+cc_test {
+ name: "slesTest_sendToPresetReverb",
+ gtest: false,
+
+ srcs: ["slesTestSendToPresetReverb.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+// slesTest_decodeToBuffQueue
+
+cc_test {
+ name: "slesTest_decodeToBuffQueue",
+ gtest: false,
+
+ srcs: ["slesTestDecodeToBuffQueue.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+//##################
+// slesTestDecodeAac
+
+cc_test {
+ name: "slesTest_decodeAac",
+ gtest: false,
+
+ srcs: ["slesTestDecodeAac.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ static_libs: ["libcpustats"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+//######################################
+// OpenMAX AL example code
+
+// xaVideoDecoderCapabilities
+
+cc_test {
+ name: "xaVideoDecoderCapabilities",
+ gtest: false,
+
+ srcs: ["xaVideoDecoderCapabilities.cpp"],
+
+ shared_libs: ["libOpenMAXAL"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
diff --git a/tests/examples/Android.mk b/tests/examples/Android.mk
deleted file mode 100644
index 171a55b..0000000
--- a/tests/examples/Android.mk
+++ /dev/null
@@ -1,311 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-# slesTest_recBuffQueue
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, audio-utils)
-
-LOCAL_SRC_FILES:= \
- slesTestRecBuffQueue.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libaudioutils \
- libOpenSLES
-
-LOCAL_STATIC_LIBRARIES := \
- libsndfile
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-
-LOCAL_MODULE:= slesTest_recBuffQueue
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_playFdPath
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestPlayFdPath.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_playFdPath
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_feedback
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, audio-utils)
-
-LOCAL_SRC_FILES:= \
- slesTestFeedback.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libaudioutils \
- libOpenSLES
-
-LOCAL_STATIC_LIBRARIES := \
- libsndfile
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
- #LOCAL_SHARED_LIBRARIES += librt
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_feedback
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_sawtoothBufferQueue
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestSawtoothBufferQueue.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
- #LOCAL_SHARED_LIBRARIES += librt
-endif
-
-LOCAL_MODULE:= slesTest_sawtoothBufferQueue
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_eqFdPath
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestEqFdPath.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_eqFdPath
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_eqOutputPath
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestEqOutputPath.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_eqOutputPath
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_bassboostPath
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestBassBoostPath.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_bassboostPath
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_virtualizer
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestVirtualizerPath.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_virtualizer
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_effectCapabilities
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestEffectCapabilities.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_effectCapabilities
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_sendToPresetReverb
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestSendToPresetReverb.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_sendToPresetReverb
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_decodeToBuffQueue
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestDecodeToBuffQueue.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_decodeToBuffQueue
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-###################
-# slesTestDecodeAac
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- slesTestDecodeAac.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_STATIC_LIBRARIES := libcpustats
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_decodeAac
-
-include $(BUILD_EXECUTABLE)
-
-#######################################
-# OpenMAX AL example code
-
-# xaVideoDecoderCapabilities
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES:= \
- xaVideoDecoderCapabilities.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenMAXAL
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= xaVideoDecoderCapabilities
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
diff --git a/tests/listening/Android.bp b/tests/listening/Android.bp
new file mode 100644
index 0000000..32086d1
--- /dev/null
+++ b/tests/listening/Android.bp
@@ -0,0 +1,27 @@
+cc_test {
+ name: "slesTest_seekTorture",
+ gtest: false,
+
+ srcs: ["seekTorture.c"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
+
+cc_test {
+ name: "slesTest_playMuteSolo",
+ gtest: false,
+
+ srcs: ["slesTest_playMuteSolo.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
diff --git a/tests/listening/Android.mk b/tests/listening/Android.mk
deleted file mode 100644
index 8eb4783..0000000
--- a/tests/listening/Android.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- seekTorture.c
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_seekTorture
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
-
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTest_playMuteSolo.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_playMuteSolo
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_EXECUTABLE)
diff --git a/tests/mimeUri/Android.bp b/tests/mimeUri/Android.bp
new file mode 100644
index 0000000..b83346f
--- /dev/null
+++ b/tests/mimeUri/Android.bp
@@ -0,0 +1,144 @@
+// slesTest_playStates
+
+cc_test {
+ name: "slesTest_playStates",
+ gtest: false,
+
+ srcs: ["slesTest_playStates.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// slesTest_playStreamType
+
+cc_test {
+ name: "slesTest_playStreamType",
+ gtest: false,
+
+ srcs: ["slesTestPlayStreamType.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// slesTest_playUri
+
+cc_test {
+ name: "slesTest_playUri",
+ gtest: false,
+
+ srcs: ["slesTestPlayUri.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// slesTest_loopUri
+
+cc_test {
+ name: "slesTest_loopUri",
+ gtest: false,
+
+ srcs: ["slesTestLoopUri.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// slesTest_playUri2
+
+cc_test {
+ name: "slesTest_playUri2",
+ gtest: false,
+
+ srcs: ["slesTestPlayUri2.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+
+}
+
+// slesTest_slowDownUri
+
+cc_test {
+ name: "slesTest_slowDownUri",
+ gtest: false,
+
+ srcs: ["slesTestSlowDownUri.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// slesTest_manyPlayers
+
+cc_test {
+ name: "slesTest_manyPlayers",
+ gtest: false,
+
+ srcs: ["slesTestManyPlayers.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// slesTest_getPositionUri
+
+cc_test {
+ name: "slesTest_getPositionUri",
+ gtest: false,
+
+ srcs: ["slesTestGetPositionUri.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
diff --git a/tests/mimeUri/Android.mk b/tests/mimeUri/Android.mk
deleted file mode 100644
index c5dd3f4..0000000
--- a/tests/mimeUri/Android.mk
+++ /dev/null
@@ -1,209 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-# slesTest_playStates
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTest_playStates.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_CFLAGS := -Werror -Wall
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_playStates
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_playStreamType
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestPlayStreamType.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_playStreamType
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_playUri
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestPlayUri.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_playUri
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_loopUri
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestLoopUri.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_loopUri
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_playUri2
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestPlayUri2.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_playUri2
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_slowDownUri
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestSlowDownUri.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_slowDownUri
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_manyPlayers
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestManyPlayers.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_manyPlayers
-
-include $(BUILD_EXECUTABLE)
-
-# slesTest_getPositionUri
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestGetPositionUri.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_getPositionUri
-
-include $(BUILD_EXECUTABLE)
diff --git a/tests/sandbox/Android.bp b/tests/sandbox/Android.bp
new file mode 100644
index 0000000..627a159
--- /dev/null
+++ b/tests/sandbox/Android.bp
@@ -0,0 +1,425 @@
+// intbufq
+
+cc_test {
+ name: "slesTest_intbufq",
+ gtest: false,
+
+ srcs: [
+ "intbufq.c",
+ "getch.c",
+ ],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// multiplay
+
+cc_test {
+ name: "slesTest_multiplay",
+ gtest: false,
+
+ srcs: ["multiplay.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+
+}
+
+// engine
+
+cc_test {
+ name: "slesTest_engine",
+ gtest: false,
+
+ srcs: ["engine.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// object
+
+cc_test {
+ name: "slesTest_object",
+ gtest: false,
+
+ srcs: ["object.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// configbq
+
+cc_test {
+ name: "slesTest_configbq",
+ gtest: false,
+
+ srcs: ["configbq.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// reverb
+
+cc_test {
+ name: "slesTest_reverb",
+ gtest: false,
+
+ srcs: ["reverb.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// srcsink
+
+cc_test {
+ name: "slesTest_srcsink",
+ gtest: false,
+
+ srcs: ["srcsink.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// outputmix
+
+cc_test {
+ name: "slesTest_outputmix",
+ gtest: false,
+
+ srcs: ["outputmix.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// urimime
+
+cc_test {
+ name: "slesTest_urimime",
+ gtest: false,
+
+ srcs: ["urimime.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// dim
+
+cc_test {
+ name: "slesTest_dim",
+ gtest: false,
+
+ srcs: ["dim.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// multithread
+
+cc_test {
+ name: "slesTest_multithread",
+ gtest: false,
+
+ srcs: ["multithread.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// playbq
+
+cc_test {
+ name: "slesTest_playbq",
+ gtest: false,
+
+ srcs: ["playbq.cpp"],
+
+ shared_libs: [
+ "libaudioutils",
+ "libnbaio",
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "libsndfile",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// monkey
+
+cc_test {
+ name: "slesTest_monkey",
+ gtest: false,
+
+ srcs: ["monkey.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// xa
+
+cc_test {
+ name: "slesTest_xa",
+ gtest: false,
+
+ srcs: ["xa.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// dual
+
+cc_test {
+ name: "slesTest_dual",
+ gtest: false,
+
+ srcs: ["dual.c"],
+
+ shared_libs: [
+ "liblog",
+ "libOpenSLES",
+ "libOpenMAXAL",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+
+ "-UNDEBUG",
+ ],
+}
+
+// xaplay
+
+cc_test {
+ name: "slesTest_xaplay",
+ gtest: false,
+
+ srcs: [
+ "xaplay.c",
+ "nativewindow.cpp",
+ ],
+
+ shared_libs: [
+ "libutils",
+ "liblog",
+ "libOpenMAXAL",
+ "libgui",
+ "libbinder",
+ "libandroid",
+ ],
+
+ static_libs: [
+ "libOpenSLESUT",
+ "liblog",
+ ],
+
+ cflags: [
+ "-UNDEBUG",
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
+}
+
+subdirs = ["streamSource"]
diff --git a/tests/sandbox/Android.mk b/tests/sandbox/Android.mk
deleted file mode 100644
index bd87c0f..0000000
--- a/tests/sandbox/Android.mk
+++ /dev/null
@@ -1,506 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-# intbufq
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- intbufq.c \
- getch.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
- #LOCAL_SHARED_LIBRARIES += librt
-endif
-
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_intbufq
-
-include $(BUILD_EXECUTABLE)
-
-# multiplay
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- multiplay.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_multiplay
-
-include $(BUILD_EXECUTABLE)
-
-# engine
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm) \
- $(call include-path-for, wilhelm-ut)
-
-LOCAL_SRC_FILES:= \
- engine.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_engine
-
-include $(BUILD_EXECUTABLE)
-
-# object
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm) \
- $(call include-path-for, wilhelm-ut)
-
-LOCAL_SRC_FILES:= \
- object.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_object
-
-include $(BUILD_EXECUTABLE)
-
-# configbq
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- configbq.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_configbq
-
-include $(BUILD_EXECUTABLE)
-
-# reverb
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- reverb.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_reverb
-
-include $(BUILD_EXECUTABLE)
-
-# srcsink
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- srcsink.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_srcsink
-
-include $(BUILD_EXECUTABLE)
-
-# outputmix
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm) \
- $(call include-path-for, wilhelm-ut)
-
-LOCAL_SRC_FILES:= \
- outputmix.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_outputmix
-
-include $(BUILD_EXECUTABLE)
-
-# urimime
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- urimime.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_urimime
-
-include $(BUILD_EXECUTABLE)
-
-# dim
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- dim.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_dim
-
-include $(BUILD_EXECUTABLE)
-
-# multithread
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- multithread.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_multithread
-
-include $(BUILD_EXECUTABLE)
-
-# playbq
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm) \
- $(call include-path-for, audio-utils)
-
-LOCAL_SRC_FILES:= \
- playbq.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libaudioutils \
- libnbaio \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- libsndfile \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_playbq
-
-include $(BUILD_EXECUTABLE)
-
-# monkey
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- monkey.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_monkey
-
-include $(BUILD_EXECUTABLE)
-
-# xa
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- xa.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_xa
-
-include $(BUILD_EXECUTABLE)
-
-# dual
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- dual.c
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libOpenSLES \
- libOpenMAXAL
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS := -Werror -Wall
-LOCAL_CFLAGS += -UNDEBUG
-
-LOCAL_MODULE:= slesTest_dual
-
-include $(BUILD_EXECUTABLE)
-
-# xaplay
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- xaplay.c nativewindow.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- liblog \
- libOpenMAXAL \
- libgui \
- libbinder \
- libandroid
-
-LOCAL_STATIC_LIBRARIES := \
- libOpenSLESUT \
- liblog
-
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_CFLAGS += -UNDEBUG -Wall -Wextra -Werror
-
-LOCAL_MODULE:= slesTest_xaplay
-
-include $(BUILD_EXECUTABLE)
diff --git a/tests/sandbox/streamSource/Android.bp b/tests/sandbox/streamSource/Android.bp
new file mode 100644
index 0000000..8709285
--- /dev/null
+++ b/tests/sandbox/streamSource/Android.bp
@@ -0,0 +1,15 @@
+// slesTest_playStream
+
+cc_test {
+ name: "slesTest_playStream",
+ gtest: false,
+
+ srcs: ["slesTestPlayStream.cpp"],
+
+ shared_libs: ["libOpenSLES"],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+}
diff --git a/tests/sandbox/streamSource/Android.mk b/tests/sandbox/streamSource/Android.mk
deleted file mode 100644
index 784e51f..0000000
--- a/tests/sandbox/streamSource/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-# slesTest_playStream
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES:= \
- $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES:= \
- slesTestPlayStream.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-ifeq ($(TARGET_OS),linux)
- LOCAL_CFLAGS += -DXP_UNIX
-endif
-
-LOCAL_MODULE:= slesTest_playStream
-
-
-include $(BUILD_EXECUTABLE)
diff --git a/tests/sandbox/streamSource/slesTestPlayStream.cpp b/tests/sandbox/streamSource/slesTestPlayStream.cpp
index 3b882ee..5b3eeb5 100644
--- a/tests/sandbox/streamSource/slesTestPlayStream.cpp
+++ b/tests/sandbox/streamSource/slesTestPlayStream.cpp
@@ -181,9 +181,6 @@
{
SLEngineItf EngineItf;
- SLint32 numOutputs = 0;
- SLuint32 deviceID = 0;
-
SLresult res;
SLDataSource audioSource;