Loading audio/aidl/default/Android.bp +0 −16 Original line number Diff line number Diff line Loading @@ -152,23 +152,7 @@ cc_binary { vintf_fragments: ["android.hardware.audio.effect.service-aidl.xml"], defaults: ["aidlaudioeffectservice_defaults"], shared_libs: [ "libaecsw", "libagcsw", "libbassboostsw", "libbundleaidl", "libdownmixaidl", "libdynamicsprocessingaidl", "libenvreverbsw", "libequalizersw", "libhapticgeneratoraidl", "libloudnessenhanceraidl", "libnssw", "libpresetreverbsw", "libreverbaidl", "libtinyxml2", "libvirtualizersw", "libvisualizeraidl", "libvolumesw", ], srcs: [ "EffectConfig.cpp", Loading audio/aidl/default/EffectConfig.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -79,14 +79,30 @@ std::vector<std::reference_wrapper<const tinyxml2::XMLElement>> EffectConfig::ge return children; } bool EffectConfig::resolveLibrary(const std::string& path, std::string* resolvedPath) { for (auto* libraryDirectory : kEffectLibPath) { std::string candidatePath = std::string(libraryDirectory) + '/' + path; if (access(candidatePath.c_str(), R_OK) == 0) { *resolvedPath = std::move(candidatePath); return true; } } return false; } bool EffectConfig::parseLibrary(const tinyxml2::XMLElement& xml) { const char* name = xml.Attribute("name"); RETURN_VALUE_IF(!name, false, "noNameAttribute"); const char* path = xml.Attribute("path"); RETURN_VALUE_IF(!path, false, "noPathAttribute"); mLibraryMap[name] = path; LOG(DEBUG) << __func__ << " " << name << " : " << path; std::string resolvedPath; if (!resolveLibrary(path, &resolvedPath)) { LOG(ERROR) << __func__ << " can't find " << path; return false; } mLibraryMap[name] = resolvedPath; LOG(DEBUG) << __func__ << " " << name << " : " << resolvedPath; return true; } Loading audio/aidl/default/EffectFactory.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ ndk::ScopedAStatus Factory::destroyEffect(const std::shared_ptr<IEffect>& in_han return status; } bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& libName) { bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& path) { std::function<void(void*)> dlClose = [](void* handle) -> void { if (handle && dlclose(handle)) { LOG(ERROR) << "dlclose failed " << dlerror(); Loading @@ -173,19 +173,19 @@ bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& libNam }; auto libHandle = std::unique_ptr<void, decltype(dlClose)>{dlopen(libName.c_str(), RTLD_LAZY), dlClose}; std::unique_ptr<void, decltype(dlClose)>{dlopen(path.c_str(), RTLD_LAZY), dlClose}; if (!libHandle) { LOG(ERROR) << __func__ << ": dlopen failed, err: " << dlerror(); return false; } LOG(INFO) << __func__ << " dlopen lib:" << libName << "\nimpl:" << impl.toString() LOG(INFO) << __func__ << " dlopen lib:" << path << "\nimpl:" << impl.toString() << "\nhandle:" << libHandle; auto interface = new effect_dl_interface_s{nullptr, nullptr, nullptr}; mEffectLibMap.insert( {impl, std::make_tuple(std::move(libHandle), std::unique_ptr<struct effect_dl_interface_s>(interface), libName)}); std::unique_ptr<struct effect_dl_interface_s>(interface), path)}); return true; } Loading @@ -199,8 +199,8 @@ void Factory::createIdentityWithConfig(const EffectConfig::LibraryUuid& configLi id.type = typeUuid; id.uuid = configLib.uuid; id.proxy = proxyUuid; LOG(DEBUG) << __func__ << ": typeUuid " << id.type.toString() << "\nimplUuid " << id.uuid.toString() << " proxyUuid " LOG(DEBUG) << __func__ << " loading lib " << path->second << ": typeUuid " << id.type.toString() << "\nimplUuid " << id.uuid.toString() << " proxyUuid " << (proxyUuid.has_value() ? proxyUuid->toString() : "null"); if (openEffectLibrary(id.uuid, path->second)) { mIdentitySet.insert(std::move(id)); Loading audio/aidl/default/acousticEchoCanceler/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ cc_library_shared { "AcousticEchoCancelerSw.cpp", ":effectCommonFile", ], relative_install_path: "soundfx", visibility: [ "//hardware/interfaces/audio/aidl/default", ], Loading audio/aidl/default/automaticGainControl/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ cc_library_shared { "AutomaticGainControlSw.cpp", ":effectCommonFile", ], relative_install_path: "soundfx", visibility: [ "//hardware/interfaces/audio/aidl/default", ], Loading Loading
audio/aidl/default/Android.bp +0 −16 Original line number Diff line number Diff line Loading @@ -152,23 +152,7 @@ cc_binary { vintf_fragments: ["android.hardware.audio.effect.service-aidl.xml"], defaults: ["aidlaudioeffectservice_defaults"], shared_libs: [ "libaecsw", "libagcsw", "libbassboostsw", "libbundleaidl", "libdownmixaidl", "libdynamicsprocessingaidl", "libenvreverbsw", "libequalizersw", "libhapticgeneratoraidl", "libloudnessenhanceraidl", "libnssw", "libpresetreverbsw", "libreverbaidl", "libtinyxml2", "libvirtualizersw", "libvisualizeraidl", "libvolumesw", ], srcs: [ "EffectConfig.cpp", Loading
audio/aidl/default/EffectConfig.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -79,14 +79,30 @@ std::vector<std::reference_wrapper<const tinyxml2::XMLElement>> EffectConfig::ge return children; } bool EffectConfig::resolveLibrary(const std::string& path, std::string* resolvedPath) { for (auto* libraryDirectory : kEffectLibPath) { std::string candidatePath = std::string(libraryDirectory) + '/' + path; if (access(candidatePath.c_str(), R_OK) == 0) { *resolvedPath = std::move(candidatePath); return true; } } return false; } bool EffectConfig::parseLibrary(const tinyxml2::XMLElement& xml) { const char* name = xml.Attribute("name"); RETURN_VALUE_IF(!name, false, "noNameAttribute"); const char* path = xml.Attribute("path"); RETURN_VALUE_IF(!path, false, "noPathAttribute"); mLibraryMap[name] = path; LOG(DEBUG) << __func__ << " " << name << " : " << path; std::string resolvedPath; if (!resolveLibrary(path, &resolvedPath)) { LOG(ERROR) << __func__ << " can't find " << path; return false; } mLibraryMap[name] = resolvedPath; LOG(DEBUG) << __func__ << " " << name << " : " << resolvedPath; return true; } Loading
audio/aidl/default/EffectFactory.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ ndk::ScopedAStatus Factory::destroyEffect(const std::shared_ptr<IEffect>& in_han return status; } bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& libName) { bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& path) { std::function<void(void*)> dlClose = [](void* handle) -> void { if (handle && dlclose(handle)) { LOG(ERROR) << "dlclose failed " << dlerror(); Loading @@ -173,19 +173,19 @@ bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& libNam }; auto libHandle = std::unique_ptr<void, decltype(dlClose)>{dlopen(libName.c_str(), RTLD_LAZY), dlClose}; std::unique_ptr<void, decltype(dlClose)>{dlopen(path.c_str(), RTLD_LAZY), dlClose}; if (!libHandle) { LOG(ERROR) << __func__ << ": dlopen failed, err: " << dlerror(); return false; } LOG(INFO) << __func__ << " dlopen lib:" << libName << "\nimpl:" << impl.toString() LOG(INFO) << __func__ << " dlopen lib:" << path << "\nimpl:" << impl.toString() << "\nhandle:" << libHandle; auto interface = new effect_dl_interface_s{nullptr, nullptr, nullptr}; mEffectLibMap.insert( {impl, std::make_tuple(std::move(libHandle), std::unique_ptr<struct effect_dl_interface_s>(interface), libName)}); std::unique_ptr<struct effect_dl_interface_s>(interface), path)}); return true; } Loading @@ -199,8 +199,8 @@ void Factory::createIdentityWithConfig(const EffectConfig::LibraryUuid& configLi id.type = typeUuid; id.uuid = configLib.uuid; id.proxy = proxyUuid; LOG(DEBUG) << __func__ << ": typeUuid " << id.type.toString() << "\nimplUuid " << id.uuid.toString() << " proxyUuid " LOG(DEBUG) << __func__ << " loading lib " << path->second << ": typeUuid " << id.type.toString() << "\nimplUuid " << id.uuid.toString() << " proxyUuid " << (proxyUuid.has_value() ? proxyUuid->toString() : "null"); if (openEffectLibrary(id.uuid, path->second)) { mIdentitySet.insert(std::move(id)); Loading
audio/aidl/default/acousticEchoCanceler/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ cc_library_shared { "AcousticEchoCancelerSw.cpp", ":effectCommonFile", ], relative_install_path: "soundfx", visibility: [ "//hardware/interfaces/audio/aidl/default", ], Loading
audio/aidl/default/automaticGainControl/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ cc_library_shared { "AutomaticGainControlSw.cpp", ":effectCommonFile", ], relative_install_path: "soundfx", visibility: [ "//hardware/interfaces/audio/aidl/default", ], Loading