1、库的导出符号表——audio_effect_library_t
audio_effect_library_t的定义在hardware/libhardware/include/hardware/audio_effect.h中。
这个结构体在Android4.3+时有发生变化,query_num_effects()和query_effect()被删除。
如果希望做库兼容性,需要检测EFFECT_LIBRARY_API_VERSION,当其为
#ifEFFECT_API_VERSION_MAJOR(EFFECT_LIBRARY_API_VERSION) > 2时query_num_effects()和query_effect()不复存在。typedef struct audio_effect_library_s {
// tag must be initialized to AUDIO_EFFECT_LIBRARY_TAG
uint32_t tag;
// Version of the effect library API : 0xMMMMmmmm MMMM: Major, mmmm: minor
uint32_t version;
// Name of this library
const char *name;
// Author/owner/implementor of the library
const char *implementor;
//
// Function: query_num_effects
//
// Description: Returns the number of different effects exposed by the
// library. Each effect must have a unique effect uuid (see
// effect_descriptor_t). This function together with EffectQueryEffect()
// is used to enumerate all effects present in the library.
//
// Input/Output:
// pNumEffects: address where the number of effects should be returned.
//
// Output:
// returned value: 0 successful operation.
// -ENODEV library failed to initialize
// -EINVAL invalid pNumEffects
// *pNumEffects: updated with number of effects in library
//
int32_t (*query_num_effects)(uint32_t *pNumEffects);
//
// Function: query_effect
//
// Description: Returns the descriptor of the effect engine which index is
// given as argument.
// See effect_descriptor_t for details on effect descriptors.
// This function together with EffectQueryNumberEffects() is used to enumerate all
// effects present in the library. The enumeration sequence is:
// EffectQueryNumberEffects(&num_effects);
// for (i = 0; i < num_effects; i++)
// EffectQueryEffect(i,...);
//
// Input/Output:
// index: index of the effect
// pDescriptor: address where to return the effect descriptor.
//
// Output:
// returned value: 0 successful operation.
// -ENODEV library failed to initialize
// -EINVAL invalid pDescriptor or index
// -ENOSYS effect list has changed since last execution of
// EffectQueryNumberEffects()
// -ENOENT no more effect available
// *pDescriptor: updated with the effect descriptor.
/