• 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 // Map minimal perfect hash of an interface ID to its class index.
18 
19 #include "MPH.h"
20 
21 // If defined, then compile with C99 such as GNU C, not GNU C++ or non-GNU C.
22 //#define USE_DESIGNATED_INITIALIZERS
23 
24 // It is critical that all entries are populated with either a specific index
25 // or -1. Do not let the compiler use a default initializer of zero, because
26 // that actually maps to the IObject index. For non-USE_DESIGNATED_INITIALIZERS
27 // builds, we use the automagically-generated MPH_to_*.h files for this reason.
28 
29 // A good test is to use the GNU C compiler with -S option (for assembler output),
30 // and compile both with and without USE_DESIGNATED_INITIALIZERS.  The resulting .s
31 // files should be identical for both compilations.
32 
33 // Important note: if you add any interfaces here, be sure to also
34 // update the #define for the corresponding INTERFACES_<Class>.
35 
36 // IObject is the first interface in a class, so the index for MPH_OBJECT must be zero.
37 // Don't cross streams, otherwise bad things happen.
38 
39 
40 const signed char MPH_to_3DGroup[MPH_MAX] = {
41 #ifdef USE_DESIGNATED_INITIALIZERS
42     [0 ... MPH_MAX-1] = -1,
43     [MPH_OBJECT] = 0,
44     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
45     [MPH_3DLOCATION] = 2,
46     [MPH_3DDOPPLER] = 3,
47     [MPH_3DSOURCE] = 4,
48     [MPH_3DMACROSCOPIC] = 5
49 #else
50 #include "MPH_to_3DGroup.h"
51 #endif
52 };
53 
54 const signed char MPH_to_AudioPlayer[MPH_MAX] = {
55 #ifdef USE_DESIGNATED_INITIALIZERS
56     [0 ... MPH_MAX-1] = -1,
57     [MPH_OBJECT] = 0,
58     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
59     [MPH_PLAY] = 2,
60     [MPH_3DDOPPLER] = 3,
61     [MPH_3DGROUPING] = 4,
62     [MPH_3DLOCATION] = 5,
63     [MPH_3DSOURCE] = 6,
64     [MPH_BUFFERQUEUE] = 7,
65     [MPH_EFFECTSEND] = 8,
66     [MPH_MUTESOLO] = 9,
67     [MPH_METADATAEXTRACTION] = 10,
68     [MPH_METADATATRAVERSAL] = 11,
69     [MPH_PREFETCHSTATUS] = 12,
70     [MPH_RATEPITCH] = 13,
71     [MPH_SEEK] = 14,
72     [MPH_VOLUME] = 15,
73     [MPH_3DMACROSCOPIC] = 16,
74     [MPH_BASSBOOST] = 17,
75     [MPH_DYNAMICSOURCE] = 18,
76     [MPH_ENVIRONMENTALREVERB] = 19,
77     [MPH_EQUALIZER] = 20,
78     [MPH_PITCH] = 21,
79     [MPH_PRESETREVERB] = 22,
80     [MPH_PLAYBACKRATE] = 23,
81     [MPH_VIRTUALIZER] = 24,
82     [MPH_VISUALIZATION] = 25,
83 #ifdef ANDROID
84     [MPH_ANDROIDEFFECT] = 26,
85     [MPH_ANDROIDEFFECTSEND] = 27,
86     [MPH_ANDROIDCONFIGURATION] = 28,
87     [MPH_ANDROIDSIMPLEBUFFERQUEUE] = 7,  // alias for [MPH_BUFFERQUEUE]
88     [MPH_ANDROIDBUFFERQUEUESOURCE] = 29
89 #endif
90 #else
91 #include "MPH_to_AudioPlayer.h"
92 #endif
93 };
94 
95 const signed char MPH_to_AudioRecorder[MPH_MAX] = {
96 #ifdef USE_DESIGNATED_INITIALIZERS
97     [0 ... MPH_MAX-1] = -1,
98     [MPH_OBJECT] = 0,
99     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
100     [MPH_RECORD] = 2,
101     [MPH_AUDIOENCODER] = 3,
102     [MPH_BASSBOOST] = 4,
103     [MPH_DYNAMICSOURCE] = 5,
104     [MPH_EQUALIZER] = 6,
105     [MPH_VISUALIZATION] = 7,
106     [MPH_VOLUME] = 8,
107 #ifdef ANDROID
108     [MPH_ANDROIDSIMPLEBUFFERQUEUE] = 9, // this is not an alias
109     [MPH_ANDROIDCONFIGURATION] = 10,
110     [MPH_ANDROIDACOUSTICECHOCANCELLATION] = 11,
111     [MPH_ANDROIDAUTOMATICGAINCONTROL] = 12,
112     [MPH_ANDROIDNOISESUPPRESSION] = 13,
113 #endif
114 #else
115 #include "MPH_to_AudioRecorder.h"
116 #endif
117 };
118 
119 const signed char MPH_to_Engine[MPH_MAX] = {
120 #ifdef USE_DESIGNATED_INITIALIZERS
121     [0 ... MPH_MAX-1] = -1,
122     [MPH_OBJECT] = 0,
123     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
124     [MPH_ENGINE] = 2,
125     [MPH_ENGINECAPABILITIES] = 3,
126     [MPH_THREADSYNC] = 4,
127     [MPH_AUDIOIODEVICECAPABILITIES] = 5,
128     [MPH_AUDIODECODERCAPABILITIES] = 6,
129     [MPH_AUDIOENCODERCAPABILITIES] = 7,
130     [MPH_3DCOMMIT] = 8,
131     [MPH_DEVICEVOLUME] = 9,
132     [MPH_XAENGINE] = 10,
133 #ifdef ANDROID
134     [MPH_ANDROIDEFFECTCAPABILITIES] = 11,
135 #endif
136     [MPH_XAVIDEODECODERCAPABILITIES] = 12
137 #else
138 #include "MPH_to_Engine.h"
139 #endif
140 };
141 
142 const signed char MPH_to_LEDDevice[MPH_MAX] = {
143 #ifdef USE_DESIGNATED_INITIALIZERS
144     [0 ... MPH_MAX-1] = -1,
145     [MPH_OBJECT] = 0,
146     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
147     [MPH_LED] = 2
148 #else
149 #include "MPH_to_LEDDevice.h"
150 #endif
151 };
152 
153 const signed char MPH_to_Listener[MPH_MAX] = {
154 #ifdef USE_DESIGNATED_INITIALIZERS
155     [0 ... MPH_MAX-1] = -1,
156     [MPH_OBJECT] = 0,
157     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
158     [MPH_3DDOPPLER] = 2,
159     [MPH_3DLOCATION] = 3
160 #else
161 #include "MPH_to_Listener.h"
162 #endif
163 };
164 
165 const signed char MPH_to_MetadataExtractor[MPH_MAX] = {
166 #ifdef USE_DESIGNATED_INITIALIZERS
167     [0 ... MPH_MAX-1] = -1,
168     [MPH_OBJECT] = 0,
169     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
170     [MPH_DYNAMICSOURCE] = 2,
171     [MPH_METADATAEXTRACTION] = 3,
172     [MPH_METADATATRAVERSAL] = 4
173 #else
174 #include "MPH_to_MetadataExtractor.h"
175 #endif
176 };
177 
178 const signed char MPH_to_MidiPlayer[MPH_MAX] = {
179 #ifdef USE_DESIGNATED_INITIALIZERS
180     [0 ... MPH_MAX-1] = -1,
181     [MPH_OBJECT] = 0,
182     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
183     [MPH_PLAY] = 2,
184     [MPH_3DDOPPLER] = 3,
185     [MPH_3DGROUPING] = 4,
186     [MPH_3DLOCATION] = 5,
187     [MPH_3DSOURCE] = 6,
188     [MPH_BUFFERQUEUE] = 7,
189     [MPH_EFFECTSEND] = 8,
190     [MPH_MUTESOLO] = 9,
191     [MPH_METADATAEXTRACTION] = 10,
192     [MPH_METADATATRAVERSAL] = 11,
193     [MPH_MIDIMESSAGE] = 12,
194     [MPH_MIDITIME] = 13,
195     [MPH_MIDITEMPO] = 14,
196     [MPH_MIDIMUTESOLO] = 15,
197     [MPH_PREFETCHSTATUS] = 16,
198     [MPH_SEEK] = 17,
199     [MPH_VOLUME] = 18,
200     [MPH_3DMACROSCOPIC] = 19,
201     [MPH_BASSBOOST] = 20,
202     [MPH_DYNAMICSOURCE] = 21,
203     [MPH_ENVIRONMENTALREVERB] = 22,
204     [MPH_EQUALIZER] = 23,
205     [MPH_PITCH] = 24,
206     [MPH_PRESETREVERB] = 25,
207     [MPH_PLAYBACKRATE] = 26,
208     [MPH_VIRTUALIZER] = 27,
209     [MPH_VISUALIZATION] = 28,
210 #else
211 #include "MPH_to_MidiPlayer.h"
212 #endif
213 };
214 
215 const signed char MPH_to_OutputMix[MPH_MAX] = {
216 #ifdef USE_DESIGNATED_INITIALIZERS
217     [0 ... MPH_MAX-1] = -1,
218     [MPH_OBJECT] = 0,
219     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
220     [MPH_OUTPUTMIX] = 2,
221 #ifdef USE_OUTPUTMIXEXT
222     [MPH_OUTPUTMIXEXT] = 3,
223 #endif
224     [MPH_ENVIRONMENTALREVERB] = 4,
225     [MPH_EQUALIZER] = 5,
226     [MPH_PRESETREVERB] = 6,
227     [MPH_VIRTUALIZER] = 7,
228     [MPH_VOLUME] = 8,
229     [MPH_BASSBOOST] = 9,
230     [MPH_VISUALIZATION] = 10,
231 #ifdef ANDROID
232     [MPH_ANDROIDEFFECT] = 11
233 #endif
234 #else
235 #include "MPH_to_OutputMix.h"
236 #endif
237 };
238 
239 const signed char MPH_to_Vibra[MPH_MAX] = {
240 #ifdef USE_DESIGNATED_INITIALIZERS
241     [0 ... MPH_MAX-1] = -1,
242     [MPH_OBJECT] = 0,
243     [MPH_DYNAMICINTERFACEMANAGEMENT] = 1,
244     [MPH_VIBRA] = 2
245 #else
246 #include "MPH_to_Vibra.h"
247 #endif
248 };
249 
250 const signed char MPH_to_MediaPlayer[MPH_MAX] = {
251 #ifdef USE_DESIGNATED_INITIALIZERS
252     [0 ... MPH_MAX-1] = -1,
253     [MPH_XAOBJECT] = 0,
254     [MPH_XADYNAMICINTERFACEMANAGEMENT] = 1,
255     [MPH_XAPLAY] = 2,
256     [MPH_XASTREAMINFORMATION] = 3,
257     [MPH_XAVOLUME] = 4,
258     [MPH_XASEEK] = 5,
259     [MPH_XAPREFETCHSTATUS] = 6,
260 #ifdef ANDROID
261     [MPH_ANDROIDBUFFERQUEUESOURCE] = 7,
262 #endif
263 #else
264 #include "MPH_to_MediaPlayer.h"
265 #endif
266 };
267