blob: d015505248d6262c25c5224aa10dd3086a2ddd62 [file] [log] [blame]
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This file is automagically generated by hashgen, do not edit
/** \file IID_to_MPH.c Interface ID to MPH mapping */
#include "SLES/OpenSLES.h"
#include "MPH.h"
#include <assert.h>
#include <string.h>
extern const struct SLInterfaceID_ SL_IID_array[MPH_MAX];
/** \brief Map SLInterfaceID to its minimal perfect hash (MPH), or -1 if unknown */
int IID_to_MPH(const SLInterfaceID iid)
{
#define MAX_HASH_VALUE 204
static const unsigned char asso_values[] =
{
35, 20, 54, 84, 205, 205, 59, 205, 205, 205,
205, 205, 205, 205, 69, 205, 64, 44, 205, 205,
205, 205, 39, 205, 54, 14, 205, 205, 14, 205,
205, 125, 5, 205, 205, 205, 205, 205, 205, 205,
127, 205, 205, 205, 9, 205, 112, 205, 205, 205,
205, 205, 122, 205, 205, 205, 205, 205, 14, 100,
205, 9, 24, 205, 50, 205, 205, 205, 205, 117,
205, 205, 97, 85, 205, 205, 205, 205, 205, 205,
205, 205, 205, 205, 205, 205, 117, 205, 19, 205,
205, 205, 9, 205, 205, 205, 25, 205, 14, 102,
205, 205, 205, 205, 205, 205, 205, 4, 205, 97,
205, 205, 0, 205, 4, 92, 117, 205, 67, 45,
205, 205, 110, 205, 205, 205, 72, 205, 40, 205,
205, 205, 205, 205, 205, 102, 52, 205, 205, 205,
205, 205, 57, 67, 205, 62, 205, 125, 205, 205,
205, 205, 205, 82, 205, 205, 72, 205, 205, 65,
5, 205, 32, 205, 205, 67, 120, 205, 205, 37,
205, 57, 55, 205, 205, 47, 205, 45, 205, 205,
205, 205, 7, 205, 17, 30, 205, 205, 205, 205,
205, 205, 0, 205, 205, 205, 105, 32, 205, 205,
205, 205, 205, 205, 205, 205, 115, 205, 205, 205,
95, 32, 205, 205, 205, 22, 205, 205, 2, 205,
205, 205, 205, 12, 10, 205, 205, 12, 205, 205,
205, 205, 205, 205, 2, 205, 70, 205, 205, 205,
10, 2, 205, 205, 70, 205, 120, 115, 205, 205,
205, 80, 105, 100, 205, 205
};
static const signed char hash_to_MPH[] = {
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
MPH_ANDROIDEFFECTSEND,
-1,
MPH_XADYNAMICINTERFACEMANAGEMENT,
-1,
MPH_XAAUDIODECODERCAPABILITIES,
MPH_XALED,
-1,
MPH_XATHREADSYNC,
-1,
MPH_XAOUTPUTMIX,
MPH_MIDITIME,
-1,
MPH_XAIMAGECONTROLS,
-1,
MPH_AUDIOIODEVICECAPABILITIES,
MPH_MUTESOLO,
-1,
MPH_XAVOLUME,
-1,
MPH_ANDROIDCONFIGURATION,
MPH_XASNAPSHOT,
-1,
MPH_XAPLAY,
-1,
MPH_SEEK,
MPH_3DLOCATION,
-1,
MPH_XACONFIGEXTENSION,
-1,
MPH_XAIMAGEDECODERCAPABILITIES,
MPH_XACAMERACAPABILITIES,
-1,
MPH_3DMACROSCOPIC,
-1,
MPH_VIBRA,
MPH_XAIMAGEEFFECTS,
-1,
MPH_XAMETADATAEXTRACTION,
-1,
MPH_PRESETREVERB,
MPH_XAOBJECT,
-1,
MPH_RATEPITCH,
-1,
MPH_PITCH,
MPH_XAVIBRA,
-1,
MPH_XARADIO,
-1,
MPH_OUTPUTMIXEXT,
MPH_ENGINECAPABILITIES,
-1,
MPH_XAVIDEOPOSTPROCESSING,
-1,
MPH_3DCOMMIT,
MPH_XAVIDEODECODERCAPABILITIES,
-1,
MPH_METADATATRAVERSAL,
-1,
MPH_XASEEK,
MPH_AUDIODECODERCAPABILITIES,
-1,
MPH_DEVICEVOLUME,
-1,
MPH_OBJECT,
MPH_ENVIRONMENTALREVERB,
-1,
MPH_XARDS,
-1,
MPH_XAVIDEOENCODER,
MPH_OUTPUTMIX,
-1,
MPH_XADYNAMICSOURCE,
-1,
MPH_3DGROUPING,
MPH_XASTREAMINFORMATION,
-1,
MPH_XAPREFETCHSTATUS,
-1,
MPH_XAMETADATATRAVERSAL,
MPH_VIRTUALIZER,
-1,
MPH_BUFFERQUEUE,
-1,
MPH_ANDROIDBUFFERQUEUE,
MPH_PLAY,
-1,
MPH_XAMETADATAINSERTION,
-1,
MPH_XADEVICEVOLUME,
MPH_XAVIDEOENCODERCAPABILITIES,
-1,
MPH_ENGINE,
-1,
MPH_MIDIMUTESOLO,
MPH_XAEQUALIZER,
-1,
MPH_METADATAEXTRACTION,
-1,
-1,
MPH_XARECORD,
-1,
MPH_XAIMAGEENCODER,
-1,
-1,
MPH_VISUALIZATION,
-1,
MPH_XACAMERA,
-1,
-1,
MPH_BASSBOOST,
-1,
MPH_LED,
-1,
-1,
MPH_EFFECTSEND,
-1,
MPH_XAENGINE,
-1,
-1,
MPH_RECORD,
-1,
MPH_MIDIMESSAGE,
-1,
-1,
MPH_ANDROIDEFFECTCAPABILITIES,
-1,
MPH_3DSOURCE,
-1,
-1,
MPH_VOLUME,
-1,
MPH_XAAUDIOENCODERCAPABILITIES,
-1,
-1,
MPH_PLAYBACKRATE,
-1,
MPH_XAAUDIOIODEVICECAPABILITIES,
-1,
-1,
MPH_NULL,
-1,
MPH_ANDROIDEFFECT,
-1,
-1,
MPH_XAIMAGEENCODERCAPABILITIES,
-1,
MPH_XAPLAYBACKRATE,
-1,
-1,
MPH_MIDITEMPO,
-1,
MPH_DYNAMICSOURCE,
-1,
-1,
MPH_DYNAMICINTERFACEMANAGEMENT,
-1,
MPH_EQUALIZER,
-1,
-1,
MPH_XAAUDIOENCODER,
-1,
MPH_THREADSYNC,
-1,
-1,
MPH_PREFETCHSTATUS,
-1,
MPH_3DDOPPLER,
-1,
-1,
MPH_ANDROIDSIMPLEBUFFERQUEUE,
-1,
-1,
-1,
-1,
MPH_AUDIOENCODERCAPABILITIES,
-1,
-1,
-1,
-1,
MPH_AUDIOENCODER
};
if (&SL_IID_array[0] <= iid && &SL_IID_array[MPH_MAX] > iid)
return iid - &SL_IID_array[0];
if (NULL != iid) {
static const unsigned len = sizeof(struct SLInterfaceID_);
unsigned key = len +
asso_values[((unsigned char *)iid)[12]] + asso_values[((unsigned char *)iid)[0]];
if (key <= MAX_HASH_VALUE) {
int MPH = hash_to_MPH[key];
if (MPH >= 0) {
assert(MPH < MPH_MAX);
SLInterfaceID trial = &SL_IID_array[MPH];
if (!memcmp(iid, trial, sizeof(struct SLInterfaceID_)))
return MPH;
}
}
}
return -1;
}