OpenSLES_Android.h revision a7b79e766ec6d95e9236168c27461c2ebaef4659
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#ifndef OPENSL_ES_ANDROID_H_
18#define OPENSL_ES_ANDROID_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*---------------------------------------------------------------------------*/
25/* Android common types                                                      */
26/*---------------------------------------------------------------------------*/
27
28typedef sl_int64_t             SLAint64;           /* 64 bit signed integer */
29
30
31/*---------------------------------------------------------------------------*/
32/* Android Effect interface                                                  */
33/*---------------------------------------------------------------------------*/
34
35extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDEFFECT;
36
37/** Android Effect interface methods */
38
39struct SLAndroidEffectItf_;
40typedef const struct SLAndroidEffectItf_ * const * SLAndroidEffectItf;
41
42struct SLAndroidEffectItf_ {
43
44    SLresult (*CreateEffect) (SLAndroidEffectItf self,
45            SLInterfaceID effectImplementationId);
46
47    SLresult (*ReleaseEffect) (SLAndroidEffectItf self,
48            SLInterfaceID effectImplementationId);
49
50    SLresult (*SetEnabled) (SLAndroidEffectItf self,
51            SLInterfaceID effectImplementationId,
52            SLboolean enabled);
53
54    SLresult (*IsEnabled) (SLAndroidEffectItf self,
55            SLInterfaceID effectImplementationId,
56            SLboolean *pEnabled);
57
58    SLresult (*SendCommand) (SLAndroidEffectItf self,
59            SLInterfaceID effectImplementationId,
60            SLuint32 command,
61            SLuint32 commandSize,
62            void *pCommandData,
63            SLuint32 *replySize,
64            void *pReplyData);
65};
66
67
68/*---------------------------------------------------------------------------*/
69/* Android Effect Send interface                                             */
70/*---------------------------------------------------------------------------*/
71
72extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDEFFECTSEND;
73
74/** Android Effect Send interface methods */
75
76struct SLAndroidEffectSendItf_;
77typedef const struct SLAndroidEffectSendItf_ * const * SLAndroidEffectSendItf;
78
79struct SLAndroidEffectSendItf_ {
80    SLresult (*EnableEffectSend) (
81        SLAndroidEffectSendItf self,
82        SLInterfaceID effectImplementationId,
83        SLboolean enable,
84        SLmillibel initialLevel
85    );
86    SLresult (*IsEnabled) (
87        SLAndroidEffectSendItf self,
88        SLInterfaceID effectImplementationId,
89        SLboolean *pEnable
90    );
91    SLresult (*SetDirectLevel) (
92        SLAndroidEffectSendItf self,
93        SLmillibel directLevel
94    );
95    SLresult (*GetDirectLevel) (
96        SLAndroidEffectSendItf self,
97        SLmillibel *pDirectLevel
98    );
99    SLresult (*SetSendLevel) (
100        SLAndroidEffectSendItf self,
101        SLInterfaceID effectImplementationId,
102        SLmillibel sendLevel
103    );
104    SLresult (*GetSendLevel)(
105        SLAndroidEffectSendItf self,
106        SLInterfaceID effectImplementationId,
107        SLmillibel *pSendLevel
108    );
109};
110
111
112/*---------------------------------------------------------------------------*/
113/* Android Effect Capabilities interface                                     */
114/*---------------------------------------------------------------------------*/
115
116extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDEFFECTCAPABILITIES;
117
118/** Android Effect Capabilities interface methods */
119
120struct SLAndroidEffectCapabilitiesItf_;
121typedef const struct SLAndroidEffectCapabilitiesItf_ * const * SLAndroidEffectCapabilitiesItf;
122
123struct SLAndroidEffectCapabilitiesItf_ {
124
125    SLresult (*QueryNumEffects) (SLAndroidEffectCapabilitiesItf self,
126            SLuint32 *pNumSupportedEffects);
127
128
129    SLresult (*QueryEffect) (SLAndroidEffectCapabilitiesItf self,
130            SLuint32 index,
131            SLInterfaceID *pEffectType,
132            SLInterfaceID *pEffectImplementation,
133            SLchar *pName,
134            SLuint16 *pNameSize);
135};
136
137
138/*---------------------------------------------------------------------------*/
139/* Android Configuration interface                                           */
140/*---------------------------------------------------------------------------*/
141extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDCONFIGURATION;
142
143/** Android Configuration interface methods */
144
145struct SLAndroidConfigurationItf_;
146typedef const struct SLAndroidConfigurationItf_ * const * SLAndroidConfigurationItf;
147
148struct SLAndroidConfigurationItf_ {
149
150    SLresult (*SetConfiguration) (SLAndroidConfigurationItf self,
151            const SLchar *configKey,
152            const void *pConfigValue,
153            SLuint32 valueSize);
154
155    SLresult (*GetConfiguration) (SLAndroidConfigurationItf self,
156           const SLchar *configKey,
157           SLuint32 *pValueSize,
158           void *pConfigValue
159       );
160};
161
162/*---------------------------------------------------------------------------*/
163/* Android File Descriptor Data Locator                                      */
164/*---------------------------------------------------------------------------*/
165/** Addendum to Data locator macros  */
166#define SL_DATALOCATOR_ANDROIDFD        ((SLuint32) 0x800007BD)
167
168#define SL_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE ((SLAint64) 0xFFFFFFFFFFFFFFFFll)
169
170/** File Descriptor-based data locator definition, locatorType must be SL_DATALOCATOR_ANDROIDFD */
171typedef struct SLDataLocator_AndroidFD_ {
172    SLuint32        locatorType;
173    SLint32         fd;
174    SLAint64        offset;
175    SLAint64        length;
176} SLDataLocator_AndroidFD;
177
178
179#ifdef __cplusplus
180}
181#endif /* __cplusplus */
182
183#endif /* OPENSL_ES_ANDROID_H_ */
184