merge in nyc-dr1-release history after reset to nyc-mr1-dev
diff --git a/src/Android.mk b/src/Android.mk
index 1fb5ddb..4f3f665 100644
--- a/src/Android.mk
+++ b/src/Android.mk
@@ -11,6 +11,7 @@
$(call include-path-for, wilhelm)
LOCAL_CFLAGS += -fvisibility=hidden -UNDEBUG
+LOCAL_CFLAGS += -Wall -Werror
LOCAL_MODULE := libOpenSLESUT
@@ -26,6 +27,7 @@
# 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.c \
@@ -217,6 +219,7 @@
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -x c++ -std=gnu++11 -DLI_API= -fvisibility=hidden -UNDEBUG \
-DSL_API='__attribute__((visibility("default")))'
+LOCAL_CFLAGS += -Wall -Werror
LOCAL_SHARED_LIBRARIES := libwilhelm liblog
include $(BUILD_SHARED_LIBRARY)
@@ -231,5 +234,6 @@
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -x c++ -std=gnu++11 -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/autogen/MPH_to_AudioRecorder.h b/src/autogen/MPH_to_AudioRecorder.h
index 8759114..b5564eb 100644
--- a/src/autogen/MPH_to_AudioRecorder.h
+++ b/src/autogen/MPH_to_AudioRecorder.h
@@ -3,4 +3,4 @@
-1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1,
-1, -1, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
diff --git a/src/ut/OpenSLESUT.c b/src/ut/OpenSLESUT.c
index f7f6353..f6e736a 100644
--- a/src/ut/OpenSLESUT.c
+++ b/src/ut/OpenSLESUT.c
@@ -17,8 +17,10 @@
/** \file OpenSLESUT.c OpenSL ES Utility Toolkit */
#include <SLES/OpenSLES.h>
+#include <OMXAL/OpenMAXAL.h>
#ifdef ANDROID
#include <SLES/OpenSLES_Android.h>
+#include <OMXAL/OpenMAXAL_Android.h>
#endif
#include "OpenSLESUT.h"
#include <stdio.h>
@@ -36,7 +38,8 @@
// ## is token concatenation e.g. a##b becomes ab
// # is stringize operator to convert a symbol to a string constant e.g. #a becomes "a"
-#define _(x) { &SL_IID_##x, #x }
+#define _(x) { &SL_IID_##x, "SL_IID_" #x }
+#define _X(x) { (const SLInterfaceID *) &XA_IID_##x, "XA_IID_" #x }
/** \brief Array of mappings from interface IDs to display names */
@@ -88,12 +91,15 @@
#if 0 // ifdef USE_OUTPUTMIXEXT
_(OUTPUTMIXEXT),
#endif
+ _X(ENGINE),
+ _X(VIDEODECODERCAPABILITIES),
#ifdef ANDROID
_(ANDROIDEFFECT),
_(ANDROIDEFFECTCAPABILITIES),
_(ANDROIDEFFECTSEND),
_(ANDROIDCONFIGURATION),
_(ANDROIDSIMPLEBUFFERQUEUE),
+ _(ANDROIDBUFFERQUEUESOURCE),
_(ANDROIDACOUSTICECHOCANCELLATION),
_(ANDROIDAUTOMATICGAINCONTROL),
_(ANDROIDNOISESUPPRESSION)
diff --git a/tests/sandbox/Android.mk b/tests/sandbox/Android.mk
index 4297e91..bd87c0f 100644
--- a/tests/sandbox/Android.mk
+++ b/tests/sandbox/Android.mk
@@ -71,7 +71,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -103,7 +104,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -224,7 +226,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -255,7 +258,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -286,7 +290,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -317,7 +322,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -351,7 +357,8 @@
libaudioutils \
libnbaio \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -383,7 +390,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libOpenSLES
+ libOpenSLES \
+ libOpenMAXAL
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -493,6 +501,6 @@
LOCAL_CFLAGS += -UNDEBUG -Wall -Wextra -Werror
-LOCAL_MODULE:= xaplay
+LOCAL_MODULE:= slesTest_xaplay
include $(BUILD_EXECUTABLE)
diff --git a/tests/sandbox/engine.c b/tests/sandbox/engine.c
index 2d4acdf..9b17b35 100644
--- a/tests/sandbox/engine.c
+++ b/tests/sandbox/engine.c
@@ -140,7 +140,8 @@
void *interface = NULL;
result = (*engineObject)->GetInterface(engineObject, engine_ids[index], &interface);
assert(SL_RESULT_SUCCESS == result);
- printf("interface[%u] %p\n", index, interface);
+ printf("interface[%u] %p = ", index, interface);
+ slesutPrintIID(engine_ids[index]);
// Use a copy of the interface ID to make sure lookup is not purely relying on address
void *interface_again = NULL;
struct SLInterfaceID_ copy = *engine_ids[index];
@@ -148,6 +149,8 @@
assert(SL_RESULT_SUCCESS == result);
// Calling GetInterface multiple times should return the same interface
assert(interface_again == interface);
+ printf("copy = ");
+ slesutPrintIID(©);
}
SLObjectItf engineObject2;
diff --git a/tests/sandbox/object.c b/tests/sandbox/object.c
index 95caa38..993134f 100644
--- a/tests/sandbox/object.c
+++ b/tests/sandbox/object.c
@@ -158,7 +158,7 @@
#ifdef ANDROID
// whereas the implementation uses PLATFORM_SDK_VERSION, use a hard-coded value here
// so that we're actually testing for a particular expected value
- supportedExt = (SLchar *) "ANDROID_SDK_LEVEL_19";
+ supportedExt = (SLchar *) "ANDROID_SDK_LEVEL_25";
#else
supportedExt = (SLchar *) "WILHELM_DESKTOP";
#endif
diff --git a/tests/sandbox/srcsink.c b/tests/sandbox/srcsink.c
index 35980f5..f78e651 100644
--- a/tests/sandbox/srcsink.c
+++ b/tests/sandbox/srcsink.c
@@ -114,7 +114,7 @@
format_pcm.numChannels = 3;
result = (*engineEngine)->CreateAudioPlayer(engineEngine, &playerObject, &audioSrc,
&audioSnk, 1, ids, req);
- assert(SL_RESULT_CONTENT_UNSUPPORTED == result);
+ assert(SL_RESULT_PARAMETER_INVALID == result);
assert(NULL == playerObject);
format_pcm.numChannels = 2;
@@ -140,7 +140,7 @@
format_pcm.bitsPerSample = 24;
result = (*engineEngine)->CreateAudioPlayer(engineEngine, &playerObject, &audioSrc,
&audioSnk, 1, ids, req);
- assert(SL_RESULT_CONTENT_UNSUPPORTED == result);
+ assert(SL_RESULT_PARAMETER_INVALID == result);
assert(NULL == playerObject);
format_pcm.bitsPerSample = 16;
diff --git a/tests/sandbox/xa.c b/tests/sandbox/xa.c
index 1549ac4..2d8f2a5 100644
--- a/tests/sandbox/xa.c
+++ b/tests/sandbox/xa.c
@@ -73,6 +73,7 @@
XADataLocator_AndroidBufferQueue locABQ;
memset(&locABQ, 0, sizeof(locABQ));
locABQ.locatorType = XA_DATALOCATOR_ANDROIDBUFFERQUEUE;
+ locABQ.numBuffers = 1;
#else
XADataLocator_URI locUri;
locUri.locatorType = XA_DATALOCATOR_URI;
@@ -97,7 +98,7 @@
audioSnk.pFormat = NULL;
XADataLocator_NativeDisplay locND;
locND.locatorType = XA_DATALOCATOR_NATIVEDISPLAY;
- locND.hWindow = NULL;
+ locND.hWindow = NULL; // FIXME wrong
locND.hDisplay = NULL;
XADataSink imageVideoSink;
imageVideoSink.pLocator = &locND;
diff --git a/tools/hashgen/Makefile b/tools/hashgen/Makefile
index fdd143c..37188a3 100644
--- a/tools/hashgen/Makefile
+++ b/tools/hashgen/Makefile
@@ -1,9 +1,10 @@
-all : IID_to_MPH.c
+all : IID_to_MPH.c run_test
install : IID_to_MPH.c
cp IID_to_MPH.c ../../src/autogen
CFLAGS = -I../../include -g -DNDEBUG
+CFLAGS += -Wall -Werror
%.o : %.c
gcc -c -o $@ $(CFLAGS) $<
@@ -43,7 +44,7 @@
./frag1 > part23in.gperf
frag1 : frag1.o OpenSLES_IID.o
- gcc -o $@ $(CFLAGS) frag1.o OpenSLES_IID.o
+ gcc -o $@ $(CFLAGS) $^
part5gen.c : frag2.c part23in.c frag3.c
$(RM) $@
@@ -54,12 +55,19 @@
cat frag3.c >> $@
part5gen : part5gen.o OpenSLES_IID.o interfaces.o
- gcc -o $@ $(CFLAGS) part5gen.o OpenSLES_IID.o interfaces.o
+ gcc -o $@ $(CFLAGS) $^
+
+run_test : test
+ ./test
+
+test : test.o OpenSLES_IID.o IID_to_MPH.o
+ gcc -o $@ $(CFLAGS) $^
clean :
$(RM) part5gen frag1 *.o
$(RM) part23in.gperf part5gen.c part23in.c
$(RM) part2.c part3.c part5.c part7.c
+ $(RM) test
distclean : clean
$(RM) IID_to_MPH.c
diff --git a/tools/hashgen/README.txt b/tools/hashgen/README.txt
index 3d801fb..4905bb9 100644
--- a/tools/hashgen/README.txt
+++ b/tools/hashgen/README.txt
@@ -5,18 +5,20 @@
* GNU make
* GNU gperf perfect hash generator
$ gperf --version
- GNU gperf 3.0.3
+ GNU gperf 3.0.4
* GNU sed
$ sed --version
- GNU sed version 4.2.1
+ GNU sed version 4.2.2
Usage:
Type 'make'.
Diff the old file in ../../src/autogen vs. the newly generated IID_to_MPH.c here.
If the differences look OK, then copy the new IID_to_MPH.c back to
its stable location in ../../src/autogen using 'make install'.
-Build and test the usage of the new IID.
+Build and test the usage of the new IID on host by "make run_test"
+*and* on the target by tests/sandbox/engine.c. The host test
+checks all GUIDs, and the target test checks a subset of GUIDs.
Then do 'make clean' or 'make distclean' here.
-hashgen is known to work on Linux with GNU gperf 3.0.3 and GNU sed
-version 4.2.1. There are reports of problems on Mac OS X.
+hashgen is known to work on Linux with GNU gperf 3.0.4 and GNU sed
+version 4.2.2. There are reports of problems on Mac OS X.
diff --git a/tools/hashgen/test.c b/tools/hashgen/test.c
new file mode 100644
index 0000000..4fe8ea2
--- /dev/null
+++ b/tools/hashgen/test.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Test the minimal perfect hash generator function
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <SLES/OpenSLES.h>
+#include "MPH.h"
+
+extern int IID_to_MPH(const SLInterfaceID iid);
+extern const struct SLInterfaceID_ SL_IID_array[MPH_MAX];
+
+int main(int argc, char **argv)
+{
+ int i;
+ for (i = 0; i < MPH_MAX; i++) {
+ const struct SLInterfaceID_ *original = &SL_IID_array[i];
+ // test the address-based lookup
+ int MPH = IID_to_MPH(original);
+ if (MPH != i) {
+ fprintf(stderr, "error: IID_to_MPH(SL_IID_array) = %d != %d\n", MPH, i);
+ return EXIT_FAILURE;
+ }
+ // test the content-based lookup
+ const struct SLInterfaceID_ copy = *original;
+ MPH = IID_to_MPH(©);
+ if (MPH != i) {
+ fprintf(stderr, "error: IID_to_MPH(copy) = %d != %d\n", MPH, i);
+ return EXIT_FAILURE;
+ }
+ }
+ printf("OK\n");
+ return EXIT_SUCCESS;
+}
diff --git a/tools/mphtogen/Makefile b/tools/mphtogen/Makefile
index c6a6fb2..788f412 100644
--- a/tools/mphtogen/Makefile
+++ b/tools/mphtogen/Makefile
@@ -10,7 +10,7 @@
mphtogen : mphtogen.c MPH_to.c MPH.h MPH_to.h
# Add -DANDROID if both (a) building for Android, and (b) not
# using -DUSE_DESIGNATED_INITIALIZERS in ../../src/Android.mk
- gcc -o $@ -DUSE_DESIGNATED_INITIALIZERS mphtogen.c MPH_to.c
+ gcc -o $@ -DUSE_DESIGNATED_INITIALIZERS -Wall -Werror mphtogen.c MPH_to.c
clean :
$(RM) mphtogen
diff --git a/tools/permute/Makefile b/tools/permute/Makefile
index 65ed44d..8a07864 100644
--- a/tools/permute/Makefile
+++ b/tools/permute/Makefile
@@ -1,5 +1,5 @@
permute : permute.c
- gcc -o $@ -Wall permute.c -lsndfile
+ gcc -o $@ -Wall -Werror permute.c -lsndfile
clean :
- $(RM) $@
+ $(RM) permute
diff --git a/tools/permute/permute.c b/tools/permute/permute.c
index 4b6522e..6997552 100644
--- a/tools/permute/permute.c
+++ b/tools/permute/permute.c
@@ -141,6 +141,7 @@
goto out;
}
+#if 0
// Must be 16-bit signed or 8-bit unsigned PCM
unsigned subtype = sfinfo_in.format & SF_FORMAT_SUBMASK;
unsigned sampleSizeIn = 0;
@@ -155,6 +156,7 @@
fprintf(stderr, "%s: unsupported subtype 0x%X\n", path_in, subtype);
goto out;
}
+#endif
// always read shorts
unsigned sampleSizeRead = 2;
@@ -185,12 +187,10 @@
}
// Must be either stereo or mono
- unsigned frameSizeIn = 0;
unsigned frameSizeRead = 0;
switch (sfinfo_in.channels) {
case 1:
case 2:
- frameSizeIn = sampleSizeIn * sfinfo_in.channels;
frameSizeRead = sampleSizeRead * sfinfo_in.channels;
break;
default: