1b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* 2b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * Copyright (C) 2010 The Android Open Source Project 3b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * 4b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * Licensed under the Apache License, Version 2.0 (the "License"); 5b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * you may not use this file except in compliance with the License. 6b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * You may obtain a copy of the License at 7b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * 8b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * http://www.apache.org/licenses/LICENSE-2.0 9b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * 10b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * Unless required by applicable law or agreed to in writing, software 11b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * distributed under the License is distributed on an "AS IS" BASIS, 12b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * See the License for the specific language governing permissions and 14b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * limitations under the License. 15b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi */ 16b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 17b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi#ifndef OPENSL_ES_ANDROIDCONFIGURATION_H_ 18b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi#define OPENSL_ES_ANDROIDCONFIGURATION_H_ 19b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 20b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi#ifdef __cplusplus 21b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Triviextern "C" { 2202e6a6b750743e09fa21132046f6a092182def66Glenn Kasten#endif 23b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 24b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/*---------------------------------------------------------------------------*/ 25b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* Android AudioRecorder configuration */ 26b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/*---------------------------------------------------------------------------*/ 27b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 28b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** Audio recording preset */ 29b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** Audio recording preset key */ 30b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi#define SL_ANDROID_KEY_RECORDING_PRESET ((const SLchar*) "androidRecordingPreset") 31b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** Audio recording preset values */ 32b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** preset "none" cannot be set, it is used to indicate the current settings 33b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * do not match any of the presets. */ 34a4b4d478171631eaa97e933eb46c1ff01bd04daaJean-Michel Trivi#define SL_ANDROID_RECORDING_PRESET_NONE ((SLuint32) 0x00000000) 35e214a8c49938e7356943b59db53474e5fc3ae07cJean-Michel Trivi/** generic recording configuration on the platform */ 36a4b4d478171631eaa97e933eb46c1ff01bd04daaJean-Michel Trivi#define SL_ANDROID_RECORDING_PRESET_GENERIC ((SLuint32) 0x00000001) 37b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** uses the microphone audio source with the same orientation as the camera 38b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi * if available, the main device microphone otherwise */ 39a4b4d478171631eaa97e933eb46c1ff01bd04daaJean-Michel Trivi#define SL_ANDROID_RECORDING_PRESET_CAMCORDER ((SLuint32) 0x00000002) 40b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** uses the main microphone tuned for voice recognition */ 41a4b4d478171631eaa97e933eb46c1ff01bd04daaJean-Michel Trivi#define SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION ((SLuint32) 0x00000003) 42a4b4d478171631eaa97e933eb46c1ff01bd04daaJean-Michel Trivi/** uses the main microphone tuned for audio communications */ 43a4b4d478171631eaa97e933eb46c1ff01bd04daaJean-Michel Trivi#define SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION ((SLuint32) 0x00000004) 44e9b57cefb954e7c1bffc5d4b59f89aca5e050797rago/** uses the main microphone unprocessed */ 45e9b57cefb954e7c1bffc5d4b59f89aca5e050797rago#define SL_ANDROID_RECORDING_PRESET_UNPROCESSED ((SLuint32) 0x00000005) 46e9b57cefb954e7c1bffc5d4b59f89aca5e050797rago 47b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 48b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/*---------------------------------------------------------------------------*/ 49b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* Android AudioPlayer configuration */ 50b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/*---------------------------------------------------------------------------*/ 51b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 52b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** Audio playback stream type */ 53b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** Audio playback stream type key */ 54b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi#define SL_ANDROID_KEY_STREAM_TYPE ((const SLchar*) "androidPlaybackStreamType") 55b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 56b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/** Audio playback stream type values */ 57b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* same as android.media.AudioManager.STREAM_VOICE_CALL */ 5875e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi#define SL_ANDROID_STREAM_VOICE ((SLint32) 0x00000000) 59b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* same as android.media.AudioManager.STREAM_SYSTEM */ 6075e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi#define SL_ANDROID_STREAM_SYSTEM ((SLint32) 0x00000001) 61b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* same as android.media.AudioManager.STREAM_RING */ 6275e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi#define SL_ANDROID_STREAM_RING ((SLint32) 0x00000002) 63b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* same as android.media.AudioManager.STREAM_MUSIC */ 6475e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi#define SL_ANDROID_STREAM_MEDIA ((SLint32) 0x00000003) 65b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* same as android.media.AudioManager.STREAM_ALARM */ 6675e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi#define SL_ANDROID_STREAM_ALARM ((SLint32) 0x00000004) 67b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi/* same as android.media.AudioManager.STREAM_NOTIFICATION */ 6875e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi#define SL_ANDROID_STREAM_NOTIFICATION ((SLint32) 0x00000005) 69b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 70b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 718c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/*---------------------------------------------------------------------------*/ 728c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/* Android AudioPlayer and AudioRecorder configuration */ 738c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/*---------------------------------------------------------------------------*/ 748c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent 758c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/** Audio Performance mode. 768c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * Performance mode tells the framework how to configure the audio path 778c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * for a player or recorder according to application performance and 788c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * functional requirements. 798c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * It affects the output or input latency based on acceptable tradeoffs on 808c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * battery drain and use of pre or post processing effects. 818c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * Performance mode should be set before realizing the object and should be 828c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * read after realizing the object to check if the requested mode could be 838c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * granted or not. 848c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent */ 858c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/** Audio Performance mode key */ 868c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent#define SL_ANDROID_KEY_PERFORMANCE_MODE ((const SLchar*) "androidPerformanceMode") 878c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent 888c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/** Audio performance values */ 898c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/* No specific performance requirement. Allows HW and SW pre/post processing. */ 908c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent#define SL_ANDROID_PERFORMANCE_NONE ((SLuint32) 0x00000000) 918c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/* Priority given to latency. No HW or software pre/post processing. 928c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * This is the default if no performance mode is specified. */ 938c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent#define SL_ANDROID_PERFORMANCE_LATENCY ((SLuint32) 0x00000001) 948c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/* Priority given to latency while still allowing HW pre and post processing. */ 958c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent#define SL_ANDROID_PERFORMANCE_LATENCY_EFFECTS ((SLuint32) 0x00000002) 968c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent/* Priority given to power saving if latency is not a concern. 978c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent * Allows HW and SW pre/post processing. */ 988c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent#define SL_ANDROID_PERFORMANCE_POWER_SAVING ((SLuint32) 0x00000003) 998c9071f491393fadf767b6164a17b0795eba3fdaEric Laurent 100b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 10102e6a6b750743e09fa21132046f6a092182def66Glenn Kasten#ifdef __cplusplus 102b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi} 103b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi#endif /* __cplusplus */ 104b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 105b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi#endif /* OPENSL_ES_ANDROIDCONFIGURATION_H_ */ 106