Interface testing and bug fixes

Add some new tests, and fix the bugs they found.

New and improved tests:
Added output mix API test with focus on interfaces.
Add mute solo and seek test cases to the automated buffer queue test.
Buffer queue configuration test is now listenable:
  Buffer queue configuration test now generates a sequence of sine
  waves in order so that the listener can tell if each format is
  supported correctly.

Bug fixes:
Engine::Create... was not checking if the interface was available
  for a particular class.  Fixing that bug showed some other bugs
  in the class/interface configuration tables.
The effects interfaces is available on an output mix.
The Volume interface is not available on an output mix.
The Object interface can do GetInterface before realized.
OutputMix interface is available on an OutputMix;
  needed by the demos/examples in back of book
OutputMix::ReRoute fails if number of output device IDs is not 1.
Improve interface checks on a buffer queue source.
Don't allow mute solo interface on a mono buffer queue.
The earlier code to check for seek interface on a buffer queue
  compared by address, which didn't work if application
  used a private copy of the GUID. Now compares using the
  MPH which will work in all cases.
Buffer queue, effect send, and mute solo are explicit interfaces on audio player.
slCreateEngine was not publishing the engine object.

Miscellaneous cleanup:
Removed the hard-coded fake device ID constants in
  OutputMix::ReRoute that were there just for testing.
In  Engine::Create..., log an error for all unsupported interfaces, not just the first one.
Make hash generator build again:
  It turns out interfaces.c is needed, even though it duplicates
  OpenSLESUT.c.  Restore from 1a6bb4f8e738c9387dc9629db294ea5de618a53c.
Remove some redundant comments.

Change-Id: Iddabe73e298b69a44f3b43ed224c918eb95961a1
diff --git a/tests/automated/BufferQueue_test.cpp b/tests/automated/BufferQueue_test.cpp
index 71b52eb..f6292a0 100644
--- a/tests/automated/BufferQueue_test.cpp
+++ b/tests/automated/BufferQueue_test.cpp
@@ -61,6 +61,10 @@
 
 static const SLInterfaceID ids[1] = { SL_IID_BUFFERQUEUE };
 static const SLboolean flags[1] = { SL_BOOLEAN_TRUE };
+static const SLInterfaceID ids_mutesolo[2] = { SL_IID_BUFFERQUEUE, SL_IID_MUTESOLO };
+static const SLboolean flags_mutesolo[2] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE };
+static const SLInterfaceID ids_seek[2] = { SL_IID_BUFFERQUEUE, SL_IID_SEEK };
+static const SLboolean flags_seek[2] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE };
 
 // The fixture for testing class BufferQueue
 class TestBufferQueue: public ::testing::Test {
@@ -301,6 +305,34 @@
     InvalidBuffer();
 }
 
+TEST_F(TestBufferQueue, testMuteSolo) {
+    // create audio player with buffer queue data source in stereo PCM format and ask for mute solo
+    locator_bufferqueue.numBuffers = 1;
+    SLresult result = (*engineEngine)->CreateAudioPlayer(engineEngine, &playerObject, &audiosrc,
+            &audiosnk, 2, ids_mutesolo, flags_mutesolo);
+    ASSERT_EQ(SL_RESULT_SUCCESS, result);
+    ASSERT_TRUE(NULL != playerObject);
+    DestroyPlayer();
+    // create audio player with buffer queue data source in mono PCM format and ask for mute solo
+    pcm.numChannels = 1;
+    pcm.channelMask = SL_SPEAKER_FRONT_CENTER;
+    result = (*engineEngine)->CreateAudioPlayer(engineEngine, &playerObject, &audiosrc, &audiosnk,
+            2, ids_mutesolo, flags_mutesolo);
+    ASSERT_EQ(SL_RESULT_FEATURE_UNSUPPORTED, result);
+    ASSERT_EQ(NULL, playerObject);
+    DestroyPlayer();
+}
+
+TEST_F(TestBufferQueue, testSeek) {
+    // can create audio player with buffer queue data source and ask for seek
+    locator_bufferqueue.numBuffers = 1;
+    SLresult result = (*engineEngine)->CreateAudioPlayer(engineEngine, &playerObject,
+                                                    &audiosrc, &audiosnk, 2, ids_seek, flags_seek);
+    ASSERT_EQ(SL_RESULT_FEATURE_UNSUPPORTED, result);
+    ASSERT_EQ(NULL, playerObject);
+    DestroyPlayer();
+}
+
 TEST_F(TestBufferQueue, testValidBuffer) {
     for (unsigned i = 0; i < sizeof(validNumBuffers) / sizeof(validNumBuffers[0]); ++i) {
         SLuint32 numBuffers = validNumBuffers[i];