• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /**************************************************************************************************
18  * Equalizer functions
19  ****************************/
20 extern void android_eq_init(audio_session_t sessionId, IEqualizer* ieq);
21 
22 extern android::status_t android_eq_setParam(android::sp<android::AudioEffect> pFx,
23         int32_t param, int32_t param2, void *pValue);
24 
25 extern android::status_t android_eq_getParam(android::sp<android::AudioEffect> pFx,
26         int32_t param, int32_t param2, void *pValue);
27 
28 /**************************************************************************************************
29  * BassBoost functions
30  ****************************/
31 extern void android_bb_init(audio_session_t sessionId, IBassBoost* ibb);
32 
33 extern android::status_t android_bb_setParam(android::sp<android::AudioEffect> pFx,
34         int32_t param, void *pValue);
35 
36 extern android::status_t android_bb_getParam(android::sp<android::AudioEffect> pFx,
37         int32_t param, void *pValue);
38 
39 /**************************************************************************************************
40  * Virtualizer functions
41  ****************************/
42 extern void android_virt_init(audio_session_t sessionId, IVirtualizer* ivi);
43 
44 extern android::status_t android_virt_setParam(android::sp<android::AudioEffect> pFx,
45         int32_t param, void *pValue);
46 
47 extern android::status_t android_virt_getParam(android::sp<android::AudioEffect> pFx,
48         int32_t param, void *pValue);
49 
50 /**************************************************************************************************
51  * PresetReverb functions
52  ****************************/
53 extern void android_prev_init(IPresetReverb* ipr);
54 
55 extern android::status_t android_prev_setPreset(android::sp<android::AudioEffect> pFx,
56         uint16_t preset);
57 
58 extern android::status_t android_prev_getPreset(android::sp<android::AudioEffect> pFx,
59         uint16_t* preset);
60 
61 /**************************************************************************************************
62  * EnvironmentalReverb functions
63  ****************************/
64 extern void android_erev_init(IEnvironmentalReverb* ier);
65 
66 extern android::status_t android_erev_setParam(android::sp<android::AudioEffect> pFx,
67         int32_t param, void *pValue);
68 
69 extern android::status_t android_erev_getParam(android::sp<android::AudioEffect> pFx,
70         int32_t param, void *pValue);
71 
72 /**************************************************************************************************
73  * AEC functions
74  ****************************/
75 extern void android_aec_init(audio_session_t sessionId, IAndroidAcousticEchoCancellation* iaec);
76 
77 /**************************************************************************************************
78  * AGC functions
79  ****************************/
80 extern void android_agc_init(audio_session_t sessionId, IAndroidAutomaticGainControl* iagc);
81 
82 /**************************************************************************************************
83  * NS functions
84  ****************************/
85 extern void android_ns_init(audio_session_t sessionId, IAndroidNoiseSuppression* ins);
86 
87 /**************************************************************************************************
88  * Generic Effect functions
89  ****************************/
90 extern SLresult android_genericFx_queryNumEffects(SLuint32 *pNumSupportedAudioEffects);
91 
92 extern SLresult android_genericFx_queryEffect(SLuint32 index, effect_descriptor_t* pDescriptor);
93 
94 extern SLresult android_genericFx_createEffect(IAndroidEffect* iae, SLInterfaceID pUuid,
95         audio_session_t sessionId);
96 
97 extern SLresult android_genericFx_releaseEffect(IAndroidEffect* iae, SLInterfaceID pUuid);
98 
99 extern SLresult android_genericFx_setEnabled(IAndroidEffect* iae, SLInterfaceID pUuid,
100         SLboolean enabled);
101 
102 extern SLresult android_genericFx_isEnabled(IAndroidEffect* iae, SLInterfaceID pUuid,
103         SLboolean *pEnabled);
104 
105 extern SLresult android_genericFx_sendCommand(IAndroidEffect* iae, SLInterfaceID pUuid,
106         SLuint32 command, SLuint32 commandSize, void* pCommandData,
107         SLuint32 *replySize, void *pReplyData);
108 
109 extern bool android_genericFx_hasEffect(IAndroidEffect* iae, SLInterfaceID pUuid);
110 
111 
112 /**************************************************************************************************
113  * EffectSend functions
114  ****************************/
115 /**
116  * sendLevel is the total energy going to the send bus. This implies that the volume attenuation
117  *   should be combined with the send level for the aux level to follow volume changes.
118  */
119 extern android::status_t android_fxSend_attach(CAudioPlayer* ap, bool attach,
120         android::sp<android::AudioEffect> pFx, SLmillibel sendLevel);
121 
122 /**
123  * sendLevel is the total energy going to the send bus. This implies that the volume attenuation
124  *   should be combined with the send level for the aux level to follow volume changes.
125  *   This one is used by Android-specific APIs, not portable Khronos APIs.
126  */
127 extern SLresult android_fxSend_attachToAux(CAudioPlayer* ap, SLInterfaceID pUuid,
128         SLboolean attach, SLmillibel sendLevel);
129 
130 /**
131  * sendLevel is the total energy going to the send bus. This implies that the volume attenuation
132  *   should be combined with the send level for the aux level to follow volume changes.
133  */
134 extern android::status_t android_fxSend_setSendLevel(CAudioPlayer* ap, SLmillibel sendLevel);
135 
136 /**************************************************************************************************
137  * Effect-agnostic functions
138  ****************************/
139 extern android::status_t android_fx_setParam(android::sp<android::AudioEffect> pFx,
140         int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize);
141 
142 extern android::status_t android_fx_getParam(android::sp<android::AudioEffect> pFx,
143         int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize);
144 
145 extern SLresult android_fx_statusToResult(android::status_t status);
146 
147 extern bool android_fx_initEffectObj(audio_session_t sessionId,
148         android::sp<android::AudioEffect>& effect,
149         const effect_uuid_t *type);
150 
151 extern bool android_fx_initEffectDescriptor(const SLInterfaceID effectId,
152         effect_descriptor_t* fxDescrLoc);
153