Home | History | Annotate | Download | only in hashgen
      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 
     23 const 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 12 extended interfaces
     82     "ANDROIDBUFFERQUEUESOURCE",
     83 
     84     // OpenMAX AL 1.0.1 interfaces
     85     "XAAUDIODECODERCAPABILITIES",
     86     "XAAUDIOENCODER",
     87     "XAAUDIOENCODERCAPABILITIES",
     88     "XAAUDIOIODEVICECAPABILITIES",
     89     "XACAMERA",
     90     "XACAMERACAPABILITIES",
     91     "XACONFIGEXTENSION",
     92     "XADEVICEVOLUME",
     93     "XADYNAMICINTERFACEMANAGEMENT",
     94     "XADYNAMICSOURCE",
     95     "XAENGINE",
     96     "XAEQUALIZER",
     97     "XAIMAGECONTROLS",
     98     "XAIMAGEDECODERCAPABILITIES",
     99     "XAIMAGEEFFECTS",
    100     "XAIMAGEENCODER",
    101     "XAIMAGEENCODERCAPABILITIES",
    102     "XALED",
    103     "XAMETADATAEXTRACTION",
    104     "XAMETADATAINSERTION",
    105     "XAMETADATATRAVERSAL",
    106     // "XANULL",
    107     "XAOBJECT",
    108     "XAOUTPUTMIX",
    109     "XAPLAY",
    110     "XAPLAYBACKRATE",
    111     "XAPREFETCHSTATUS",
    112     "XARADIO",
    113     "XARDS",
    114     "XARECORD",
    115     "XASEEK",
    116     "XASNAPSHOT",
    117     "XASTREAMINFORMATION",
    118     "XATHREADSYNC",
    119     "XAVIBRA",
    120     "XAVIDEODECODERCAPABILITIES",
    121     "XAVIDEOENCODER",
    122     "XAVIDEOENCODERCAPABILITIES",
    123     "XAVIDEOPOSTPROCESSING",
    124     "XAVOLUME",
    125 
    126     // Android API level 20 extended interfaces
    127     "ANDROIDACOUSTICECHOCANCELLATION",
    128     "ANDROIDAUTOMATICGAINCONTROL",
    129     "ANDROIDNOISESUPPRESSION",
    130 
    131 };
    132 
    133 
    134 /** Convert an MPH value to an MPH identifier */
    135 
    136 void MPH_to_MPH_string(unsigned MPH, char buffer[40])
    137 {
    138     assert(MPH_MAX > MPH);
    139     const char *infix;
    140     infix = "";
    141     strcpy(buffer, "MPH");
    142     strcpy(&buffer[3], infix);
    143     strcat(buffer, "_");
    144     strcat(buffer, interface_names[MPH]);
    145 }
    146