interfaces.c revision 8ca039e1f9d95f8b14a59e135426882e3470e9d9
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 name
18
19#include <assert.h>
20#include <string.h>
21#include "MPH.h"
22
23const char * const interface_names[MPH_MAX] = {
24
25    // OpenSL ES 1.0.1 interfaces
26    "3DCOMMIT",
27    "3DDOPPLER",
28    "3DGROUPING",
29    "3DLOCATION",
30    "3DMACROSCOPIC",
31    "3DSOURCE",
32    "AUDIODECODERCAPABILITIES",
33    "AUDIOENCODER",
34    "AUDIOENCODERCAPABILITIES",
35    "AUDIOIODEVICECAPABILITIES",
36    "BASSBOOST",
37    "BUFFERQUEUE",
38    "DEVICEVOLUME",
39    "DYNAMICINTERFACEMANAGEMENT",
40    "DYNAMICSOURCE",
41    "EFFECTSEND",
42    "ENGINE",
43    "ENGINECAPABILITIES",
44    "ENVIRONMENTALREVERB",
45    "EQUALIZER",
46    "LED",
47    "METADATAEXTRACTION",
48    "METADATATRAVERSAL",
49    "MIDIMESSAGE",
50    "MIDIMUTESOLO",
51    "MIDITEMPO",
52    "MIDITIME",
53    "MUTESOLO",
54    "NULL",
55    "OBJECT",
56    "OUTPUTMIX",
57    "PITCH",
58    "PLAY",
59    "PLAYBACKRATE",
60    "PREFETCHSTATUS",
61    "PRESETREVERB",
62    "RATEPITCH",
63    "RECORD",
64    "SEEK",
65    "THREADSYNC",
66    "VIBRA",
67    "VIRTUALIZER",
68    "VISUALIZATION",
69    "VOLUME",
70
71    // Wilhelm desktop extended interfaces
72    "OUTPUTMIXEXT",
73
74    // Android API level 9 extended interfaces
75    "ANDROIDEFFECT",
76    "ANDROIDEFFECTCAPABILITIES",
77    "ANDROIDEFFECTSEND",
78    "ANDROIDCONFIGURATION",
79    "ANDROIDSIMPLEBUFFERQUEUE",
80
81    // Android API level 10 extended interfaces
82    "ANDROIDBUFFERQUEUE",
83
84    // OpenMAX AL 1.0.1
85    "XAENGINE",
86    "XAPLAY",
87    "XASTREAMINFORMATION",
88
89};
90
91
92/** Convert an MPH value to an MPH identifier */
93
94void MPH_to_MPH_string(unsigned MPH, char buffer[40])
95{
96    assert(MPH_MAX > MPH);
97    const char *infix;
98    infix = "";
99    strcpy(buffer, "MPH");
100    strcpy(&buffer[3], infix);
101    strcat(buffer, "_");
102    strcat(buffer, interface_names[MPH]);
103}
104