mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 05:49:27 +00:00
Support passing entire effect_param_t as vendor extension
Replace the UUID toString with hex version Bug: 271500140 Test: Enable AIDL Test: atest libAudioHalEffectParamTest Change-Id: I79a5db25dc45774821a9a9a6bcda77c04e9da90d Merged-In: I79a5db25dc45774821a9a9a6bcda77c04e9da90d
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <string>
|
||||
#define LOG_TAG "AHAL_EffectConfig"
|
||||
#include <android-base/logging.h>
|
||||
#include <system/audio_aidl_utils.h>
|
||||
#include <system/audio_effects/audio_effects_conf.h>
|
||||
#include <system/audio_effects/effect_uuid.h>
|
||||
|
||||
@@ -162,7 +163,7 @@ bool EffectConfig::parseLibraryUuid(const tinyxml2::XMLElement& xml,
|
||||
RETURN_VALUE_IF((libraryUuid.uuid == getEffectUuidZero()), false, "invalidUuidAttribute");
|
||||
|
||||
LOG(DEBUG) << __func__ << (isProxy ? " proxy " : libraryUuid.name) << " : "
|
||||
<< libraryUuid.uuid.toString();
|
||||
<< ::android::audio::utils::toString(libraryUuid.uuid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -250,6 +251,7 @@ bool EffectConfig::findUuid(const std::string& xmlEffectName, AudioUuid* uuid) {
|
||||
V("downmix", Downmix) \
|
||||
V("dynamics_processing", DynamicsProcessing) \
|
||||
V("equalizer", Equalizer) \
|
||||
V("extensioneffect", Extension) \
|
||||
V("haptic_generator", HapticGenerator) \
|
||||
V("loudness_enhancer", LoudnessEnhancer) \
|
||||
V("env_reverb", EnvReverb) \
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_ibinder_platform.h>
|
||||
#include <system/audio_aidl_utils.h>
|
||||
#include <system/audio_effects/effect_uuid.h>
|
||||
#include <system/thread_defs.h>
|
||||
|
||||
@@ -47,7 +48,7 @@ Factory::~Factory() {
|
||||
for (const auto& it : mEffectMap) {
|
||||
if (auto spEffect = it.first.lock()) {
|
||||
LOG(ERROR) << __func__ << " erase remaining instance UUID "
|
||||
<< it.second.first.toString();
|
||||
<< ::android::audio::utils::toString(it.second.first);
|
||||
destroyEffectImpl(spEffect);
|
||||
}
|
||||
}
|
||||
@@ -123,7 +124,7 @@ ndk::ScopedAStatus Factory::queryProcessing(const std::optional<Processing::Type
|
||||
|
||||
ndk::ScopedAStatus Factory::createEffect(const AudioUuid& in_impl_uuid,
|
||||
std::shared_ptr<IEffect>* _aidl_return) {
|
||||
LOG(DEBUG) << __func__ << ": UUID " << in_impl_uuid.toString();
|
||||
LOG(DEBUG) << __func__ << ": UUID " << ::android::audio::utils::toString(in_impl_uuid);
|
||||
if (mEffectLibMap.count(in_impl_uuid)) {
|
||||
auto& entry = mEffectLibMap[in_impl_uuid];
|
||||
getDlSyms(entry);
|
||||
@@ -163,7 +164,8 @@ ndk::ScopedAStatus Factory::destroyEffectImpl(const std::shared_ptr<IEffect>& in
|
||||
"dlNulldestroyEffectFunc");
|
||||
RETURN_IF_BINDER_EXCEPTION(interface->destroyEffectFunc(in_handle));
|
||||
} else {
|
||||
LOG(ERROR) << __func__ << ": UUID " << uuid.toString() << " does not exist in libMap!";
|
||||
LOG(ERROR) << __func__ << ": UUID " << ::android::audio::utils::toString(uuid)
|
||||
<< " does not exist in libMap!";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
mEffectMap.erase(effectIt);
|
||||
@@ -207,8 +209,8 @@ bool Factory::openEffectLibrary(const AudioUuid& impl, const std::string& path)
|
||||
return false;
|
||||
}
|
||||
|
||||
LOG(INFO) << __func__ << " dlopen lib:" << path << "\nimpl:" << impl.toString()
|
||||
<< "\nhandle:" << libHandle;
|
||||
LOG(INFO) << __func__ << " dlopen lib:" << path
|
||||
<< "\nimpl:" << ::android::audio::utils::toString(impl) << "\nhandle:" << libHandle;
|
||||
auto interface = new effect_dl_interface_s{nullptr, nullptr, nullptr};
|
||||
mEffectLibMap.insert(
|
||||
{impl,
|
||||
@@ -228,8 +230,10 @@ void Factory::createIdentityWithConfig(const EffectConfig::LibraryUuid& configLi
|
||||
id.uuid = configLib.uuid;
|
||||
id.proxy = proxyUuid;
|
||||
LOG(DEBUG) << __func__ << " loading lib " << path->second << ": typeUuid "
|
||||
<< id.type.toString() << "\nimplUuid " << id.uuid.toString() << " proxyUuid "
|
||||
<< (proxyUuid.has_value() ? proxyUuid->toString() : "null");
|
||||
<< ::android::audio::utils::toString(id.type) << "\nimplUuid "
|
||||
<< ::android::audio::utils::toString(id.uuid) << " proxyUuid "
|
||||
<< (proxyUuid.has_value() ? ::android::audio::utils::toString(proxyUuid.value())
|
||||
: "null");
|
||||
if (openEffectLibrary(id.uuid, path->second)) {
|
||||
mIdentitySet.insert(std::move(id));
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
using aidl::android::hardware::audio::effect::DefaultExtension;
|
||||
using aidl::android::hardware::audio::effect::Descriptor;
|
||||
using aidl::android::hardware::audio::effect::ExtensionEffect;
|
||||
using aidl::android::hardware::audio::effect::getEffectUuidExtensionImpl;
|
||||
using aidl::android::hardware::audio::effect::getEffectUuidExtensionType;
|
||||
using aidl::android::hardware::audio::effect::getEffectImplUuidExtension;
|
||||
using aidl::android::hardware::audio::effect::getEffectTypeUuidExtension;
|
||||
using aidl::android::hardware::audio::effect::IEffect;
|
||||
using aidl::android::hardware::audio::effect::Range;
|
||||
using aidl::android::hardware::audio::effect::VendorExtension;
|
||||
@@ -39,7 +39,7 @@ using aidl::android::media::audio::common::AudioUuid;
|
||||
|
||||
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
|
||||
std::shared_ptr<IEffect>* instanceSpp) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != getEffectUuidExtensionImpl()) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidExtension()) {
|
||||
LOG(ERROR) << __func__ << "uuid not supported";
|
||||
return EX_ILLEGAL_ARGUMENT;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
|
||||
}
|
||||
|
||||
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != getEffectUuidExtensionImpl()) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidExtension()) {
|
||||
LOG(ERROR) << __func__ << "uuid not supported";
|
||||
return EX_ILLEGAL_ARGUMENT;
|
||||
}
|
||||
@@ -67,8 +67,8 @@ namespace aidl::android::hardware::audio::effect {
|
||||
const std::string ExtensionEffect::kEffectName = "ExtensionEffectExample";
|
||||
|
||||
const Descriptor ExtensionEffect::kDescriptor = {
|
||||
.common = {.id = {.type = getEffectUuidExtensionType(),
|
||||
.uuid = getEffectUuidExtensionImpl(),
|
||||
.common = {.id = {.type = getEffectTypeUuidExtension(),
|
||||
.uuid = getEffectImplUuidExtension(),
|
||||
.proxy = std::nullopt},
|
||||
.name = ExtensionEffect::kEffectName,
|
||||
.implementor = "The Android Open Source Project"}};
|
||||
|
||||
Reference in New Issue
Block a user