Fix bug in QueryEffect test - was not re-initializing the name length.
Add QueryEffect test for over-writing the name buffer.
Don't create output with VOLUME or NULL interfaces.
Use <stdlib.h> symbolic names for exit codes instead of 0 and 1.
Remove Android-style logging from examples; use only printf.
Remove extra blank lines in test output.
Remove the MAX_NUMBER_OUTPUT_DEVICES macro.
Use <unistd.h> to declare usleep.
Remove obsolete #include statements.
Fix build warnings.
Change-Id: I8d198a317246b3894f104edf7c9f317a51593d07
* limitations under the License.
*/
-#ifdef ANDROID
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_bassboost"
-
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc < 3) {
fprintf(stdout, "Usage: \t%s path bass_boost_strength\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 1000\" \n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_virtualizer"
-
-#include <utils/Log.h>
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "SLES/OpenSLES_Android.h"
-#define MAX_NUMBER_INTERFACES 3
+#define MAX_NUMBER_INTERFACES 1
#define GUID_DISPLAY_LENGTH 35
#define FX_NAME_LENGTH 64
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
ExitOnError(result);
fprintf(stdout, "Effect library contains %ld effects:\n", nbEffects);
- SLchar effectName[FX_NAME_LENGTH];
+ SLchar effectName[FX_NAME_LENGTH+1];
SLuint16 effectNameLength = FX_NAME_LENGTH;
char typeString[GUID_DISPLAY_LENGTH];
char implString[GUID_DISPLAY_LENGTH];
SLInterfaceID effectType, effectImplementation;
for (SLuint32 i = 0 ; i < nbEffects ; i++ ) {
fprintf(stdout,"- effect %ld: ", i);
+ memset(effectName, 'Z', FX_NAME_LENGTH+1);
+ effectNameLength = FX_NAME_LENGTH;
result = (*EffectLibItf)->QueryEffect(EffectLibItf, i,
&effectType, &effectImplementation, effectName, &effectNameLength);
+ if ('Z' != effectName[FX_NAME_LENGTH]) {
+ fprintf(stderr, "QueryEffect wrote beyond end of buffer\n");
+ continue;
+ }
ExitOnError(result);
+ printf("length=%u ", effectNameLength);
+ if (FX_NAME_LENGTH < effectNameLength) {
+ printf(" (>max) ");
+ effectNameLength = FX_NAME_LENGTH;
+ }
guidToString(effectType, typeString);
guidToString(effectImplementation, implString);
- fprintf(stdout, "type = %s impl = %s name = %s \n", typeString, implString, effectName);
+ effectName[FX_NAME_LENGTH - 1] = '\0';
+ fprintf(stdout, " type=%s, impl=%s name=%.*s \n", typeString, implString, effectNameLength, effectName);
}
/* Shutdown OpenSL ES */
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
TestGenericFxCapabilities();
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#ifdef ANDROID
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_seekFdPath"
-
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
{
fprintf(stdout, "Usage: \t%s path offsetInBytes [sizeInBytes]\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 0 344460\" \n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#ifdef ANDROID
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_seekFdPath"
-
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc < 3) {
fprintf(stdout, "Usage: \t%s path offsetInBytes [sizeInBytes]\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 0 344460\" \n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
#endif
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_playFdPath"
-
-#include <utils/Log.h>
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAX_NUMBER_INTERFACES 3
-#define MAX_NUMBER_OUTPUT_DEVICES 6
#define TEST_MUTE 0
#define TEST_SOLO 1
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stdout, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
/* Configuration of the output mix */
/* Create Output Mix object to be used by the player */
- result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 1, iidArray, required);
+ result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 0, iidArray, required);
ExitOnError(result);
/* Realize the Output Mix object in synchronous mode */
locatorFd.locatorType = SL_DATALOCATOR_ANDROIDFD;
int fd = open(path, O_RDONLY);
if (fd == -1) {
- ExitOnError(SL_RESULT_RESOURCE_ERROR);
+ perror(path);
+ exit(EXIT_FAILURE);
}
locatorFd.fd = (SLint32) fd;
locatorFd.length = size;
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc < 3) {
fprintf(stdout, "Usage: \t%s path offsetInBytes [sizeInBytes]\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 0 344460\" \n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
ExitOnError(result);
if (argc == 3) {
- fprintf(stdout, "\nno file size given, using SL_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE\n\n");
+ fprintf(stdout, "no file size given, using SL_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE\n");
TestPlayPathFromFD(sl, argv[1], (SLAint64)atoi(argv[2]),
SL_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE);
} else {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stdout, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- //LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc < 2) {
fprintf(stdout, "Usage: \t%s destination_file duration_in_seconds\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/myrec.raw 4\" \n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* MATERIALS.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "Sawtooth"
-
-#ifdef ANDROID
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "SLES/OpenSLES.h"
-/*using namespace android;*/
-
-#define SLEEP(x) /* Client system sleep function to sleep x milliseconds
-would replace SLEEP macro */
#define MAX_NUMBER_INTERFACES 3
-#define MAX_NUMBER_OUTPUT_DEVICES 6
/* Local storage for Audio data in 16 bit words */
#define AUDIO_DATA_STORAGE_SIZE 4096 * 100
if ( res != SL_RESULT_SUCCESS )
{
fprintf(stdout, "%lu SL failure, exiting\n", res);
- exit(1);
+ exit(EXIT_FAILURE);
}
else {
//fprintf(stdout, "%d SL success, proceeding...\n", res);
required[0] = SL_BOOLEAN_TRUE;
iidArray[0] = SL_IID_VOLUME;
// Create Output Mix object to be used by player
- res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 1,
+ res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0,
iidArray, required); CheckErr(res);
// Realizing the Output Mix object in synchronous mode.
res = (*OutputMix)->Realize(OutputMix, SL_BOOLEAN_FALSE);
CheckErr(res);
+#if 0
res = (*OutputMix)->GetInterface(OutputMix, SL_IID_VOLUME,
(void*)&volumeItf); CheckErr(res);
+#endif
/* Setup the data source structure for the buffer queue */
bufferQueue.locatorType = SL_DATALOCATOR_BUFFERQUEUE;
res = (*bufferQueueItf)->RegisterCallback(bufferQueueItf,
BufferQueueCallback, &cntxt); CheckErr(res);
+#if 0
/* Before we start set volume to -3dB (-300mB) */
res = (*volumeItf)->SetVolumeLevel(volumeItf, -300); CheckErr(res);
+#endif
/* Enqueue a few buffers to get the ball rolling */
res = (*bufferQueueItf)->Enqueue(bufferQueueItf, cntxt.pData,
int main(int argc, char* const argv[])
{
- LOGV("Starting sawtoothPlayer\n");
-
SLresult res;
SLObjectItf sl;
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
-
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#ifdef ANDROID
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_sendToPresetReverb"
-
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc < 5) {
fprintf(stdout, "Usage: \t%s path preset directLevel sendLevel\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 6 -2000 0\" \n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#ifdef ANDROID
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_virtualizer"
-
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
/* Configuration of the output mix */
/* Create Output Mix object to be used by the player */
- result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 1, iidArray, required);
+ result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 0, iidArray, required);
ExitOnError(result);
/* Realize the Output Mix object in synchronous mode */
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc < 3) {
fprintf(stdout, "Usage: \t%s path virtualization_strength\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 1000\" \n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_playMuteSolo"
-
-#ifdef ANDROID
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stdout, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
/* Configuration of the output mix */
/* Create Output Mix object to be used by the player */
- result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 1, iidArray, required);
+ result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 0, iidArray, required);
ExitOnError(result);
/* Realize the Output Mix object in synchronous mode */
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc == 1) {
fprintf(stdout, "Usage: \t%s url\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3\"\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
LOCAL_MODULE:= slesTest_slowDownUri
-include $(BUILD_EXECUTABLE)
\ No newline at end of file
+include $(BUILD_EXECUTABLE)
* limitations under the License.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTestLoopUri"
-
-#ifdef ANDROID
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if ((event & (SL_PREFETCHEVENT_STATUSCHANGE|SL_PREFETCHEVENT_FILLLEVELCHANGE))
&& (level == 0) && (status == SL_PREFETCHSTATUS_UNDERFLOW)) {
fprintf(stdout, "\t\tPrefetchEventCallback: Error while prefetching data, exiting\n");
- //exit(1);
+ //exit(EXIT_FAILURE);
}
if (event & SL_PREFETCHEVENT_FILLLEVELCHANGE) {
fprintf(stdout, "\t\tPrefetchEventCallback: Buffer fill level is = %d\n", level);
required[0] = SL_BOOLEAN_TRUE;
iidArray[0] = SL_IID_VOLUME;
// Create Output Mix object to be used by player
- res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 1,
+ res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0,
iidArray, required); CheckErr(res);
// Realizing the Output Mix object in synchronous mode.
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting slesTestLoopUri\n");
-
SLresult res;
SLObjectItf sl;
fprintf(stdout, "Usage: \n\t%s path \n\t%s url\n", argv[0], argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3\" or \"%s file:///sdcard/my.mp3\"\n",
argv[0], argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#ifdef ANDROID
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_playStreamType"
-
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stdout, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
/* Configuration of the output mix */
/* Create Output Mix object to be used by the player */
- result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 1, iidArray, required);
+ result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 0, iidArray, required);
ExitOnError(result);
/* Realize the Output Mix object in synchronous mode */
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
fprintf(stdout, "Usage: \t%s url stream_type\n", argv[0]);
fprintf(stdout, " where stream_type is one of the SL_ANDROID_STREAM_ constants.\n");
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 3\" \n", argv[0]);
- exit(1);
+ return EXIT_FAILURE;
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* MATERIALS.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTestPlayUri"
-
-#ifdef ANDROID
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
+//#include <string.h>
#include <unistd.h>
-#include <sys/time.h>
+//#include <sys/time.h>
#include "SLES/OpenSLES.h"
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
SLpermille level = 0;
(*caller)->GetFillLevel(caller, &level);
SLuint32 status;
- //fprintf(stdout, "\t\tPrefetchEventCallback: received event %lu\n", event);
+ //fprintf(stdout, "PrefetchEventCallback: received event %lu\n", event);
(*caller)->GetPrefetchStatus(caller, &status);
if ((event & (SL_PREFETCHEVENT_STATUSCHANGE|SL_PREFETCHEVENT_FILLLEVELCHANGE))
&& (level == 0) && (status == SL_PREFETCHSTATUS_UNDERFLOW)) {
- fprintf(stdout, "\t\tPrefetchEventCallback: Error while prefetching data, exiting\n");
- //exit(1);
+ fprintf(stdout, "PrefetchEventCallback: Error while prefetching data, exiting\n");
+ //exit(EXIT_FAILURE);
}
if (event & SL_PREFETCHEVENT_FILLLEVELCHANGE) {
- fprintf(stdout, "\t\tPrefetchEventCallback: Buffer fill level is = %d\n", level);
+ fprintf(stdout, "PrefetchEventCallback: Buffer fill level is = %d\n", level);
}
if (event & SL_PREFETCHEVENT_STATUSCHANGE) {
- fprintf(stdout, "\t\tPrefetchEventCallback: Prefetch Status is = %lu\n", status);
+ fprintf(stdout, "PrefetchEventCallback: Prefetch Status is = %lu\n", status);
}
}
required[1] = SL_BOOLEAN_TRUE;
iidArray[1] = SL_IID_PREFETCHSTATUS;
// Create Output Mix object to be used by player
- res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 1,
+ res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0,
iidArray, required); CheckErr(res);
// Realizing the Output Mix object in synchronous mode.
/* Play the URI */
/* first cause the player to prefetch the data */
- fprintf(stdout, "\nbefore set to PAUSED\n\n");
+ fprintf(stdout, "Before set to PAUSED\n");
res = (*playItf)->SetPlayState( playItf, SL_PLAYSTATE_PAUSED );
- fprintf(stdout, "\nafter set to PAUSED\n\n");
+ fprintf(stdout, "After set to PAUSED\n");
CheckErr(res);
/* wait until there's data to play */
}
if (timeOutIndex == 0) {
- fprintf(stderr, "\nWe\'re done waiting, failed to prefetch data in time, exiting\n");
+ fprintf(stderr, "We\'re done waiting, failed to prefetch data in time, exiting\n");
goto destroyRes;
}
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting slesTestPlayUri\n");
-
SLresult res;
SLObjectItf sl;
fprintf(stdout, "Plays a sound and stops after its reported duration\n\n");
if (argc == 1) {
- fprintf(stdout, "Usage: \n\t%s path \n\t%s url\n", argv[0], argv[0]);
+ fprintf(stdout, "Usage: %s path \n\t%s url\n", argv[0], argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3\" or \"%s file:///sdcard/my.mp3\"\n",
argv[0], argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTestPlayUri"
-
-#ifdef ANDROID
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <unistd.h>
-#include <sys/time.h>
#include "SLES/OpenSLES.h"
#define MAX_NUMBER_INTERFACES 3
-#define MAX_NUMBER_OUTPUT_DEVICES 6
//-----------------------------------------------------------------
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stdout, "%lu error code encountered, exiting\n", result);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
/* Configuration of the output mix */
/* Create Output Mix object to be used each player */
- result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 1, iidArray, required);
+ result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 0, iidArray, required);
ExitOnError(result);
/* Realize the Output Mix object in synchronous mode */
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
fprintf(stdout, "Usage: \n\t%s url1 url2 \n\t%s url\n", argv[0], argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3 http://blabla/my.wav\" ", argv[0]);
fprintf(stdout, "or \"%s file:///sdcard/my.mp3\"\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTestSlowDownUri"
-
-#ifdef ANDROID
-#include <utils/Log.h>
-#else
-#define LOGV printf
-#endif
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stderr, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if ((event & (SL_PREFETCHEVENT_STATUSCHANGE|SL_PREFETCHEVENT_FILLLEVELCHANGE))
&& (level == 0) && (status == SL_PREFETCHSTATUS_UNDERFLOW)) {
fprintf(stdout, "\t\tPrefetchEventCallback: Error while prefetching data, exiting\n");
- //exit(1);
+ //exit(EXIT_FAILURE);
}
if (event & SL_PREFETCHEVENT_FILLLEVELCHANGE) {
fprintf(stdout, "\t\tPrefetchEventCallback: Buffer fill level is = %d\n", level);
required[0] = SL_BOOLEAN_TRUE;
iidArray[0] = SL_IID_VOLUME;
// Create Output Mix object to be used by player
- res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 1,
+ res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0,
iidArray, required); CheckErr(res);
// Realizing the Output Mix object in synchronous mode.
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting slesTestSlowDownUri\n");
-
SLresult res;
SLObjectItf sl;
fprintf(stdout, "Usage: \n\t%s path \n\t%s url\n", argv[0], argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3\" or \"%s file:///sdcard/my.mp3\"\n",
argv[0], argv[0]);
- exit(1);
+ return EXIT_FAILURE;
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
* limitations under the License.
*/
-#define LOG_NDEBUG 0
-#define LOG_TAG "slesTest_playStates"
-
-#include <utils/Log.h>
-#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
if (SL_RESULT_SUCCESS != result) {
fprintf(stdout, "%lu error code encountered at line %d, exiting\n", result, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
/* Configuration of the output mix */
/* Create Output Mix object to be used by the player */
- result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 1, iidArray, required);
+ result = (*EngineItf)->CreateOutputMix(EngineItf, &outputMix, 0, iidArray, required);
ExitOnError(result);
/* Realize the Output Mix object in synchronous mode */
//-----------------------------------------------------------------
int main(int argc, char* const argv[])
{
- LOGV("Starting %s\n", argv[0]);
-
SLresult result;
SLObjectItf sl;
if (argc == 1) {
fprintf(stdout, "Usage: \t%s url\n", argv[0]);
fprintf(stdout, "Example: \"%s /sdcard/my.mp3\"\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
SLEngineOption EngineOption[] = {
/* Shutdown OpenSL ES */
(*sl)->Destroy(sl);
- exit(0);
- return 0;
+ return EXIT_SUCCESS;
}
required[1] = SL_BOOLEAN_TRUE;
iidArray[1] = SL_IID_PREFETCHSTATUS;
// Create Output Mix object to be used by player
- res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 1,
+ res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0,
iidArray, required); CheckErr(res);
// Realizing the Output Mix object in synchronous mode.
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include "SLES/OpenSLES.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <unistd.h>
// Describes the state of one player
const SLInterfaceID mix_ids[] = {SL_IID_VOLUME};
const SLboolean mix_req[] = {SL_BOOLEAN_TRUE};
SLObjectItf mixObject;
- result = (*engineEngine)->CreateOutputMix(engineEngine, &mixObject, 1, mix_ids, mix_req);
+ result = (*engineEngine)->CreateOutputMix(engineEngine, &mixObject, 0, mix_ids, mix_req);
check(result);
result = (*mixObject)->Realize(mixObject, SL_BOOLEAN_FALSE);
check(result);
+#if 0
SLVolumeItf mixVolume;
result = (*mixObject)->GetInterface(mixObject, SL_IID_VOLUME, &mixVolume);
check(result);
result = (*mixVolume)->GetVolumeLevel(mixVolume, &mixVolumeLevelDefault);
check(result);
printf("default mix volume level = %d\n", mixVolumeLevelDefault);
+#endif
printf("numPathnames=%d\n", numPathnames);
printf("numPlayers=%d\n", numPlayers);
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
// Table of I3DL2 named environmental reverb settings
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include "SLES/OpenSLES.h"
#ifdef ANDROID