AudioEffect构造流程跟踪 & 音效库实现(native侧)_audioeffect流程-CSDN博客
Android AudioEffect音效移植_音效相关类位于audiofx-CSDN博客
安卓音效AudioEffect源码剖析1——构造流程_谷歌音效audioeffect-CSDN博客
关系图
构建图:
库的导出符号表——audio_effect_library_t
audio_effect_library_t的定义在hardware/libhardware/include/hardware/audio_effect.h中
ASOP\qcom-HAL\audio\post_proc\bundle.c 可以看高通的例子:
const effect_descriptor_t *descriptors[] = {
&equalizer_descriptor,
&bassboost_descriptor,
&virtualizer_descriptor,
&aux_env_reverb_descriptor,
&ins_env_reverb_descriptor,
&aux_preset_reverb_descriptor,
&ins_preset_reverb_descriptor,
NULL,
};
__attribute__ ((visibility ("default")))
audio_effect_library_t AUDIO_EFFECT_LIBRARY_INFO_SYM = {
.tag = AUDIO_EFFECT_LIBRARY_TAG,
.version = EFFECT_LIBRARY_API_VERSION,
.name = "Offload Effects Bundle Library",
.implementor = "The Android Open Source Project",
.create_effect = effect_lib_create,
.release_effect = effect_lib_release,
.get_descriptor = effect_lib_get_descriptor,
};
int effect_lib_get_descriptor(const effect_uuid_t *uuid,
effect_descriptor_t *descriptor)
{
int i;
if (lib_init() != 0)
return init_status;
if (descriptor == NULL || uuid == NULL) {
ALOGV("%s called with NULL pointer", __func__);
return -EINVAL;
}
for (i = 0; descriptors[i] != NULL; i++) {
if (memcmp(uuid, &descriptors[i]->uuid, sizeof(effect_uuid_t)) == 0) {
*descriptor = *descriptors[i];
return 0;
}
}
return -EINVAL;
}